0
$\begingroup$

Gazebo Answers logo

What exactly is does a gazebo::physics::JointController do to control the joint position/velocity?

I can see from the API documentation that you can set up a PID controller within the JointController, and you can ultimately specify P/I/D gains and min/max control effort. However, I'm not sure what the "control effort" is that is calculated by the PID controller inside of the JointController. Is it the force/torque applied to the joint?

On another note, I see no way in the documentation to specify which axis of the joint you want to control using a JointController. What happens if you are using a revolute2 joint with two axes?


Originally posted by pcdangio on Gazebo Answers with karma: 207 on 2016-04-13

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Gazebo Answers logo

In my experience, the control effort is equal to the force applied. I haven't validated this, but that what I've always assumed it to be. It also seems you're correct about JointController only handling one axis. Of course implementing PID is very easy, and you can do it yourself. This means you can call SetForce(axis, force) and specify which axis you want to control. The JointController probably defaults to the first axis specified in sdf.


Originally posted by Peter Mitrano with karma: 768 on 2016-04-14

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Gazebo Answers logo

If you have a doubt because the documentation isn't precise enough, just check the code directly on Bitbucket:

https://bitbucket.org/osrf/gazebo/src/7081a5b47d14fc6f1fa6a191ada381483f92460a/gazebo/physics/JointController.hh?at=default&fileviewer=file-view-default

For position PIDs, here is how it uses the common::PID class and the SetForce() function:

double cmd = this->dataPtr->posPids[iter->first].Update(this->dataPtr->joints[iter->first]->GetAngle(0).Radian() -  iter->second, stepTime);
this->dataPtr->joints[iter->first]->SetForce(0, cmd);

Originally posted by debz with karma: 198 on 2016-04-29

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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