You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do have the impression that the period calculation introduced in #1140 actually causes some problems. This is maybe related to #1574 but I am not completely sure, hence a new issue.
When implementing a controller I realized that the periods reported to the controller were way too large (roughly factor 2), while a debug statement printing those periods was printed in the correct frequency. To debug this further I added a couple of logging statements to the controller_manager:
What I realized: At some point there is a control cycle where the controller doesn't receive an update (update time: ) is printed at the beginning of CM's update method, while the other logs are from the inner loop over the controllers.
So, a skipped controller update due to a cm cycle time under the desired period due to some system jitter results in an all-time wrong period.
What basically happens with a cm rate == controller rate == 5 Hz with some jitter:
CM updates
controller update
next expected update
actual period
0.0
yes
0.2
-
0.21
yes
0.4
0.21
0.39
no
0.4
-
0.6
yes
0.6
0.4
0.8
yes
0.8
0.4
1.0
yes
1.2
0.4
Expected behavior
I would expect that the period times normalize again after such an incident.
One way to achieve this could be to increment the next cycletime as such
*loaded_controller.next_update_cycle_time = time + controller_period;
but I think this wouldn't do any controller justice for which the controller update times would not exactly match the controller_manager rate.
E.g.: Controller manager running with 10 Hz, controller running with 3 Hz
Correctly:
CM updates
controller update
next update
0.0
yes
0.3333
0.1
no
0.2
no
0.3
no
0.4
yes
0.6667
0.5
no
0.6
no
0.7
yes
0.99999
0.8
no
0.9
no
1.0
yes
1.333
1.1
no
With the proposed approach:
CM updates
controller update
next update
0.0
yes
0.3333
0.1
no
0.2
no
0.3
no
0.4
yes
0.7333
0.5
no
0.6
no
0.7
no
0.8
yes
1.1333
0.9
no
1.0
no
1.1
no
The text was updated successfully, but these errors were encountered:
I do have the impression that the period calculation introduced in #1140 actually causes some problems. This is maybe related to #1574 but I am not completely sure, hence a new issue.
When implementing a controller I realized that the periods reported to the controller were way too large (roughly factor 2), while a debug statement printing those periods was printed in the correct frequency. To debug this further I added a couple of logging statements to the controller_manager:
https://github.com/fmauch/ros2_control/tree/debug_periods
Some example output:
Similar output can straightforward be produced using
What I realized: At some point there is a control cycle where the controller doesn't receive an update (
update time:
) is printed at the beginning of CM'supdate
method, while the other logs are from the inner loop over the controllers.So, a skipped controller update due to a cm cycle time under the desired period due to some system jitter results in an all-time wrong period.
What basically happens with a cm rate == controller rate == 5 Hz with some jitter:
Expected behavior
I would expect that the period times normalize again after such an incident.
One way to achieve this could be to increment the next cycletime as such
but I think this wouldn't do any controller justice for which the controller update times would not exactly match the controller_manager rate.
E.g.: Controller manager running with 10 Hz, controller running with 3 Hz
Correctly:
With the proposed approach:
The text was updated successfully, but these errors were encountered: