Add mjtState enum and related mj_stateSize, mj_getState and mj_setState functions.
PiperOrigin-RevId: 539667943 Change-Id: I14c34be8ce4c287e529380257b5c5bffc3ab45ce
This commit is contained in:
committed by
Copybara-Service
parent
84c33e53df
commit
f67e359532
@@ -373,6 +373,30 @@ ENUMS: Mapping[str, EnumDecl] = dict([
|
||||
('mjLRMODE_ALL', 3),
|
||||
]),
|
||||
)),
|
||||
('mjtState',
|
||||
EnumDecl(
|
||||
name='mjtState',
|
||||
declname='enum mjtState_',
|
||||
values=dict([
|
||||
('mjSTATE_TIME', 1),
|
||||
('mjSTATE_QPOS', 2),
|
||||
('mjSTATE_QVEL', 4),
|
||||
('mjSTATE_ACT', 8),
|
||||
('mjSTATE_WARMSTART', 16),
|
||||
('mjSTATE_CTRL', 32),
|
||||
('mjSTATE_QFRC_APPLIED', 64),
|
||||
('mjSTATE_XFRC_APPLIED', 128),
|
||||
('mjSTATE_MOCAP_POS', 256),
|
||||
('mjSTATE_MOCAP_QUAT', 512),
|
||||
('mjSTATE_USERDATA', 1024),
|
||||
('mjSTATE_PLUGIN', 2048),
|
||||
('mjNSTATE', 12),
|
||||
('mjSTATE_PHYSICS', 14),
|
||||
('mjSTATE_FULLPHYSICS', 2063),
|
||||
('mjSTATE_USER', 2016),
|
||||
('mjSTATE_INTEGRATION', 4095),
|
||||
]),
|
||||
)),
|
||||
('mjtWarning',
|
||||
EnumDecl(
|
||||
name='mjtWarning',
|
||||
|
||||
@@ -1783,6 +1783,84 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
|
||||
),
|
||||
doc='Compute efc_state, efc_force, qfrc_constraint, and (optionally) cone Hessians. If cost is not NULL, set *cost = s(jar) where jar = Jac*qacc-aref.', # pylint: disable=line-too-long
|
||||
)),
|
||||
('mj_stateSize',
|
||||
FunctionDecl(
|
||||
name='mj_stateSize',
|
||||
return_type=ValueType(name='int'),
|
||||
parameters=(
|
||||
FunctionParameterDecl(
|
||||
name='m',
|
||||
type=PointerType(
|
||||
inner_type=ValueType(name='mjModel', is_const=True),
|
||||
),
|
||||
),
|
||||
FunctionParameterDecl(
|
||||
name='spec',
|
||||
type=ValueType(name='unsigned int'),
|
||||
),
|
||||
),
|
||||
doc='Return size of state specification.',
|
||||
)),
|
||||
('mj_getState',
|
||||
FunctionDecl(
|
||||
name='mj_getState',
|
||||
return_type=ValueType(name='void'),
|
||||
parameters=(
|
||||
FunctionParameterDecl(
|
||||
name='m',
|
||||
type=PointerType(
|
||||
inner_type=ValueType(name='mjModel', is_const=True),
|
||||
),
|
||||
),
|
||||
FunctionParameterDecl(
|
||||
name='d',
|
||||
type=PointerType(
|
||||
inner_type=ValueType(name='mjData', is_const=True),
|
||||
),
|
||||
),
|
||||
FunctionParameterDecl(
|
||||
name='state',
|
||||
type=PointerType(
|
||||
inner_type=ValueType(name='mjtNum'),
|
||||
),
|
||||
),
|
||||
FunctionParameterDecl(
|
||||
name='spec',
|
||||
type=ValueType(name='unsigned int'),
|
||||
),
|
||||
),
|
||||
doc='Get state.',
|
||||
)),
|
||||
('mj_setState',
|
||||
FunctionDecl(
|
||||
name='mj_setState',
|
||||
return_type=ValueType(name='void'),
|
||||
parameters=(
|
||||
FunctionParameterDecl(
|
||||
name='m',
|
||||
type=PointerType(
|
||||
inner_type=ValueType(name='mjModel', is_const=True),
|
||||
),
|
||||
),
|
||||
FunctionParameterDecl(
|
||||
name='d',
|
||||
type=PointerType(
|
||||
inner_type=ValueType(name='mjData'),
|
||||
),
|
||||
),
|
||||
FunctionParameterDecl(
|
||||
name='state',
|
||||
type=PointerType(
|
||||
inner_type=ValueType(name='mjtNum', is_const=True),
|
||||
),
|
||||
),
|
||||
FunctionParameterDecl(
|
||||
name='spec',
|
||||
type=ValueType(name='unsigned int'),
|
||||
),
|
||||
),
|
||||
doc='Set state.',
|
||||
)),
|
||||
('mj_addContact',
|
||||
FunctionDecl(
|
||||
name='mj_addContact',
|
||||
|
||||
Reference in New Issue
Block a user