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

Add a method to reset the Ruckig object with new `DOF` and `delta_t` #118

Closed AndyZe closed 2 years ago

AndyZe commented 2 years ago

I'm trying to do something like this with every control loop iteration because the period of my control loop might change:

smoother = ruckig::Ruckig<ruckig::DynamicDOFs>(new_DOF, new_delta_t));

It would be nice if there were something like a reset(size_t new_DOFs, double new_delta_t) method so I didn't have to re-initialize like that:

smoother.reset(new_DOF, new_delta_t);

Here's an explanation on why that's inefficient: https://stackoverflow.com/a/2530889/3499467

Danielxyz123 commented 2 years ago

Is it equal to #42 ?

AndyZe commented 2 years ago

That sounds different to me. I want to run Ruckig for one point at a time, in realtime fashion. #42 was talking about running once, then sampling the solution afterwards. (I think...)

pantor commented 2 years ago

Hey @AndyZe! delta_t should be straight-forward to change, in fact I don't see a problem with just removing const from Ruckig::delta_time. Would that already help in your case?

It's a bit harder for DoFs, I think we would need a proper reset function here.

AndyZe commented 2 years ago

non-const delta_t sounds good :+1: You are right, I don't have any need to change DoFs in real time.

pantor commented 2 years ago

Ruckig::delta_time is now non-const with the latest commit on the master branch.

I'll close this for now, as I think if one wants to change the DoFs of Ruckig efficiently in real-time, it'd look a bit like a code smell to me. If anybody comes up with a good use-case, I'll be happy to add a proper reset method though.

AndyZe commented 2 years ago

By the way, thank you! This should be merged into ros2_control soon and I think it will improve the performance of all ROS hardware a lot. Believe it or not, vel/accel limits are not currently checked by ros2_control in any way.

https://github.com/ros-controls/ros2_controllers/pull/324

AndyZe commented 2 years ago

Would you be able to release Ruckig for ROS2 again? Specifically Rolling and Humble distributions.

I don't think Ruckig::delta_time is non-const in the current version.

AndyZe commented 2 years ago

It's not a huge deal if you can't.

pantor commented 1 year ago

Hey @AndyZe, I just wanted to release Ruckig v0.7.1 for ROS via bloom. However there seems to be some issue related to 2FA, and it's also challenging to get right within CD. And I think the release repo was changed to https://github.com/ros2-gbp/ruckig-release recently. I'm assuming you know more about the ROS release process than I do. Any chance you could support me here or take this over?

AndyZe commented 1 year ago

Let me put you in contact with somebody. @vatanaksoytezer do you or Adam have time to help with a release? I have @pantor's email, if you can

rhaschke commented 1 year ago

I think the release repo was changed to https://github.com/ros2-gbp/ruckig-release recently.

All release repos were automatically changed when preparing for Humble I think. As you probably don't have write access to this repo yet, you can either:

rhaschke commented 1 year ago

Other persons cannot help with the release process as one needs to have write access to the release repo.

pantor commented 1 year ago

Good to know, @rhaschke. The main discussion for setting up new ROS releases is in #137. In short, we will give @vatanaksoytezer write access to the ros2-gbp/ruckig-release repo.