This simulator uses a combination of multiple physics packages to build a test environment for Unmanned Surface Vehicles (USV). We’ll use it, at first, to develop and test control and trajectory strategies for USVs. but it can be easily adapted to other applications. It contains multiple robot models such as propeled boats(rudder boat, differential boat, airboat) and sailboat. Boats are affected by waves, wind and water currents. To do that, we curently use UWsim for water surface modeling, we also load HEC-RAS output files with water speed of river and channel simulations. We simulate wind current with OpenFoam simulator. All those features alow to disturb the movement of boats in a realistic way.
Prerequisites
You need Ubuntu Linux 16.04 since the current version of this simulator uses ROS Kinetic. To install ROS Kinetic and some additional packages, run the following commands:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full ros-kinetic-control-* ros-kinetic-osg-markers ros-kinetic-move-base -y
sudo rosdep init
rosdep update
sudo echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Now run the following commands to download the dependencies of usv_sim:
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential python-rosdep python-wxtools python-lxml python-pathlib python-h5py python-scipy python-geolinks python-gdal -y
sudo apt-get install libfftw3-* libxml++2.6-* libsdl-image1.2-dev libsdl-dev -y
Installing
To run the packages of usv_sim you need a catkin workspace. If you already have a workspace you may jump to the Downloading and installing subsection.
Creating a catkin workspace
source /opt/ros/kinetic/setup.bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
Downloading and installing usv_sim stack
Clone the usv_sim repository in the src folder of your catkin workspace:
cd ~/catkin_ws/src
git clone https://github.com/disaster-robotics-proalertas/usv_sim_lsa.git
cd usv_sim_lsa
git submodule init
git submodule update
Run the instalation script:
cd ~/catkin_ws/src/usv_sim_lsa
./install_usv_sim
Compile the stack:
cd ~/catkin_ws/
catkin_make_isolated --install
source install_isolated/setup.bash
To run a scenario:
roslaunch usv_sim airboat_scenario1.launch parse:=true
roslaunch usv_sim airboat_scenario1.launch parse:=false
The simulation might take some time to initialize if you’re launching gazebo for the first time. If the simulation dosen’t starts you should close it, run gazebo separately (command gazebo in the terminal), wait for gazebo to open (it is downloading some models), close gazebo and then try to run the scenario again.
Make sure your graphic card driver is up to date.
Running the tests
On main folder of usv_sim_lsa, there are some scripts that run testing scenarios on Diluvio’s River in Porto Alegre, Brazil. Each scenario is configured to test the boat control on executing some common maneuveurs (see image below). Besides that, you can run the following scripts:
scenario1: boat should navigate through two lines of buoys.
scenario2: boat should avoid colision with 3 buoys.
scenario3: boat should execute zigzag to cover an area.
To execute water simulation to those scenarios, you should run the script named waterCurrentDiluvio