ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
8

joint state publisher and robot state publisher

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

marawy_alsakaf gravatar image

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

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

Comments

What do you mean

if i want real data not fake

?

jayess gravatar image jayess  ( 2017-11-06 12:43:46 -0500 )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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
19

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

jayess gravatar image

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

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.


Update:

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

edit flag offensive delete link more

Comments

1

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

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

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

Subscribers: 
 * /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 -0500 )edit
1

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

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

352941

matthewmarkey gravatar image matthewmarkey  ( 2020-05-21 14:19:06 -0500 )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 -0500 )edit

Question Tools

3 followers

Stats

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

Seen: 17,328 times

Last updated: Nov 13 '21