pantor / ruckig

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

Bug in found_time_synchronization evaluation #56

Closed stefanbesler closed 2 years ago

stefanbesler commented 2 years ago

Hi,

I am just integrating some of your commit into the TwinCAT port I am working on. I noticed that the signature of the check Method changed (see https://github.com/pantor/ruckig/commit/b61e99908c715a9e30f83643b177c6c61afc80cd), but is not used correctly in the following code segment

 switch (p.jerk_signs) {
  case Profile::JerkSigns::UDDU: {
      if (!p.check<Profile::JerkSigns::UDDU, Profile::Limits::NONE>(t_profile, new_max_jerk[dof], new_max_velocity[dof], new_max_acceleration[dof], new_min_acceleration[dof])) {
          found_time_synchronization = false;
      }
  } break;
  case Profile::JerkSigns::UDUD: {
      if (!p.check<Profile::JerkSigns::UDUD, Profile::Limits::NONE>(t_profile, new_max_jerk[dof], new_max_velocity[dof], new_max_acceleration[dof], new_min_acceleration[dof])) {
          found_time_synchronization = false;
      }
  } break;
}

I think after new_max_velocity[dof] there should be a parameter vor the new minimum velocity instead of new_max_acceleration, or am I missing something here?

pantor commented 2 years ago

You're right, also phase synchronization doesn't work with the Python interface due to uninitialized Vectors just above your snippet.

pantor commented 2 years ago

This should be fixed with the latest commits.