A Dockererized ROS2 Humble development environment for conducting simulatated robotic experimentation involving Drones.
.
├── connect.sh
├── docker
│ └── Dockerfile
├── docker-compose.yml
├── docker_ros_snippets.md
├── LICENSE
├── README.md
├── script_info.txt
├── scripts
│ └── test_gui.sh
├── setup_x11.sh
├── src
│ ├── README.md
│ └── simple_drone_sim
│ ├── LICENSE
│ ├── package.xml
│ ├── resource
│ ├── setup.cfg
│ ├── setup.py
│ ├── simple_drone_sim
│ └── test
└── start.sh
-
Clone this repository:
git clone https://github.com/afeawoL/ros2_drone_sim/ cd ros2_drone_sim
-
Make the start script executable:
chmod +x start.sh
-
Run the simulation:
./start.sh
The start script will automatically:
- Enable X11 forwarding
- Start the Docker container
- Build the ROS2 packages
- Launch the drone simulation with visualization
-
Start the Docker container:
docker compose build docker compose up -d
-
Enter the container:
docker compose exec ros2_drone_sim bash
-
Inside the container, build and run:
cd /root/ros2_ws colcon build --packages-select simple_drone_sim source install/setup.bash ros2 launch simple_drone_sim display.launch.py
If rviz fails to run, test X11 forwarding:
/root/ros2_ws/scripts/test_gui.sh
- Create or modify ROS2 packages in the
src
directory - Build packages inside the container:
cd /root/ros2_ws colcon build source install/setup.bash
- The setup script (
setup_x11.sh
) configures X11 forwarding for GUI applications - If you encounter display issues:
- Make sure X11 is running on your host by running:
./setup_x11.sh)
- Restart the container:
docker compose restart
- Make sure X11 is running on your host by running: