Rigid bodies#

A rigid body is the default kind of entity in Genesis World: a solid that does not deform, simulated by the rigid solver. It is what you get from Hello, Genesis World, and it covers most of robotics, robot arms, grippers, mobile bases, and the props they interact with. This page is the overview of that entity type; the rest of this section covers the non-rigid families that build on the same Scene.

Adding a rigid body#

An entity is rigid whenever its material is gs.materials.Rigid, which is the default, so you usually pass only a morph:

box = scene.add_entity(gs.morphs.Box(pos=(0, 0, 0.5), size=(0.2, 0.2, 0.2)))
franka = scene.add_entity(gs.morphs.MJCF(file="xml/franka_emika_panda/panda.xml"))

Both are rigid entities. The box is a single body; the Franka is articulated, a tree of rigid links connected by joints.

Single bodies and articulated bodies#

Every rigid entity is a RigidEntity, and you interact with it through its own methods rather than a global handle. An articulated entity exposes its structure:

  • Links (entity.links, entity.n_links): the individual rigid bodies in the tree.

  • Joints (entity.joints, entity.n_joints): the connections between links.

  • Degrees of freedom (entity.n_dofs): the independent coordinates the joints move along. A single free body has 6 dofs; a fixed box has none.

You read and write state through the entity: get_pos() and get_quat() for the base pose, and get_dofs_position() for joint positions. Driving those dofs with a controller is covered in Control your robot and, for arms, Robot control.

Fixed and free bases#

Whether an entity’s base is bolted to the world or floats freely depends on the morph. An MJCF file specifies the base joint itself; a URDF base is free (a 6-dof joint to the world) unless you pass fixed=True. See Loading assets for the details.

Physical properties#

The rigid material sets how a body interacts physically. Pass a configured gs.materials.Rigid to override the defaults:

box = scene.add_entity(
    gs.morphs.Box(pos=(0, 0, 0.5), size=(0.2, 0.2, 0.2)),
    material=gs.materials.Rigid(
        rho=1000.0,     # density in kg/m³, used to estimate mass
        friction=1.0,   # surface friction coefficient
    ),
)

Contact, collision geometry, and constraints, how these bodies actually push on each other, are governed by the rigid solver and documented under Theory and modelling.

See also#