Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
Musa Morena Marcusso Manhães edited this page Nov 16, 2016 · 34 revisions

Welcome to the UUV Simulator Wiki

If you are using this simulator for your publication, please cite:

@inproceedings{Marcusso_2016,
  author    = {Musa Morena Marcusso Manh{\~{a}}es and Sebastian Scherer and Martin Voss and Luiz Ricardo Douat and Thomas Rauschenbach},
  title     = {{UUV} Simulator: A Gazebo-based Package for Underwater Intervention and Multi-Robot Simulation},
  year      = {2016},
  pages     = {1-8},
  month     = {September},
  booktitle = {OCEANS'16 MTS/IEEE Monterey}
}

This simulation package is a set of plugins for Gazebo for underwater robotics and ROS modules. The plugins allow the simulation of vehicles, thrusters, fins and a series of sensors. The Gazebo plugins are kept ROS-free so that they can extended to other middlewares, if desired.

Check the video for simulation trials in the EU-project SWARMs using the UUV Simulator.

Requirements

We assume you are using at least Ubuntu 14.04.4 LTS and ROS Indigo, even though the simulator package should also work with later versions (minor adjustments may be required). Please refer to the instructions for ROS Indigo installation here, and for ROS Kinetic here.

Dependencies

After the installation of ROS Indigo, the following packages are also needed:

sudo apt-get install gazebo7 libgazebo7-dev protobuf-compiler protobuf-c-compiler ros-indigo-gazebo7-msgs ros-indigo-gazebo7-plugins ros-indigo-gazebo7-ros ros-indigo-gazebo7-ros-control ros-indigo-gazebo7-ros-pkgs ros-indigo-effort-controllers ros-indigo-image-pipeline ros-indigo-image-common ros-indigo-perception ros-indigo-perception-pcl ros-indigo-robot-state-publisher ros-indigo-ros-base ros-indigo-viz python-wstool python-catkin-tools python-catkin-lint ros-indigo-hector-localization ros-indigo-joy ros-indigo-joy-teleop libopencv-dev

To use the vehicles with robotic manipulators using ROS Indigo, it might also be necessary to use a different version of the ros-control modules (listed below). In that case, clone the following repositories in the src folder:

git clone https://github.com/ros-controls/control_msgs.git
cd control_msgs
git checkout c0b322b
cd ..

git clone https://github.com/ros-controls/control_toolbox.git
cd control_toolbox
git checkout 5ccdc6d
cd ..

git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git
cd gazebo_ros_pkgs
git checkout 231b76d
cd ..

git clone https://github.com/ros-controls/realtime_tools.git
cd realtime_tools
git checkout bf55298
cd ..

git clone https://github.com/ros-controls/ros_controllers.git
cd ros_controllers
git checkout b4dc152
cd ..

If you installed ROS Kinetic, then install the following packages:

sudo apt-get install ros-kinetic-gazebo-msgs ros-kinetic-gazebo-plugins ros-kinetic-gazebo-ros ros-kinetic-gazebo-ros-control ros-kinetic-gazebo-ros-pkgs ros-kinetic-effort-controllers ros-kinetic-image-pipeline ros-kinetic-image-common ros-kinetic-perception ros-kinetic-perception-pcl ros-kinetic-robot-state-publisher ros-kinetic-ros-base ros-kinetic-viz python-wstool python-catkin-tools python-catkin-lint ros-kinetic-hector-localization ros-kinetic-joy ros-kinetic-joy-teleop libopencv-dev

Creating and configuring a workspace

If you don't have the ROS workspace yet, you should run the following:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
wstool init

Configure the environment variables by adding the following lines in ~/.bashrc (replace indigo for kinetic depending on the ROS version you are using).

Note: If you install a version of Gazebo newer than 7.3, you might need to adjust gazebo-7.3 below. You can find out which version you are using by typing gazebo --version in your terminal.

source /usr/share/gazebo-7/setup.sh
source /opt/ros/indigo/setup.bash
source $HOME/catkin_ws/devel/setup.sh

export GAZEBO_PREFIX=$HOME/catkin_ws/install
export GAZEBO_RESOURCE_PATH=${GAZEBO_PREFIX}/share/gazebo-7.3:${GAZEBO_RESOURCE_PATH}
export GAZEBO_MODEL_PATH=${GAZEBO_PREFIX}/share/gazebo-7.3/models:${GAZEBO_MODEL_PATH}
export GAZEBO_PLUGIN_PATH=${GAZEBO_PREFIX}/lib:${GAZEBO_PREFIX}/lib/x86_64-linux-gnu:${GAZEBO_PLUGIN_PATH}

Finally, build the package in your workspace using:

cd ~/catkin_ws
catkin_make install

Example of usage

Start an empty underwater environment:

roslaunch uuv_descriptions empty_underwater_world.launch

Spawn the remotely operated vehicle RexROV (find the robot description files under uuv_descriptions/models/rexrov) as follows:

roslaunch uuv_descriptions upload_rexrov.launch mode:=default x:=0 y:=0 z:=-20 namespace:=rexrov

for which mode stands for the configuration of the vehicle to be used. It is important to create the vehicles under a unique namespace to allow simulation of multiple vehicles in the same scenario.

You can start a velocity controller with a joystick teleoperation node as:

roslaunch uuv_control_cascaded_pid joy_velocity.launch uuv_name:=rexrov model_name:=rexrov joy_id:=0

In this case model_name refers to the vehicle model, which can be different from the namespace. It is a necessary parameter to load the correct controller and thruster allocation matrix coefficients. The joystick ID is already set zero as default. To find the correct joystick index, you can install and run jstest-gtk.

The mapping of the joystick teleoperation node is set as default for the XBox 360 controller. Remapping is possible by passing the correct indexes of the desired axes in the launch file located in the uuv_vehicle_teleop.

Sometimes Gazebo takes a while to close. Try killall -9 gzserver gzclient in case that happens.