pantor / ruckig

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

Can I access the trajectory object polynomial coefficients? #144

Closed guri-dominic closed 1 year ago

guri-dominic commented 1 year ago

Your package is great! Easy to install and use. After solving for the trajectory, is it possible to get the underlying polynomial coefficients? Or the times at which the trajectory switches from one section polynomial to another?

Can you also explain how return_section=True is supposed to work? It seems to be returning the acceleration value.

Trajectory.at_time(self: ruckig.Trajectory, time: float, return_section: bool = False) -> tuple

pantor commented 1 year ago

Yeah, if you're using Python you can compile Ruckig with the WITH_EXPOSE_INTERNAL=ON cmake flag. Then, you can access all trajectory coefficients via e.g. trajectory.profiles[i][dof].j for the jerk and similarly for t, a, v, p for times and accelerations, velocities and positions. The relevant source code is here.