-
Notifications
You must be signed in to change notification settings - Fork 363
Home
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},
doi = {10.1109/OCEANS.2016.7761080}
}
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.
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.
Note: If you have to install Gazebo separately, try installing ROS before installing the Gazebo packages. If you are going to use ROS Kinetic, Gazebo 7 should be installed when downloading
ros-kinetic-desktop-full
, so there is no need to install Gazebo later on. If you are going to use ROS Indigo, you should install Gazebo 7 afterwards, since Indigo's default version is Gazebo 2. For the Gazebo installation instructions, follow this link.
Checkout below the needed dependencies for both ROS Indigo and Kinetic. Choose the ones you need according to the ROS version you are using.
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 protobuf-compiler protobuf-c-compiler
If you don't have the ROS workspace yet, you should run the following and then clone the uuv_simulator
package in the ~/catkin_ws/src
folder:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
wstool init
You can install the package
wstool
usingsudo pip install wstool
.
Configure the environment variables by adding the following lines in ~/.bashrc
(replace kinetic
with indigo
depending on the ROS version you are using).
Note: If you install a version of Gazebo newer than 7.0, you might need to adjust
gazebo-7.0
below. You can find out which version you are using by typinggazebo --version
in your terminal.
source /usr/share/gazebo-7/setup.sh
source /opt/ros/kinetic/setup.bash
source $HOME/catkin_ws/devel/setup.bash
export GAZEBO_PREFIX=$HOME/catkin_ws/install
export GAZEBO_RESOURCE_PATH=${GAZEBO_PREFIX}/share/gazebo-7.0:${GAZEBO_RESOURCE_PATH}
export GAZEBO_MODEL_PATH=${GAZEBO_PREFIX}/share/gazebo-7.0/models:${GAZEBO_MODEL_PATH}
export GAZEBO_PLUGIN_PATH=${GAZEBO_PREFIX}/lib:${GAZEBO_PREFIX}/lib/x86_64-linux-gnu:${GAZEBO_PLUGIN_PATH}
After saving these changes, remember to source the .bashrc
by either typing source ~/.bashrc
in your terminal or reopening the terminal. Finally, clone the UUV simulator package in the folder ~/catkin_ws/src
and build your workspace using:
cd ~/catkin_ws
catkin_make install
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.
If you are having trouble running your application in multiple computers, you can try adding the hostnames and IP addresses of your machines to the /etc/hosts
file of the computer running roscore
.