Question regarding the init state for a kinematically coupled entity #837
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey, thanks for using mjlab! The way to do this is with 3 separate entities (2 quadrupeds + 1 payload), each with its own When entities are added to a scene, their element names get prefixed with the entity name. So if your scene config is: SceneCfg(
entities={
"quad1": quad_cfg,
"quad2": quad_cfg,
"payload": payload_cfg,
},
spec_fn=add_constraints,
)You can reference cross-entity sites in the def add_constraints(spec: mujoco.MjSpec) -> None:
spec.add_equality(
type=mujoco.mjtEq.mjEQ_CONNECT,
objtype=mujoco.mjtObj.mjOBJ_SITE,
name1="quad1/attach_site",
name2="payload/left_site",
)
spec.add_equality(
type=mujoco.mjtEq.mjEQ_CONNECT,
objtype=mujoco.mjtObj.mjOBJ_SITE,
name1="quad2/attach_site",
name2="payload/right_site",
)Each entity gets its own |
Beta Was this translation helpful? Give feedback.

Hey, thanks for using mjlab!
The way to do this is with 3 separate entities (2 quadrupeds + 1 payload), each with its own
EntityCfgandInitialStateCfg. Then use the scene-levelspec_fnto add the equality connect constraints between them.When entities are added to a scene, their element names get prefixed with the entity name. So if your scene config is:
You can reference cross-entity sites in the
spec_fn: