ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

joint state publisher and robot state publisher

asked 2017-11-06 04:46:49 -0600

marawy_alsakaf gravatar image

updated 2021-11-13 09:31:26 -0600

lucasw gravatar image

What is the difference between joint_state_publisher and robot_state_publisher? I understand that I get robot state publisher from the URDF but the joint state? What if i want real data not fake?

edit retag flag offensive close merge delete


What do you mean

if i want real data not fake


jayess gravatar image jayess  ( 2017-11-06 12:43:46 -0600 )edit

i mean if i want joint state from real robot not for simulation

marawy_alsakaf gravatar image marawy_alsakaf  ( 2017-11-06 13:00:51 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-06 12:48:31 -0600

jayess gravatar image

updated 2017-11-06 13:57:55 -0600

From the robot_state_publisher wiki:

robot_state_publisher uses the URDF specified by the parameter robot_description and the joint positions from the topic joint_states to calculate the forward kinematics of the robot and publish the results via tf.

From the joint_state_publisher wiki:

This package publishes sensor_msgs/JointState messages for a robot. The package reads the robot_description parameter, finds all of the non-fixed joints and publishes a JointState message with all those joints defined.

Can be used in conjunction with the robot_state_publisher node to also publish transforms for all joint states.

Basically, the robot_state_publisher publishes the tf transforms of your robot based on its URDF file. You can also publish the joint states using the joint_state_publisher or do it yourself. Either way, the robot_state_publisher uses this information to calculate the forward kinematics of your robot.


If you want to publish your own sensor_msgs/JointState messages then take a look at this tutorial.

edit flag offensive delete link more



ok so i should now publish my jointstate (as in the tutorial) but for robot state i did not need to write any node, i called the robot state publisher in my launch file with URDF and it worked am i right ?

marawy_alsakaf gravatar image marawy_alsakaf  ( 2017-11-06 14:06:34 -0600 )edit

I have used both the joint_state_publisher and robot_state_publisher in my demo_gazebo.launch file shown here...

I am publishing to joint_states from multiple sources, but I am unsure of how to rectify the situation. The current Gazebo output can be seen here.

With my rostopic info joint_states:

homefolder@ubuntu:~$ rostopic info joint_states
Type: sensor_msgs/JointState

 * /joint_state_publisher (http://ubuntu:41201/)
 * /gazebo (http://ubuntu:34151/)

 * /move_group (http://ubuntu:39291/)
 * /joint_state_publisher (http://ubuntu:41201/)

I am really lost on what I am doing wrong.

matthewmarkey gravatar image matthewmarkey  ( 2020-05-21 04:59:12 -0600 )edit

@matthewmarkey you should ask a new question. Comments aren't the place to ask a new question

jayess gravatar image jayess  ( 2020-05-21 14:05:53 -0600 )edit

Ok, I have done this. Do you have a minute to give some advice? @jayess


matthewmarkey gravatar image matthewmarkey  ( 2020-05-21 14:19:06 -0600 )edit

Is it correct then that if the URDF does not define any joints that can move then one doesn't ever need to launch launch_state_publisher?

pitosalas gravatar image pitosalas  ( 2021-04-04 16:54:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-11-06 04:46:49 -0600

Seen: 16,046 times

Last updated: Nov 13 '21