This repository is a simplified version of the REMARO Summer School Delft 2022 - Underwater robotics hackathon. For more info, please visit: remaro-network/tudelft_hackathon
Tested with:
- Ubuntu 22.04
- ROS2 Humble
- Gazebo (Ignition) Garden
- ArduPilot (Sub-4.1)
- ardupilot_gazebo plugin
- mavros2
- remaro_world
- bluerov2_ignition
Disclaimer Running docker images with graphical user interface is a little bit trick and might not work in all systems. We tested in a system with ubuntu 22.04 and with a NVIDIA gpu. It might not work on systems with AMD gpus, and on MAC.
- Install docker on your machine. You can find instructions here
- Allow non-root users to manage docker. Instructions here
- Install VSCode. Instructions here
- Install nvidia-docker(only needed if you have a nvidia GPU)
Create docker network:
sudo docker network create ros_netIf you a NVIDIA GPU:
xhost +local:root
sudo docker run -it --rm --name ignition --net ros_net -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro --gpus all ghcr.io/remaro-network/tudelft_hackathon:nvidia ros2 launch tudelft_hackathon bluerov_ign_sim.launch.py ardusub:=true mavros_url:='bluerov:14551'If you have an AMD GPU:
xhost +local:root ;
sudo docker run -it --rm --name ignition --net ros_net -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro --device=/dev/dri --group-add video ghcr.io/remaro-network/tudelft_hackathon:non-nvidia ros2 launch tudelft_hackathon bluerov_ign_sim.launch.py ardusub:=true mavros_url:='bluerov:14551'If you have an Intel GPU:
xhost +local:root ;
sudo docker run -it --rm --name ignition --net ros_net -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro --device=/dev/dri:/dev/dri ghcr.io/remaro-network/tudelft_hackathon:non-nvidia ros2 launch tudelft_hackathon bluerov_ign_sim.launch.py ardusub:=true mavros_url:='bluerov:14551'To add your modifications into the docker images you need to rebuild the relevant docker images.
In this case, run the build-dev-images.sh script to rebuild them. And make sure to substitute in the docker run commands the images from rezenders to you local images. I.e: rezenders/ignition:hackathon -> ignition:hackathon-dev and rezenders/ros-foxy-hackathon -> ros-foxy-hackathon:dev
Check instructions here
Before running anything you need to source the workspace. With this command:
source ~/tudelft_hackathon_ws/install/setup.bashOr you can add that to the ~/.bashrc file to prevent needing to source everytime.
echo "source ~/tudelft_hackathon_ws/install/setup.bash" >> ~/.bashrcDon't forget to re-open your terminal after altering the ~/.bashrc file.
In one terminal run ardusub SITL:
sim_vehicle.py -L RATBeach -v ArduSub --model=JSON --consoleIn another terminal run the simulation + mavros + agent:
ros2 launch tudelft_hackathon bluerov_bringup.launch.py simulation:=true ardusub:=falseSimplified system architecture:
The system was designed to be used both with a real or simulated BlueROV2. When used with a simulation, the left nodes are deployed. And when used with the real robot the right nodes are deployed.The agent and MAVROS nodes are always deployed.
First, let's take a look on how the real BlueROV2 works, then we see how the simulation is setup to mimic it.
Simulated BlueROV2: To simulate the BlueROV2 we are using Gazebo (Ignition). Unfortunately, until the moment of writing this readme, there is no sonar plugin for Ignition. Thus, we are using a lidar plugin instead, configured to have the same speed and measurement range as the Ping360 sonar. The bluerov2 model is here and the bluerov2 model with a lidar is here. The world being used for the simulation can be found here, note that there is a buoyancy plugin that sets the "water" density to 1000kg/m3.
Simulated "sonar" bridge: In order to have access to the simulated lidar data with ROS2 we run a bridge between ignition transport and ROS2. Something like this:
Via command line:
ros2 run ros_gz_bridge parameter_bridge lidar@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan -r /lidar:=/scan
With launch file:
package='ros_gz_bridge',
executable='parameter_bridge',
arguments=['lidar@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan'],
remappings=[('/lidar','/scan')],
output='screen'
Note that the topic where the lidar data is published has the same name (/scan) and type (sensor_msgs/LaserScan) as the topic published by the ping360 driver.
ArduSub Sofware In The Loop (SITL): Since when running the simulation we don't have a board with an autopilot installed, we simulate Ardusub as a SITL.
Ardupilot gazebo plugin: Bridge between Ignition and Ardusub. More info can be found here.
MAVROS: The only difference is that for the simulation we need to use a different fcu_url. In this case, udp://:14551@:14555.
Agent: Since all the interfaces are the same, the agent nodes are the same for both simulation and the real robot.
