Note: This tutorial assumes that you have completed the previous tutorials: Overview.
(!) Please ask about problems and questions regarding this tutorial on Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

How to add a new robot type

Description: How to add a new robot type to use in concert service gazebo

Keywords: rocon concert app_manager simulation multirobot

Tutorial Level: BEGINNER

Next Tutorial: How to spawn robots in concert gazebo


This tutorial guides how to add a new type of gazebo robot in concert.

Concert Gazebo Type

Robot type in concert gazebo consists of two files.


As described in [concert_service_gazebo/Tutorials/indigo/Overview#.concert_gazebo|Overview]], it defines what this robot type is, pointer to gazebo_plugin launcher, and flip_rules. pub, sub, and srv can be added as flip_rule. Also note that /tf and /clock are getting flipped by default.

   1 name: turtlebot
   2 launch: concert_service_gazebo/turtlebot.launch
   3 flip_rule:
   4   pub:
   5     - odom
   6     - camera/.*
   7     - scan
   8     - mobile_base/.*
   9   sub:
  10     - cmd_vel_mux/.*

Gazebo Plugin Launcher

The following example is kobuki gazebo plugin launcher. The launcher should have name, loc_x, loc_y, loc_z, loc_roll, loc_pitch, loc_yaw, and world_namespace args. These args get configured by gazebo service in runtime.

   1 <launch>
   2   <arg name="name" />
   3   <arg name="loc_x" />
   4   <arg name="loc_y" />
   5   <arg name="loc_z" />
   6   <arg name="loc_roll"/>
   7   <arg name="loc_pitch"/>
   8   <arg name="loc_yaw"/>
   9   <arg name="world_namespace"/>
  10   <arg name="use_full_gazebo_model" default="true"/>
  11   <arg name="base_prefix" default="mobile_base"/>
  13   <param name="tf_prefix" value="$(arg name)"/>
  14   <param name="base_prefix" value="$(arg base_prefix)"/>
  15   <param name="robot_description" command="$(find xacro)/ '$(find kobuki_description)/urdf/kobuki_standalone.urdf.xacro' use_full_gazebo_model:=$(arg use_full_gazebo_model)"/>
  16   <node pkg="gazebo_ros" type="spawn_model" name="spawn_$(arg name)" 
  17            args="-param robot_description
  18                  -x $(arg loc_x)
  19                  -y $(arg loc_y)
  20                  -z $(arg loc_z)  
  21                  -R $(arg loc_roll)
  22                  -P $(arg loc_pitch)
  23                  -Y $(arg loc_yaw)
  24                  -unpause 
  25                  -urdf 
  26                  -model $(arg name)
  27                  -gazebo_namespace $(arg world_namespace)
  28                 " respawn="false" output="screen">
  29   </node>
  31   <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
  32     <param name="publish_frequency" type="double" value="30.0" />
  33     <param name="tf_prefix" value="$(arg name)"/>
  34   </node>
  36   <node pkg="nodelet" type="nodelet" name="$(arg name)_nodelet_manager" args="manager"/>
  37 </launch>

The other examples:


Gazebo service collects available robot types via package export. Please add relative path to concert_gazebo file with concert_gazebo tag to package.xml. Check concert_service_gazebo/package.xml as example

   1 <package>
   2   ...
   3   <export>
   4     <concert_gazebo>relative/path_to/robot.concert_gazebo</concert_gazebo>
   5   </export>
   6 </package>

What's Next?

Wiki: concert_service_gazebo/Tutorials/indigo/How to add a new robot type (last edited 2015-06-09 05:18:09 by jihoonl)