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

Strange behaviour on target conditions #172

Open abernasconi90 opened 1 year ago

abernasconi90 commented 1 year ago

Hello,

I am integrating Ruckig and trying to performe many trajectories and I found a strange behaviour with these parameters:

input.current_position = {100};
input.current_velocity = {-150};
input.current_acceleration = {1520};

input.target_position = {700};
input.target_velocity = {150};
input.target_acceleration = {350};

input.max_velocity = {300};
input.max_acceleration = {2000};
input.min_acceleration = {-2000};
input.max_jerk = {70000};

input.duration_discretization = ruckig::DurationDiscretization::Discrete;
input.control_interface = ruckig::ControlInterface::Position;

I am using a control cycle of 0.001 second specified in the object constructor: ruckig::Ruckig<1> generator {0.001}; // control cycle

I am using a discrete duration in order to complete the trajectory within a period multiple of control cycle. The strange behaviour occurs at the end of computation. The last two samples are:

Position: 700.000000 Velocity: 150.000000 Acceleration: 350.000000 Jerk: 70000.000000 Here Ruckig reports ruckig::Result::Working as return value of generator.update(input, output) method.

Final Position: 700.150175 Final Velocity: 150.350000 Final Acceleration: 350.000000 Final Jerk: 0.000000 Here Ruckig reports ruckig::Result::Finished as return value of generator.update(input, output) method.

I tried this code on Linux Ubuntu as OS. Am I doing something wrong?

Thanks

abernasconi90 commented 10 months ago

Hello, any update for this ticket? Thanks