Unable to publish robot states using joint state publisher GUI.

asked 2020-05-14 05:57:36 -0500

updated 2020-05-14 07:37:47 -0500

Hey. I am trying to publish states via joint_state_publisher gui, but getting a strange output shown below:

image description

As you can clearly see in the above gif file, when I am changing the robot joint values via joint_state_publisher gui, the robot is performing the motion but then disappears. It's motion is kind of fluctuating.

rqt_graph: (Link: https://imgur.com/Fjw8yhM, in case below image is not clearly visible)

image description

After doing some research online, I found that it has something to so with /joint_states(in my case /ow5/joint_states ) topic.

Output of rostopic info /ow5/joint_states:

Type: sensor_msgs/JointState

Publishers: 
 * /ow5/joint_state_publisher (http://G3-572:34487/)
 * /gazebo (http://G3-572:40115/)

Subscribers: 
 * /ow5/robot_state_publisher (http://G3-572:39965/)
 * /link_ros (http://G3-572:36771/)
 * /move_group (http://G3-572:43207/)

I would really appreciate someone's advice/help on this. Thanks in advance!!

edit retag flag offensive close merge delete

Comments

1

Are you sure you are running ROS Kinetic? What is the version of your OS?

Additionally (but unrelated): the joint_state_publisher is not for controlling robots. It's for publishing fake JointState messages. As the name implies, it publishes state, it is not meant to control.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-14 07:27:09 -0500 )edit

Thanks for replying. Yeah, I am running ROS kinetic and ubuntu 16.04.

Anubhav Singh gravatar image Anubhav Singh  ( 2020-05-14 07:35:47 -0500 )edit
1

As you can see in your screenshot and in the output of rostopic info, you have multiple publishers to /ow5/joint_states. That is probably going to conflict.

I believe this relates to my earlier comment, where I wrote the JointStatePublisher is not for controlling a robot. By including the JSP in your node graph you're essentially publishing fake (and conflicting) JointState messages, which are both consumed by the robot_state_publisher (and RViz).

There is a chance this is the cause of your problem.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-14 07:40:44 -0500 )edit

This makes sense. Thank you so much.

Anubhav Singh gravatar image Anubhav Singh  ( 2020-05-14 08:01:57 -0500 )edit

So if I am interpreting this correctly, when running a gazebo simulation, should the robot_state_publisher be removed?

matthewmarkey gravatar image matthewmarkey  ( 2020-05-21 04:43:31 -0500 )edit

No, that's incorrect.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-22 05:18:07 -0500 )edit

I am currently having the same problem. How did you fix it?

Aish gravatar image Aish  ( 2021-04-30 06:57:56 -0500 )edit

@Aish please read second comment (by gvdhoorn) properly. In my case, /gazebo and /ow5/joint_state_publisher both are publishing to /ow5/joint_states topic. That's the reason why the robotic arm's state is resetting (not the best word to use) to its current state again and again.

Anubhav Singh gravatar image Anubhav Singh  ( 2021-05-02 06:43:17 -0500 )edit