git clone [email protected]:Suyannesara/ROS2-px4-gazebo-docker.git
mkdir ~/Volumes
2.2 Create a new .env
file in the project root by copying .env.example
and update the HOST_USER
variable with your host username.
complete/complete/v0.1.Dockerfile
. Use one of the following commands to run it:
# To start the service with ROS Foxy
sudo docker compose up -d ros-px4-foxy
# To start the service with ROS Humble
sudo docker compose up -d ros-px4-humble
# To start both services
docker compose up -d --build
Run this command on your terminal (outside the container):
xhost local:docker
Once built, enter the container with:
sudo docker exec -it ros-px4-complete /bin/bash
You can open multiple terminal instances inside the container. To open a new terminal in another bash tab, run the command again.
Tip: Set an alias in your ~/.bashrc
to simplify this command.
Check if ROS2 is recognized:
ros2
If there's an error, run the following inside the container and try ros2
again:
# For ROS Foxy:
source /opt/ros/foxy/setup.bash
# OR
# For ROS Humble:
source /opt/ros/humble/setup.bash
Verify the Ubuntu version:
lsb_release -a
Check if Gazebo opens correctly (it should open an application window):
# For the ROS Foxy container:
gazebo
# OR
# For the ROS Humble container:
gz sim