Skip to content

New Underwater Vehicle

crvogt edited this page Apr 4, 2022 · 10 revisions

Creating and Integrating a New U/W Vehicle

Given a visual and dynamic model of an underwater vehicle, this page discuses how to instantiate the model in Gazebo.

In this example we will integrate a new robot with the name virgil that already has visual/collision meshes as well as a texture image file.

Much of the content in this page has its foundation in the RexROV from uuv_simulator

The final description for the robot discussed on this page can be found in dave/urdf/robots/virgil_description

Overview

  1. Create Directories and Import Mesh Files
  2. Build URDF
  3. Add thrusters
  4. Add sensors
  5. Add joystick control
  6. Create launch files to test

Create Directories and Import Mesh Files

First, locate the dave/urdf/robots directory. This directory is the home to a variety of robot descriptions. We'll create package for our new robot, virgil, by running catkin_create_pkg virgil_description. In the newly created virgil_description directory, create three directories: meshes, launch, and urdf. You will not need the src directory, so you can delete it.

Add your meshes and textures to the meshes directory.

Ex. In virgil_description/meshes the contents are virgil.dae, virgil_diffuse.png, and virgil_prop.dae. These are the mesh for the main body of the UUV, the texture image, and the mesh for the propellers respectively.

Note: It may be necessary to edit the mesh file to link to the correct texture filename.

Build URDF

In smilodon_gazebo/urdf create smilodon_gazebo.xacro to do the following...

  1. Create base_link with the rigid-body parameters and the visual/collision meshes
  2. Attach the uuv_underwater_object_ros_plugin and specify the hydrodynamic parameters.
  3. Attach a gazebo_ros_control plugin.
  4. Attache a custom uuv_joint_state_publisher

Add thrusters

Edit smilodon_gazebo/urdf/smilodon_gazebo.xacro to add thruster definition macros.

  1. Define location of the propellors - can superimpose on vehicle mesh
  2. Set the motor constant to map the command (input) to thrust.
  3. User the thruster_snippets.xacro definitions which make use of the ThrusterROSPlugin

Add sensors

Add joystick control

Create launch files to test

  1. Start gazebo with an underwater world.
  2. Load the robot URDF (see next step) to the parameter server
  3. Spawn the robot in the world
  4. Start robot_state_publisher node

Test

roslaunch smilodon_gazebo smilodon.launch 

and monitoring the resulting thrust

rostopic echo /smilodon/thrusters/0/thrust

The custom joy_thrusterop.py has a hardcoded mapping from joystick axes to each thruster. This allows us to drive the vehicle in an open-loop configuration.

Run the telop with

roslaunch uuv_dave joy_thrusterop.launch

Here is another video showing what to expect.

Other vehicle examples

Clone this wiki locally