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: TOTG can return vels/accels greater than the limits #3394
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. |
@@ -844,7 +843,6 @@ Eigen::VectorXd Trajectory::getAcceleration(double time) const | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: