Fix 6DOF arm example (backport #804) #806
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is an automatic backport of pull request #804 done by Mergify.