Starting CAN cycles after sleep or after action #452
stephane-caron
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In this note, for two function calls f and g, we write
f . g
when f and g run sequentially andf // g
when f and g run in parallel.Case 1: plan . (can // sleep)
Currently,
Spine::cycle_actuation
is implemented asplan . (can // sleep)
, like so:where we denote by:
Case 2: (plan // can) . sleep
There is an alternative
(plan // can) . sleep
:where again we denote by:
Comparison of the two
To understand the tradeoff between the two, we consider the action forward to actuators during the k-th spine cycle$[kT, (k+1)T]$ . We can define:
Let's also denote by$T_o \in [0, T_c]$ the time, during a CAN cycle, where the last observation is made.
In Case 1:
In Case 2:
Regardless of when the action was computed ($t_{act}$ ), one thing to observe is that, in both cases:
Thus, both solutions are equivalent in terms of the duration$t_{send} - t_{obs}$ .
On a side note,$t_{send} - t_{obs} > 2T$ , which is why we execute 3 cycles when resetting a simulation spine. The action in Case 2 is sent $T_p$ earlier, but it is also based on an observation made $T_p$ earlier compared to Case 1.
See also
Beta Was this translation helpful? Give feedback.
All reactions