How to receive position feedback from joints?
Hello!
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!
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.
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?
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.
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 ?).