Gazebo | Ignition | Community
Ask Your Question

Publishing JointStates in ROS with Gazebo

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

David Lu gravatar image

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

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 -0500 )edit

Yes, see edit.

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

3 Answers

Sort by ยป oldest newest most voted

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


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 -0500 )edit

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

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 -0500 )edit

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

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 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 3,386 times

Last updated: Aug 14 '14