-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds velocity control to JointPositionController. #1003
Conversation
There are times when we don't nessecarily want to tune a PID for each joint. Often we may assume that the physical robot already has a well tuned controller. This was true in the case of the mbari LRAUV. Hence, there should be a way to set position without the use of a PID controller. This commit adds a `use_velocity_commands` option which when set to true bypasses the force based PID giving a very predictable position. The `use_velocity_command` mode has a `cmd_max` which in turn can be used to set a maximum velocity which the joint can move at. Signed-off-by: Arjo Chakravarty <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1003 +/- ##
==========================================
+ Coverage 63.28% 63.90% +0.61%
==========================================
Files 238 246 +8
Lines 19423 20035 +612
==========================================
+ Hits 12292 12803 +511
- Misses 7131 7232 +101
Continue to review full report at Codecov.
|
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I just have a question about using cmd_min
.
src/systems/joint_position_controller/JointPositionController.cc
Outdated
Show resolved
Hide resolved
src/systems/joint_position_controller/JointPositionController.cc
Outdated
Show resolved
Hide resolved
auto dt = std::chrono::duration<double>(_info.dt).count(); | ||
|
||
// Get the maximum amount in m that this joint may move | ||
auto maxMovement = this->dataPtr->posPid.CmdMax() * dt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also use CmdMin
for negative velocities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think its absolutely essential. We could add this in a future PR/release. I guess it would simulate actuators which have asymmetric forward and backward speeds. That being said, I do not feel it is necessary immediately. If we really do want to care about motor characterisitcs then we should probably add stuff like <max_acceleration>
<max_torque>
etc.
Co-authored-by: Louise Poubel <[email protected]> Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
8ceaed2
to
6603a7b
Compare
@chapulina This is ready for another round of review. |
There are times when we don't nessecarily want to tune a PID for each joint. Often we may assume that the physical robot already has a well tuned controller. This was true in the case of the mbari LRAUV. Hence, there should be a way to set position without the use of a PID controller. This commit adds a `use_velocity_commands` option which when set to true bypasses the force based PID giving a very predictable position. The `use_velocity_command` mode has a `cmd_max` which in turn can be used to set a maximum velocity which the joint can move at. Signed-off-by: Arjo Chakravarty <[email protected]> Co-authored-by: Louise Poubel <[email protected]> Signed-off-by: William Lew <[email protected]>
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
🎉 New feature
Closes #
Summary
There are times when we don't nessecarily want to tune a PID for each joint. Often we
may assume that the physical robot already has a well tuned controller. This
was true in the case of the mbari LRAUV.
Hence, there should be a way to set position without the use of a PID
controller. This commit adds a
use_velocity_commands
option which when set to true bypasses the forcebased PID giving a very predictable position. The
use_velocity_command
mode has acmd_max
which in turncan be used to set a maximum velocity which the joint can move at.
Signed-off-by: Arjo Chakravarty [email protected]
Test it
TODO:
Add unit test.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge