Gazebo | Ignition | Community
Ask Your Question

Publishing JointStates in ROS with Gazebo

asked 2014-08-11 17:13:13 -0600

David Lu gravatar image

updated 2014-08-13 10:26:06 -0600

I am loading a SDF into Gazebo using the gazebo_ros/spawn_model. I am loading a joint_state_controller through the controller_manager and its even publishing a joint_state message. However, there are no joints listed in the joint_state message despite it containing multiple not-fixed joints.

Any ideas how to make the joint_state message include the proper joints?


SDF Snippet:

<plugin name="gazebo_ros_control" filename="">
edit retag flag offensive close merge delete


this is using gazebo\_ros\_control?

davetcoleman gravatar imagedavetcoleman ( 2014-08-13 01:29:28 -0600 )edit

Yes, see edit.

David Lu gravatar imageDavid Lu ( 2014-08-13 10:27:03 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2014-08-14 05:05:58 -0600


I am not absolute sure about this but I think this plugin requires an URDF to work correctly. the gazebo_ros_control plugin will block until it gets the urdf from the server( method getURDF from gazebo_ros_control_plugin.cpp )

I guess this causes your problems...

edit flag offensive delete link more


This looks promising, because I have a URDF, but it wasn't under the default robot_description parameter.

David Lu gravatar imageDavid Lu ( 2014-08-14 08:40:55 -0600 )edit

answered 2014-08-14 02:09:51 -0600

davetcoleman gravatar image

Do you have a .yaml file that you load with the controller manager that includes:

  type: joint_state_controller/JointStateController
  publish_rate: 50


In my launch file for Baxter I have:

<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find baxter_control)/config/gazebo_controllers.yaml" command="load"/>

<!-- load the default controllers -->
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
      output="screen" ns="/robot" args="joint_state_controller                                                                                            
                                        " />

I haven't worked with Gazebo / ros_control in a while though, so my memory is hazy.

edit flag offensive delete link more


Yes, I include that info in the parameter server. The problem is it doesn't publish any joints.

David Lu gravatar imageDavid Lu ( 2014-08-14 08:37:41 -0600 )edit

answered 2014-08-13 03:27:04 -0600

spawning models with the spawn_model script does not directly start plugins to publish `joint_states

Is there a gazebo_ros_control plugin in your sdf(urdf)

if not you might want to have a look at this tutorial:

edit flag offensive delete link more


As per my edit, I am using gazebo_ros_control, and am starting the plugin using controller_manager.

David Lu gravatar imageDavid Lu ( 2014-08-13 10:33:51 -0600 )edit

Question Tools

1 follower


Asked: 2014-08-11 17:13:13 -0600

Seen: 6,479 times

Last updated: Aug 14 '14