THIS PAGE IS DEPRECATED - PRESERVED FOR HISTORICAL PURPOSES.
Basic operation of the Kingfisher USV in the Gazebo simulation environment requires
- A physical description of the USV - supplied by the ros-indigo-kingfisher-description package
- A Gazebo Plugin to define the dynamics of the USV -
The problem is that plugin libraries (compiled binaries) available from Clearpath robotics are for older versions of ROS (Hydro) and Gazebo (1.9).
We assume that you are using the NPS ROS development environment: Ubuntu 14.04 and ROS Indigo
You should have the following packages installed
- ros-indigo-kingfisher-description: provides the URDF description of the shape and size of the USV
- ros-indigo-kingfisher-msgs: defines the kingfisher-specific ROS messages - including the "cmd_drive" message type used to command the USV.
- ros-indigo-hector-gazebo-plugins: defines the IMU and GPS simulators as plugins to Gazebo
Gazebo Plugin: Kingfisher Dynamics (USV Model)
The dynamic model of the USV is defined in the Gazebo plugin. This C++ program is included in the kingfisher_plugins ROS package (https://gitlab.nps.edu/bsbingha/kingfisher_plugins) in the src/kingfisher_plugin.cpp source file. Currently there are two ways to get and use this plugin (in the future we hope to have an Ubuntu package):
- Use the pre-compiled shared library file and install it by hand.
- Build the library file from the source code in the git repository.
Both option are described below
Option 1: Using Pre-Compiled Plugin
Still working on this and need to test
Option 2: Building the Gazebo Plugin from Source
We will need to compile the Gazebo plugin for this updated version of ROS/Gazebo.
Git a working copy of the plugin source from https://gitlab.nps.edu/bsbingha/kingfisher_plugins and place it in your catkin workspace by doing the following
Now we'll need to compile the source code. The Gazebo plugin that defines the dynamics is defined in kingfisher_plugin/src/kingfisher_plugin.cpp
With any luck the project will build without errors and you will see something like this...
Notice the lines in green and red which are encouraging signs that the library was build. If you look in ~/catckin_ws/devel/lib/ you should see the file libkingfisher_gazebo_plugins.so which is the compiled library that will be used by Gazebo
Launching a Kingfisher in Gazebo
We will use a separate ROS package to create an instance of the model and plugin - this is referred to as spawning the model. Git the kingfisher_gazebo package (https://gitlab.nps.edu/bsbingha/kingfisher_gazebo) from gitlab...
Now we should be able to use a launch file to do the following...
- Start Gazebo
- Load the URDF description of the Kingfisher in the parameter server. This includes our Gazebo plugin to define the dynamics
- Start the robot_state_publisher node
- Spawn the Kingfisher within Gazebo
If successful you should see something like this...
Note: Sensor Simulation - IMU and GPS
Two Gazebo plugins are used to define the simulation of sensor data: hector_gazebo_ros_imu and hector_gazebo_ros_gps. The parameters of these values are currently defined in the base.urdl.xacro file (in the kingfisher_gazebo git repository). It is a bit problematic that the parameters are defined inside the same file that defines the physical model - they should probably be moved to a separate xacro file and or defined as xacro parameters so that they can be defined in the launch file or a yaml config file.
Failed to load plugin
Verified that the libkingfisher_gazebo_plugin.so was created and is in catkin_ws/devel/lib (where catkin puts our compiled library).
Reading the error above, it turned out there was an older version of libkingfisher_gazebo_plugins.so in the directory /usr/lib/x86_64-linux-gnu/gazebo-2.2/plugins. Using ldd I determined that this older version was linked to shared libraries not on the machine. I moved the older version to a different name...
so that Gazebo would use the version in catkin_ws/devel/lib. Then things worked!