-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed time periods for update method #1865
Comments
Hello @AndreasKuhner! If you want to use a fixed period, you can do it internally by using the
|
Thanks for the fast reply! The returned update there might be e.g. 1000 Hz if we run the controllers with that frequency.. right? This would yield 'only' the fixed step time but is not dynamic. Lets assume that for some reason your |
Before going further, can you tell me which ros2_control version and which DISTRO are you guys using? |
We are currently on humble and latest released |
Hello @AndreasKuhner! I think the issue you are describing might be kinda solved in the rolling version. I recommend you to try out the rolling branch and let us know if the issue persists. You can compile the rolling branch of ros2_control and it's respective package using the instructions here: https://control.ros.org/humble/doc/getting_started/getting_started.html#building-from-source Keep us posted if the issue is solved on rolling and maybe we can try to backport the change if it works. Thank you |
After checking the changes.. what exactly do you mean that it might have solved the issue? |
It doesn't solve it completely ofcourse, but you can do something like You are guaranteed to get the correct period, due to the following lines ros2_control/controller_manager/src/controller_manager.cpp Lines 2368 to 2369 in 30d51cd
In Humble, IIRC you only get the period of the controller manager cycle ros2_control/controller_manager/src/controller_manager.cpp Lines 2074 to 2077 in dcb958f
Why have you thought this doesn't solve it in the first place? |
Okey, oversaw that change, sorry 🤔 What we sometimes saw is that cycles were somehow skipped/delayed - this has for sure to do with our own hardware interfaces which block and might eat one or the other cycle - so for us it was a problem that the period didn't show then a '2ms' but was still something around '1ms'. But I guess that could be prevented now by being based on the last update cycle time... we need to investigate 😄 |
Is your feature request related to a problem? Please describe.
For our Franka Robotics robot FR3 and franka_ros2 package, we want to write an example which is based on the provided time by the
update
method. However, this time has a varying value - going from 0.8ms to 1.2ms (in our 1kHz loop case). Yet, if we want to 'scale' our commands according to those numbers, we create to big steps in the backend.E.g. if you operate our robot on the maximal allowed change per ms and you start to scale it by 1.2, you will end up with bigger than allowed steps, throwing an error... which is unnecessary because our control loop in the backend is anyways running with a fixed step time and doesn't depend on the cycle time in ros2_control.
An easy example for the problem is one of our example controller: The position control example uses a sinus function - super easy but depends heavily on the absolut accumulated time. The expectation would be to receive a sinus signal with fixed time steps.
Describe the solution you'd like
Allowing to configure a fixed time per cycle. E.g. for a 1kHz loop it would be a fixed time step of 1ms (aka the period is always 1ms or 2ms+ if for some reasons cycles are skipped/blocked/...).
Describe alternatives you've considered
We could publish a constant fixed timestep with each robot state and use that instead of the provided period/time... which would be a bit sad due to diverging from the intended ros2_control way 😞
The text was updated successfully, but these errors were encountered: