-
Notifications
You must be signed in to change notification settings - Fork 73
New Underwater 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
- Create Directories and Import Mesh Files
- Build URDF
- Add thrusters
- Add sensors
- Add joystick control
- Create launch files to test
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.
In smilodon_gazebo/urdf
create smilodon_gazebo.xacro
to do the following...
- Create
base_link
with the rigid-body parameters and the visual/collision meshes - Attach the
uuv_underwater_object_ros_plugin
and specify the hydrodynamic parameters. - Attach a
gazebo_ros_control
plugin. - Attache a custom
uuv_joint_state_publisher
Edit smilodon_gazebo/urdf/smilodon_gazebo.xacro
to add thruster definition macros.
- Define location of the propellors - can superimpose on vehicle mesh
- Set the motor constant to map the command (input) to thrust.
- User the thruster_snippets.xacro definitions which make use of the ThrusterROSPlugin
- Start gazebo with an underwater world.
- Load the robot URDF (see next step) to the parameter server
- Spawn the robot in the world
- Start
robot_state_publisher
node
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