sim.sap_runtime.SapState#

class sim.sap_runtime.SapState(joint_q: array, joint_qd: array, body_q: array, body_qd: array | None = None, body_f: array | None = None, joint_qd_order: Literal['sap', 'public'] = 'sap', body_f_order: Literal['sap', 'public'] = 'sap', requires_grad: bool = False)[source]#

Bases: object

Mutable SAP simulation state. Positions, velocities, body poses, body velocities, and external forces live here while SapModel remains immutable.

__init__(joint_q: array, joint_qd: array, body_q: array, body_qd: array | None = None, body_f: array | None = None, joint_qd_order: Literal['sap', 'public'] = 'sap', body_f_order: Literal['sap', 'public'] = 'sap', requires_grad: bool = False) None#

Methods

__init__(joint_q, joint_qd, body_q[, ...])

assign(other)

Copy all state arrays from another SapState with matching optional-buffer layout.

clear_forces()

Clear external body forces in place while leaving positions and velocities unchanged.

Attributes

body_f

body_f_order

body_qd

joint_qd_order

requires_grad

joint_q

joint_qd

body_q