The docker-sgp-tools package provides the following docker compose scripts:
robot-compose.yml
: A minimal docker container used to run SGP-Tools ROS2 package on ArduPilot-based robots.sitl-compose.yml
: A GUI-based docker container with ROS2, Gazebo, ArduPilot SITL, and SGP-Tools used for simulating ArduPilot vehicles and testing SGP-Tools IPP code.
- docker
- docker compose
- (Optional) NVIDIA Container Toolkit
- (Optional) WSLg
Run the following commands to start the SITL docker container:
git clone --recurse-submodules https://github.com/itskalvik/docker-sgp-tools.git
cd docker-sgp-tools
docker compose -f sitl-compose.yml pull
docker compose -f sitl-compose.yml up -d
docker compose -f sitl-compose.yml exec sgptools bash
Use robot-compose.yml
to run the minimal docker container.
Note: The Gazebo-based simulator requires an Nvidia GPU for reliable performance.
Use docker compose -f sitl-compose.yml exec sgptools bash
to get a new terminal. Run the following commands in separate terminals in the docker container:
-
Launch Gazebo with the Blue Robotics BlueBoat ASV:
gz sim -v4 -r blueboat_waves.sdf
-
Launch ArduPilot SITL:
sim_vehicle.py -v Rover -f rover-skid --model JSON --console --map -N -L RATBeach
Note:
- Ensure the MAV Console shows
AHRS
andGPS
in green before running the next command - Ensure the MAV Map shows the vehicle before running the next command
- Restart sim_vechile.py if you get the following message:
paramftp: bad count
- Ensure the MAV Console shows
-
Launch the SGP-Tools Online/Adaptive IPP method:
ros2 launch ros_sgp_tools single_robot.launch.py
First, setup buildx to build the containers for both arm64 and amd64 platforms:
docker buildx create --name multi-arch \
--platform "linux/arm64,linux/amd64" \
--driver "docker-container"
docker buildx use multi-arch
Next, clone the repo and build the container.
git clone --recurse-submodules https://github.com/itskalvik/docker-sgp-tools.git
cd docker-sgp-tools
docker compose -f sitl-compose.yml build
Use robot-compose.yml
to build the minimal docker container.
-
The docker compose down command stops and removes containers, networks, volumes, and images, making it suitable for completely clearing all resources deployed by an application.
docker compose -f sitl-compose.yml down
-
The docker compose stop command just pauses running containers without removing them, which is ideal for temporary halts.
docker compose -f sitl-compose.yml stop
Based on Dockerfiles from the following repos: