Skip to content
Discussion options

You must be logged in to vote

Hey, thanks for using mjlab!

The way to do this is with 3 separate entities (2 quadrupeds + 1 payload), each with its own EntityCfg and InitialStateCfg. Then use the scene-level spec_fn to 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:

SceneCfg(
  entities={
    "quad1": quad_cfg,
    "quad2": quad_cfg,
    "payload": payload_cfg,
  },
  spec_fn=add_constraints,
)

You can reference cross-entity sites in the spec_fn:

def add_constraints(spec: mujoco.MjSpec) -> None:
  spec.add_equality(
    type=mujoco.mjtEq.mjEQ_CONNECT,
    objtype=mujoco.mjtObj.mjOBJ_SITE,
    name1="…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gokulmk-12
Comment options

Answer selected by gokulmk-12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants