Install SUAVE locally
To install the exemplar locally, you have to install Gazebo Harmonic, install ROS2 Humble, install ROS_GZ, install ArduSub, install the ArduSub plugin, and finally install the SUAVE workspace.
Install Gazebo Harmonic
Follow the official instructions for installing Gazebo Harmonic.
Install ROS2 Humble
Follow the official instructions for installing ROS2 Humble.
Install ROS_GZ
sudo apt install ros-humble-ros-gzharmonic
Install ArduSub
ArduSub is a subproject within ArduPilot for piloting underwater vehicles.
Disclaimer:
Problems may occur with different combinations of ArduPilot and MavROS versions. This repo was tested with ArduSub commit 571e8c7 (ArduSub 4.7.0-beta4) and mavros 2.14.0.
cd ~/
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
git checkout 571e8c7bd3793fce1bc5184a2f6586feb8a616e5
git submodule update --init --recursive
Tools/environment_install/install-prereqs-ubuntu.sh -y
. ~/.profile
To test if the installation worked, run:
sim_vehicle.py -v ArduSub -L RATBeach --console --map
ArduPilot SITL should open and a console plus a map should appear.
Install ArduSub plugin
Install the dependencies:
sudo apt update
sudo apt install libgz-sim8-dev rapidjson-dev
sudo apt install libopencv-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl
export GZ_VERSION=harmonic
sudo bash -c 'wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list'
rosdep update
rosdep resolve gz-harmonic
# Navigate to your ROS workspace before the next command.
rosdep install --from-paths src --ignore-src -y
Clone and build the repository:
cd ~/
git clone https://github.com/ArduPilot/ardupilot_gazebo
cd ardupilot_gazebo
git checkout 082a0fe231f6e63bc8d1598f1cba461d9e2ea7f5
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j4
Add the required paths:
Assuming that you have cloned the repository in $HOME/ardupilot_gazebo, run:
echo 'export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}' >> ~/.bashrc
echo 'export GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}' >> ~/.bashrc
Now that new environmental variables have been added to your terminal, you need to reload it with
source ~/.bashrc
More info about the plugin can be found in the corresponding repository.
Install SUAVE workspace
Create the workspace and download the required repositories:
mkdir -p ~/suave_ws/src/
cd ~/suave_ws/
If you want to get the most updated version of the repo:
wget https://raw.githubusercontent.com/kas-lab/suave/main/suave.repos
vcs import src < suave.repos --recursive
SEAMS2023: If you want to get the version submitted to SEAMS 2023 instead of the most updated version get the following dependencies instead:
wget https://raw.githubusercontent.com/kas-lab/suave/9e6468896ce766376557ca9522d84f92b70129f1/suave.rosinstall
vcs import src < suave.rosinstall --recursive
Before building the ros_gz package (one of the dependencies), you need to export the gazebo version:
export GZ_VERSION="harmonic"
You can also add this to your ~/.bashrc to make this process easier.
Install Python dependencies:
pip install -r src/suave/requirements.txt
Install the ROS dependencies:
source /opt/ros/humble/setup.bash
cd ~/suave_ws/
rosdep install --from-paths src --ignore-src -r -y
Build the project:
cd ~/suave_ws/
colcon build --symlink-install
If you have memory problems while building the package, run the following command instead, it is slower but uses less memory:
colcon build --symlink-install --executor sequential --parallel-workers 1
Install a MAVROS dependency:
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
sudo bash ./install_geographiclib_datasets.sh