gs.morphs.MJCF#

gs.morphs.MJCF 类是 Genesis 项目中的一个重要组件,用于处理 MJCF 文件的变形选项。

class genesis.options.morphs.MJCF(*, pos: tuple | None = None, euler: tuple | None = None, quat: tuple | None = None, visualization: bool = True, collision: bool = True, requires_jac_and_IK: bool = True, file: Any = '', scale: float | tuple = 1.0, convexify: bool | None = None, recompute_inertia: bool = False)[源代码]#

Morph loaded from a MJCF file. This morph only supports RigidEntity

备注

MJCF file always contains a worldbody, which we will skip during loading. The robots/objects in MJCF come with their own baselink pose. If pos, euler, or quat is specified, it will override the baselink pose in the MJCF file.

The current version of Genesis asumes there’s only one child of the worldbody. However, it’s possible that a MJCF file contains a scene, not just a single robot, in which case the worldbody will have multiple kinematic trees. We will support such cases in the future.

参数:
  • file (str) – The path to the file.

  • scale (float or tuple, optional) – The scaling factor for the size of the entity. If a float, it scales uniformly. If a 3-tuple, it scales along each axis. Defaults to 1.0. Note that 3-tuple scaling is only supported for gs.morphs.Mesh.

  • pos (tuple, shape (3,), optional) – The position of the entity’s baselink in meters. Defaults to (0.0, 0.0, 0.0).

  • euler (tuple, shape (3,), optional) – The euler angle of the entity’s baselink in degrees. This follows scipy’s extrinsic x-y-z rotation convention. Defaults to (0.0, 0.0, 0.0).

  • quat (tuple, shape (4,), optional) – The quaternion (w-x-y-z convention) of the entity’s baselink. If specified, euler will be ignored. Defaults to None.

  • convexify (bool, optional) – Whether to convexify the entity. When convexify is True, all the meshes in the entity will be converted to a convex hull. If not given, it defaults to True for RigidEntity and False for other deformable entities.

  • 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.

  • collision (bool, optional) – Whether the entity needs to be considered for collision checking. Defaults to True. visualization and collision cannot both be False.

  • requires_jac_and_IK (bool, optional) – Whether this morph, if created as RigidEntity, requires jacobian and inverse kinematics. Defaults to True.