Preliminary: make sure you have docker installed: instruction.
The main CARIC components (simulator and controller) are run in a ROS1 docker container, and we provide the ROS1-ROS2 bridge to allow users to develop their algorithm in ROS2 dockers. If you want to develop in ROS1, you only need to run the ros1 container.
Clone this package and build docker:
git clone https://github.com/caomuqing/caric_docker
cd caric_docker
docker compose build ros_caricIf the build succeeds, run the following command to run the docker container and build the ros workspace:
docker compose up ros_caricAfter building the ros package, do not close the terminal; open a new terminal. Run the following command to enter the container:
xhost + #allowing allow docker access to screen
docker exec -it ros_caric_container_1 bash # open a container terminalTo run the baseline method:
source devel/setup.bash
roslaunch caric_baseline run.launch scenario:=mbs #other scenarios: hangar, craneYou should see rviz opening up and the drones start moving. You can develop your solution by creating new packages in the workspace ws_caric/src. An example package ws_caric/src/caric_baseline is provided.
Remember to run docker compose down to shut down the containers when you finish running.
Clone this package and build docker:
git clone https://github.com/caomuqing/caric_docker
cd caric_docker
docker compose buildIf the build succeeds, run the following command to run the docker container and build the ros workspace:
docker compose upAfter building the ros package, do not close the terminal; open a new terminal. Run the following command to enter the container:
xhost + #allowing allow docker access to screen
docker exec -it ros_caric_container_1 bash # open a container terminalTo run the baseline method:
source devel/setup.bash
roslaunch caric_baseline run.launch scenario:=mbs
Open a new terminal and go into the ros_bridge container
docker exec -it ros_caric_bridge bash
rosparam load bridge.param #load the ros1-ros2 bridge parameter
ros2 run ros1_bridge parameter_bridge #run ros1_bridgeThe file bridge.param controls which topics are bridged from ROS1 to ROS2.
Note: You can adjust message transmission between domains by editing the configuration files (such as
bridge.param).
Each node is assigned a domain ID using the TARGET_TO_DOMAIN mapping:
| Domain ID | Node |
|---|---|
| 0 | Central domain |
| 1 | Jurong UAV |
| 2 | Raffles UAV |
| 3 | Sentosa UAV |
| 4 | Changi UAV |
| 5 | Nanyang UAV |
| 99 | Ground Control Station |
You can modify the configuration files in caric_mission_ros2/config to adjust:
- Message routing rules between domains
- Communication parameters and frequency
- Message reception strategies for each UAV node
Customize these parameters to suit your multi-domain communication needs.
The PPCom system enables distributed communication between multiple drone nodes across different ROS2 domains.
For detailed instructions, see the caric_mission_ros2 README.
To view topics in a specific ROS2 domain, set the ROS_DOMAIN_ID environment variable.
For example:
docker exec -it ros_caric_drone bash
export ROS_DOMAIN_ID=1
ros2 topic listNotice: The topics you see here are processed through the Line-of-Sight (LOS) communication mechanism.
Set ROS_DOMAIN_ID to the desired domain number to see all ROS2 topics in that domain. This is useful for debugging cross-domain communication and topic mapping.
The file bridge.param governs the topics to be bridged from ROS1 to ROS2.
Remember to run docker compose down to shut down the containers when you finish running.