How to update joint state in Rviz
I have a server to publish the joint states of the robot. Now I need to update the joint states in Rviz based on the server’s data. What is the common way of doing it?
Asked by Chao Chen on 2020-07-14 17:20:25 UTC
Answers
RVIZ should automatically reflect the joint state that's published. Have you checked to make sure that your fixed frame in rviz and the frame i.d. in the joint state message are correct?
Asked by bmgatten on 2020-07-14 17:36:01 UTC
Comments
I am new to ROS. I mean the server just sends the joints angle, not in sensor_msg/joint_state topic. I need to pack the information from the server and sent out again. Will this customized publisher conflicting with the existing default “joint state publisher” from ROS package?
Asked by Chao Chen on 2020-07-14 17:43:22 UTC
I have limited experience with using joint state publisher but I recall there being interference between my custom sensor_msg/joint_state topic what the "joint state publisher" node was publishing. I would recommend removing the ROS package and using your own publisher which takes the joint angle and publishes it into a standard joint_state message.
Asked by bmgatten on 2020-07-14 17:46:40 UTC
You should use the robot_state_publisher
package's state_publisher
node to transform your joint states into transforms. It will subscribe to the joint_states
topic and publish a TF message when a joint changes position. You will also need to provide a URDF of your robot because the state_publisher
node needs to know how the joints are structured in order to calculate the transforms from the joint angles.
These transforms can be easily displayed in rviz using the TF visualization.
Asked by Geoff on 2020-07-14 18:22:15 UTC
Comments