0
$\begingroup$

Rosanswers logo

According to the tutorial of pr2_controllers :

http://ros.org/wiki/pr2_controllers/Tutorials

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 :

/[controller_name]/state

, which is of the type :

pr2_controllers_msgs/JointTrajectoryControllerState

Here is the document :

http://ros.org/doc/fuerte/api/pr2_controllers_msgs/html/msg/JointControllerState.html

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~


Originally posted by Albert K on ROS Answers with karma: 301 on 2012-11-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Lorenz with karma: 22731 on 2012-11-12

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Albert K on 2012-11-15:
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~

Comment by Albert K on 2012-11-16:
Thanks for the detailed explanation~!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.