How to receive position feedback from joints?

asked 2015-08-28 07:44:07 -0500

Formigola gravatar image

updated 2015-09-04 03:02:54 -0500


I would like to publish on a topic the current angle/position of a joint. How can I do that? Should I use a sensor? If so how works the PID that's by default on every created joint? From where it read the joint position? Somebody has or solved a similar problem?

Thanks in advance!

edit retag flag offensive close merge delete


I think you have this GetAngle() method for Joints. What I don't get in your question is this default PID. Where did you hear that ? I use a PID but had to create it and to link it with the joints. See here for details.

debz gravatar imagedebz ( 2015-09-04 18:12:58 -0500 )edit

I try to understand how to write a plug-in with GetAngle() inside but I didn't found any example and I don't know what to do... Do you know where I can found something that can help me, considering that's the first time that I try to write a gazebo plug-in?

Formigola gravatar imageFormigola ( 2015-09-05 06:50:19 -0500 )edit

Anyway, if you create a model with a joint and you launch it in the simulation you can drag to the left the right side of the gazebo GUI window. If you do this will appear an interface where you can apply forces on your joint (before you have to select the model). You can select to other forms in this window, one for the position PID the other for the velocity PID. That's what I call default PID. I control the position of my robot via socket trough this PID.

Formigola gravatar imageFormigola ( 2015-09-05 07:03:32 -0500 )edit

Ok, then take a look at the code here, instead of using a PID like I do, you can directly do something like GetJoint("name")->GetAngle(). Then I have to say that I don't really know how these default PIDs work (Is it PIDs, or is it just skeeping any physical properties ?).

debz gravatar imagedebz ( 2015-09-05 11:17:30 -0500 )edit