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
Sensors and estimators must expect to get updates at a fixed time step
On This Ticket:
The Main Control Loop MUST be locked into a given control cycle, given from the config file:
Create a ControlTask, called TimerEnforcer:
Create a statefield called: 'end_of_last_cycle', with default value: time.time() at default time.
Let's create a statefield called: 'target_control_cycle_duration', with value 100 by default.
In the body of TimerEnforcer, create logic that says:
end_of_last = sfr.get('end_of_last_cycle')
target_duration = sfr.get('target_control_cycle_duration)
while "now" - end_of_last < target_duration:
time.sleep(0.001)
This is so that the TimerEnforcer will sleep for as long as it needs to for the entire MainControlLoop to take exactly "target_control_cycle_duration" time.
The text was updated successfully, but these errors were encountered:
Problem:
On This Ticket:
The Main Control Loop MUST be locked into a given control cycle, given from the config file:
Create a ControlTask, called TimerEnforcer:
Create a statefield called: 'end_of_last_cycle', with default value: time.time() at default time.
Let's create a statefield called: 'target_control_cycle_duration', with value 100 by default.
In the body of TimerEnforcer, create logic that says:
end_of_last = sfr.get('end_of_last_cycle')
target_duration = sfr.get('target_control_cycle_duration)
while "now" - end_of_last < target_duration:
time.sleep(0.001)
This is so that the TimerEnforcer will sleep for as long as it needs to for the entire MainControlLoop to take exactly "target_control_cycle_duration" time.
The text was updated successfully, but these errors were encountered: