Tutorials/1.4/using the ros plugins


 * 1) Configure the ROS and Gazebo

1. Install ros  with the package ros-groovy-desktop-full 2. install gazebo

Do not forget to include in the path ros and gazebo

echo "source /opt/ros/groovy/setup.bash" >> ~/.bashrc source ~/.bashrc echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc source ~/.bashrc

3. add the plugin of ros to GAZEBO_PLUGIN_PATH

export GAZEBO_PLUGIN_PATH=/opt/ros/groovy/stacks/simulator_gazebo/gazebo_plugins/lib/:/opt/ros/groovy/stacks/simulator_gazebo/gazebo/lib:$GAZEBO_PLUGIN_PATH

to confirm

echo $GAZEBO_PLUGIN_PATH

Note this was taken from


 * 1) Run Gazebo  with the ROS plugins

1. run roscore 2. run gazebo -s libgazebo_ros_api_plugin.so 3. Copy model created to ~/.gazebo/models or include the path of the model in 4. Insert a model from the menu insert 5. Now you can see the ros topics rosrun rqt_topic rqt_topic


 * 1) Inserting plug in in the model

Information about the Gazebo plugins for ros can be found in here we show how to use some of them.

Create a model like are shown in the others tutorials and complement with the next tags for the sensor that you which


 * 1) CAMERA

1. for insert a camera make a Link and insert the next tags:

 false 0.05 0.05 0.05 0 0 0 0.1  0.1 0.1 0.1  1.047 320 240  0.1  100 1 30 true  Vilma_Car Vilma_Camera Vilma_Camera <cameraInfoTopicName>Vilma_Camera_Info</cameraInfoTopicName> <FrameName>Vilma_Camera</FrameName> <Cy>0</Cy> <Cx>0</Cx> <updateRate>30.0</updateRate>

For a desciption of characteristicos of the sensor for gazebo go to. For the tags of the rosplugin open the next file /opt/ros/groovy/stacks/simulator_gazebo/gazebo_plugins/src/gazebo_ros_camera_utils.cpp where you will find the tags required (if you know a nice way talk me!):


 * 
 * 
 * , default to empty
 * <frameName>, defaults to /world
 * <updateRate>, defaults to 0
 * <CxPrime>, defaults to 0
 * <Cx>, defaults to 0
 * <Cy>, defaults to 0
 * <focalLength>, defaults to 0
 * <hackBaseline>, defaults to 0
 * <distortionK1>, defaults to 0
 * <distortionK2>, defaults to 0
 * <distortionK3>, defaults to 0
 * <distortionT1>, defaults to 0
 * <distortionT2>, defaults to 0

Note: gazebo_ros_camera_ simulation does not support non-zero distortion parameters right now, your simulation maybe wrong.

For more information about the parameters review intrinsic parameters of a camera


 * 1) LIDAR

For insert a lidar make in a link that you wish insert the next tags:

<sensor name="base_laser_front" type="ray"> 2 0 0.3 0 0 0 640  1 <min_angle>-1.570000</min_angle> <max_angle>1.570000</max_angle> 0.050000 5.600000  0.360000 1</always_on> 10.000000</update_rate> 1 <plugin filename="libgazebo_ros_laser.so" name="LIDAR_en_ros"> Vilma_Car</robotNamespace> <frameName>Vilma_lidar</frameName> <updateRate>10.0</updateRate>

For a desciption of characteristicos of the sensor for gazebo go to for ros open the next file /opt/ros/groovy/stacks/simulator_gazebo/gazebo_plugins/src/gazebo_ros_laser.cpp where you will find the tags required (if you know a nice way talk me!):


 * <frameName>, defaults to /world
 * <topicName>, defaults to /world
 * <gaussianNoise>, defaults to 0.0
 * <hokuyoMinIntensity>, defaults to 101
 * <updateRate>, defaults to 0


 * 1) IMU

For insert a IMU for ros insert the next tags in a

<plugin filename="libgazebo_ros_imu.so" name="imu_en_ros"> <bodyName>chassis</bodyName> Vilma_Car</robotNamespace> <topicName>Vilma_IMU</topicName>

for ros open the next file /opt/ros/groovy/stacks/simulator_gazebo/gazebo_plugins/src/gazebo_ros_imu.cpp where you will find the tags required (if you know a nice way talk me!):


 * <topicName>, defaults to /default_imu
 * <serviceName>, defaults to /default_imu (it create a service in ros but i could not request information from there)
 * <gaussianNoise>, defaults to 0.0
 * <bodyName>,  (the name of the link to sensor)
 * <xyzOffset>, defaults to 0s
 * <rpyOffset>, defaults to 0s

For insert a IMU to be read like a topic in Gazebo between the link that you want to measure

<sensor name="Vilma_IMU" type="imu"> 0 0.000000 0.5 0.000000 -0.000000 0.000000 __default_topic__ 1</always_on> 30</update_rate>

Documentation of the tags find in.

The imu sensor and the imu plugin are different because the ros plugin use a model plugin and not a sensor plugin.