ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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 :

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~

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

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

Comments

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

Question Tools

Stats

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

Seen: 1,002 times

Last updated: Nov 15 '12