gs.morphs.Morph#
- class genesis.options.morphs.Morph(*, pos: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] = (0.0, 0.0, 0.0), euler: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] | None = None, quat: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] | None = None, offset_pos: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] = (0.0, 0.0, 0.0), offset_euler: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] | None = None, offset_quat: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] = (1.0, 0.0, 0.0, 0.0), visualization: bool = True, collision: bool = True, requires_jac_and_IK: bool = False, enable_custom_vverts: bool = False)[source]#
This is the base class for all genesis morphs. A morph in genesis is a hybrid concept, encapsulating both the geometry and pose information of an entity. This includes shape primitives, meshes, URDF, MJCF, Terrain, and soft robot description files.
Note
This class should not be instantiated directly.
- Parameters:
pos (tuple, shape (3,), optional) – The initial position of the entity in meters at creation time. Defaults to (0.0, 0.0, 0.0).
euler (tuple, shape (3,), optional) – The initial euler angle of the entity in degrees at creation time. This follows scipy’s extrinsic x-y-z rotation convention. Defaults to (0.0, 0.0, 0.0).
quat (tuple, shape (4,), optional) – The initial quaternion (w-x-y-z convention) of the entity at creation time. If specified, euler will be ignored. Defaults to None.
offset_pos (tuple, shape (3,), optional) – A fixed pose offset applied in the entity’s own body frame on top of the pos/euler (or pos/quat) pose. It shifts the world pose used internally by the solver but is stripped back out by the relative getters, so get_pos/get_quat (which are relative by default) still report pos/quat. The morph pose and the offset compound exactly like a parent and a child frame: the world pose is transform_pos_quat_by_trans_quat(offset_pos, offset_quat, pos, quat), i.e. the offset is expressed in the body frame defined by pos/quat. So offset_pos rotates together with the orientation rather than being a world-frame shift, and when the orientation is identity it simply adds to pos. Defaults to (0.0, 0.0, 0.0).
offset_euler (tuple, shape (3,), optional) – The orientation offset offset_quat given as an euler angle in degrees (scipy extrinsic x-y-z convention). Setting both offset_euler and offset_quat raises an error. Defaults to None.
offset_quat (tuple, shape (4,), optional) – A fixed orientation offset (w-x-y-z convention); see offset_pos for how it compounds with pos/quat to form the world pose. Up-axis conversions (e.g. loading a Z-up asset) are stored here. Defaults to (1.0, 0.0, 0.0, 0.0).
visualization (bool, optional) – Whether the entity needs to be visualized. Set it to False if you need a invisible object only for collision purposes. Defaults to True. visualization and collision cannot both be False. This is only used for RigidEntity.
collision (bool, optional) – Whether the entity needs to be considered for collision checking. Defaults to True. visualization and collision cannot both be False. This is only used for RigidEntity.
requires_jac_and_IK (bool, optional) – Whether this morph, if created as RigidEntity, requires jacobian and inverse kinematics. Defaults to False. This is only used for RigidEntity.
is_free (bool, optional) – This parameter is deprecated.