Ask Your Question

encoder for PR2 in gazebo

asked 2012-11-12 19:39:47 -0500

Albert K gravatar image

updated 2014-01-28 17:14:15 -0500

ngrennan gravatar image

According to the tutorial of pr2_controllers :

I can send a command and use the actionlib to control the controller, like openning the gripper, moving the head, moving the arm... etc. But how can I record or monitor the actual joint value of the controller, which is the function of an encoder, and then maybe plot it out using rxplot or record and replay using rxbag.

I guess that it might be the topic published from gazebo :


, which is of the type :


Here is the document :

I would like to know the meaning of all these entries and which entry I should monitor to do the work as an encoder, or are there any other better approach to do the same thing?

Thanks for any advice~

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-12 21:27:10 -0500

Lorenz gravatar image

updated 2012-11-15 21:22:44 -0500

If you just want the joint positions, i.e. the encoder values, and maybe velocities and forces or torques, you can subscribe to the /joint_states topic which is of type sensor_msgs/JointState. It contains for each joint its current position, velocity and effort (i.e. force or torque).

The state topics published by the controllers are controller specific and might differ in their message type.

Update: There are definitely differences between /joint_states and the joint's state topic. The type of the /[controller_name]/state topic is not defined anywhere at all. Controllers are free to use whatever type they want and don't even need to provide it at all. The values you are referring to are unfortunately undocumented and mainly for debugging purposes. set_point is probably the goal point. According to the source code, processed_value refers to the current input value of the controller, e.g. velocity for a velocity controller and processed_value_dot is probably its derivative. I would not suggest to use /[controller_name]/state since its value are highly controller specify, not joint/encoder. And if you disable a controller and switch to another one, it will publish its data on a different topic.

edit flag offensive delete link more


Are there any differences between /joint_states and the /[controller_name]/state. The controller specific one provides more information like set_point, process_value, process_value_dot...etc. Do you have any idea about there meanings? Thanks~

Albert K gravatar image Albert K  ( 2012-11-15 16:37:49 -0500 )edit

Thanks for the detailed explanation~!

Albert K gravatar image Albert K  ( 2012-11-15 23:03:40 -0500 )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: 2012-11-12 19:39:47 -0500

Seen: 891 times

Last updated: Nov 15 '12