virtualmodelcontrol.sim.rollout

rollout(system, q0, T, dt, *, v0=None, integrator='implicit', max_step=0.001, runtime=(), p=None, z0=None, u=None, output=())

Simulate the closed loop for T [s]: the controller every dt, held, and the robot in steps of at most max_step of integrator (implicit, rk4, cvodes).

Row k of t, q, v, z (if the controller has virtual states) and u (motor torques) is the state at the start of step k and the command computed from it, like run. p replaces the live Params (as compiled.live_values()); a CasADi MX symbol gives the results as MX expressions to differentiate. With u, motor torques [N·m] with one row per step, the robot gets them instead of the controller’s command (open loop, as in a logged run). output lists output stages with a symbolic form (control.StaticFrictionCompensation), applied to the controller’s command as VMCController(output=) applies them.

Parameters:
system : VirtualMechanismSystem

q0 : numpy.typing.ArrayLike

T : float

dt : float

v0 : TypeAliasForwardRef('numpy.typing.ArrayLike') | None

integrator : str

max_step : float

runtime : Iterable[str]

p : Any

z0 : TypeAliasForwardRef('numpy.typing.ArrayLike') | None

u : TypeAliasForwardRef('numpy.typing.ArrayLike') | None

output : Iterable[Any]

Return type:

dict[str, Any]