Fix: TOTG can return vels/accels greater than the limits#3394
Fix: TOTG can return vels/accels greater than the limits#3394AndyZe merged 6 commits intomoveit:masterfrom
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3394 +/- ##
==========================================
- Coverage 61.79% 61.06% -0.72%
==========================================
Files 380 380
Lines 33605 33616 +11
==========================================
- Hits 20762 20524 -238
- Misses 12843 13092 +249
... and 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
| const double acceleration = | ||
| 2.0 * (it->path_pos_ - previous->path_pos_ - time_step * previous->path_vel_) / (time_step * time_step); | ||
|
|
||
| time_step = time - previous->time_; |
There was a problem hiding this comment.
Note that time_step is already calculated a few lines above.
I think this deleted line was intended to improve accuracy but it caused the bug where getAcceleration() returned values over the limit.
The accuracy should still be good if TOTG is run with a small timestep. The default timestep is 0.001. https://github.com/ros-planning/moveit/blob/9fd645d76d0a4fbdbf55f8aecb09fd5a31a63e1a/moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp#L994
This is a 2-line bug fix for this test failure: