-
Notifications
You must be signed in to change notification settings - Fork 232
Fix 6DOF arm example #804
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
Fix 6DOF arm example #804
Conversation
@mikelikesrobots did you run into this in your recent tutorial BTW? This is how we found this issue... |
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.
The changes to the trajectory controller make sense, and the code to set the time I think is simpler. Nice!
I didn't run into this at all! The issue I had was that it didn't always receive the trajectory, or it ignored it. When it did receive the trajectory, it did a perfect circle. Your code changes do point out an issue, though. |
... and I didn't see that myself. I am using Cyclone DDS instead of the default. Maybe give this a quick try on your end to see if that could be the difference? |
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.
Only 1 nit, LGTM. Ofc I'm not a maintainer so my approval doesn't actually help you!
it does ;) |
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.
The changes LGTM
Thank you for the changes @sea-bass
Thanks for your review and follow-up @mikelikesrobots
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.
The changes LGTM. I had problems in my local dev environment (see #805), but @saikishor confirmed that it works so let's go ahead
1dc20c1
into
ros-controls:master
(cherry picked from commit 1dc20c1) # Conflicts: # example_7/controller/r6bot_controller.cpp # example_7/reference_generator/send_trajectory.cpp
* Backport changes from #623 * Backport changes from #753 * Fix 6DOF arm example (#804) * Revert changes to handles --------- Co-authored-by: Christoph Froehlich <[email protected]> Co-authored-by: Sebastian Castro <[email protected]>
Thanks to debugging by @catarina-p and myself, we found issues with the 6DOF arm example.
Turns out the controller kept extrapolating forever past the final point, meaning that instead of slowing down from positive to zero velocity, the velocities kept going negative further and further.
Before this fix:
https://github.com/user-attachments/assets/af815279-818a-4922-837d-94b0208035cc
After this fix:
https://github.com/user-attachments/assets/70f4796e-38e1-4ba5-b2f2-5e402c324f2c
I also did some cleanup of the trajectory time calculations since the final point's time was not exactly 3.0 as expected.
Edit: As a side note, I am somewhat surprised that this example doesn't just use the regular joint trajectory controller that is already available in ros2_control. Although it's a nice example for people writing their own controllers.