pantor / ruckig

Motion Generation for Robots and Machines. Real-time. Jerk-constrained. Time-optimal.
https://ruckig.com
MIT License
730 stars 165 forks source link

Is it a written error? #31

Closed personal-fork-robot closed 3 years ago

personal-fork-robot commented 3 years ago

Hi, @pantor Im reading the code, and find a strange thing. In brake.cpp https://github.com/pantor/ruckig/blob/209a3314c0408e95ad517d06fb091ec9704096cd/src/brake.cpp#L41 This one line of code says that t_to_v_max is the time from v0 to vmax, t_to_v_max = a0/jMax + std::sqrt(a0*a0 + 2 * jMax * (v0 - vMax)) / std::abs(jMax) https://github.com/pantor/ruckig/blob/209a3314c0408e95ad517d06fb091ec9704096cd/src/brake.cpp#L42 but the time from v0 to vmin, ‘t_to_vmin = a0/jMax + std::sqrt(*a0a0 / 2*_ + jMax (v0 - vMin)) / std::abs(jMax)’,is it a written error?

pantor commented 3 years ago

This should be fine, and is extensively tested in the unit test cases. Note that one time is without, and one is with switching the jerk direction, so there is a little bit of asymmetry here.