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?
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?
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.
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?
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?
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.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2020-07-14 17:20:25 -0500
Seen: 1,218 times
Last updated: Jul 14 '20
laser_scan_matcher with YDLidar
Husky overturning when launching Gazebo Simulation
Robot arm falls over on spawn (Gazebo)
Automating terminal commands of ROS using python script
How to read and publish pointcloud2.pointfield[].name ?
Mesh file not loading in RVIZ and Gazebo
Invoking "make -j4 -l4" failed
Contoller Spawner and transform problem in RViz