Home | Tutorials | Wiki | Issues
Ask Your Question
0

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?

Edit:

SDF Snippet:

<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
  <robotNamespace>valve</robotNamespace>
</plugin>
edit retag flag offensive close merge delete

Comments

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
1

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

Hi,

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

Comments

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
1

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:

joint_state_controller:
  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                                                                                            
                                        right_position_trajectory_controller                                                                              
                                        left_position_trajectory_controller                                                                               
                                        " />

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

edit flag offensive delete link more

Comments

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
0

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:

http://gazebosim.org/tutorials?tut=roscontrol&cat=connectros

edit flag offensive delete link more

Comments

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

Stats

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

Seen: 2,216 times

Last updated: Aug 14 '14