JointGroupPositionController: Set current position as target in starting()#504
Conversation
There was a problem hiding this comment.
This change has no dependence on #503, could you please trim the branch down to just the relevant commit to make it easier to review and merge.
LGTM, especially because this is already what's done in most other position controllers. Set cmd=pos, reset PID.
| enforceJointLimits(current_positions[i], i); | ||
| pid_controllers_[i].reset(); | ||
| } | ||
| commands_buffer_.writeFromNonRT(current_positions); |
There was a problem hiding this comment.
starting() is in the RT domain, so rather than calling writeFromNonRT(), you should write to the command buffer directly. (The realtime buffer lacks a proper writeFromRT method since it's really intended for writing from a single non-RT thread, reading from a single RT thead. I haven't worked through the accesses and how safe this aooriach is, but from these examples by people much smarter than me, it seems this is a safe solution)
Examples:
There was a problem hiding this comment.
Actually, looking at this again, I think the right solution is to just use initRT(). In practical senses, it'll be pretty much the same thing, but with less overhead and also less hackey.
I think those examples I linked should probably be updated to initRT() as well. I'll look into that (#511).
745f2ab to
e25a037
Compare
|
Thank you for the review and feedback @matthew-reynolds. I updated the PR to use |
matthew-reynolds
left a comment
There was a problem hiding this comment.
This looks great to me, ping @bmagyar for another set of eyes and potential merge
|
@bmagyar are we good to merge this? |
bmagyar
left a comment
There was a problem hiding this comment.
Much appreciated guys, thank you!
…ition in starting Currently, the target position upon starting is all zeros. This is not great if a command is not issued immediately. To be safer, set the goal position to the current sensed position and also reset the PID internal state upon starting.
35ccf33 to
997e909
Compare
|
I've rebased this on the latest upstream which should have the CI fixed, merging when all turns green |
|
I still consider a diff_drive_controller failure green ;) |
|
Thanks for the fix @wxmerkt , merging |
Currently, the target position upon starting is all zeros. This is not great if a command is not issued immediately (and even then). To be safer, set the goal position to the current sensed position and also reset the PID internal state upon starting.
(This PR is on top of #503)