gs.materials.Rigid#
- class genesis.engine.materials.rigid.Rigid(*, use_visual_raycasting: bool = False, rho: float | None = None, friction: float | None = None, needs_coup: bool = True, coup_friction: float = 0.1, coup_softness: float = 0.002, coup_restitution: float = 0.0, sdf_cell_size: float = 0.005, sdf_min_res: int = 32, sdf_max_res: int = 128, gravity_compensation: float = 0.0, coup_type: Literal['two_way_soft_constraint', 'external_articulation', 'ipc_only'] | None = None, coup_links: tuple[str, ...] | None = None, enable_coup_collision: bool = True, coup_collision_links: tuple[str, ...] | None = None, contact_resistance: float | None = None)[source]#
Bases:
Kinematic[RigidEntity]The Rigid class represents a material used in rigid body simulation.
Note
This class is intended for use with the rigid solver and provides parameters relevant to physical interactions such as friction, density, and signed distance fields (SDFs).
- Parameters:
rho (float or None, optional) – The density of the material used to estimate mass if necessary. When None, the default depends on context: 1000 kg/m^3 if MuJoCo compatibility is enabled (
RigidOptions.enable_mujoco_compatibility), otherwise 600 kg/m^3 for basic rigid objects (mug, table…) vs 1500 kg/m^3 for poly-articulated robots. Default is None.friction (float, optional) – Friction coefficient within the rigid solver. If None, a default of 1.0 may be used or parsed from file.
needs_coup (bool, optional) – Whether the material participates in coupling with other solvers. Default is True.
coup_friction (float, optional) – Friction used during coupling. Must be non-negative. Default is 0.1.
coup_softness (float, optional) – Softness of coupling interaction. Must be non-negative. Default is 0.002.
coup_restitution (float, optional) – Restitution coefficient in collision coupling. Should be between 0 and 1. Default is 0.0.
sdf_cell_size (float, optional) – Cell size in SDF grid in meters. Defines grid resolution. Default is 0.005.
sdf_min_res (int, optional) – Minimum resolution of the SDF grid. Must be at least 16. Default is 32.
sdf_max_res (int, optional) – Maximum resolution of the SDF grid. Must be >= sdf_min_res. Default is 128.
gravity_compensation (float, optional) – Compensation factor for gravity. 1.0 cancels gravity. Default is 0.
coup_type (str or None, optional) –
Coupling mode for this entity. Only used by the IPC coupler. Requires
needs_coup=True. If None, auto-selected based on entity type:'external_articulation'for fixed-base articulated robots,'two_way_soft_constraint'for floating-base robots, and'ipc_only'for non-articulated objects. Valid values:’two_way_soft_constraint’: Two-way soft coupling.
’external_articulation’: Joint-level coupling for articulated bodies. Joint positions will be coupled at the DOF level.
’ipc_only’: IPC controls entity, transforms copied to Genesis (one-way). Only supported by rigid non-articulated objects.
Default is None.
coup_links (tuple of str or None, optional) – Tuple of link names to include in coupling. When set, only the named links participate in coupling; other links are excluded. Only supported with needs_coup=True and
two_way_soft_constrainttype in IPC. Default is None.enable_coup_collision (bool, optional) – Whether coupler collision is enabled for this entity’s links. Only used by the IPC coupler. Unlike
needs_coup=False(which removes the entity from the coupler entirely), setting this to False keeps the entity in the coupler for coupling forces but disables contact response. Default is True.coup_collision_links (tuple of str or None, optional) – Tuple of link names whose geoms participate in coupler collision. Only used by the IPC coupler. Only effective when
enable_coup_collision=True. If None, all coupled links have collision. When set, only the named links get coupler collision; other links are marked no-collision. Default is None.contact_resistance (float or None, optional) – IPC coupling contact resistance/stiffness override for this entity.
Nonemeans useIPCCouplerOptions.contact_resistance. Default is None.
- use_visual_raycasting: bool#
- rho: float | None#
- friction: float | None#
- needs_coup: bool#
- coup_friction: float#
- coup_softness: float#
- coup_restitution: float#
- sdf_cell_size: float#
- sdf_min_res: int#
- sdf_max_res: int#
- gravity_compensation: float#
- coup_type: Literal['two_way_soft_constraint', 'external_articulation', 'ipc_only'] | None#
- coup_links: tuple[str, ...] | None#
- enable_coup_collision: bool#
- coup_collision_links: tuple[str, ...] | None#
- contact_resistance: float | None#
- model_post_init(context: Any) None[source]#
Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'strict': True, 'validate_default': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].