Skip to main content
Ctrl+K
Genesis World 中文文档 - Home Genesis World 中文文档 - Home
  • 用户指南
  • API 参考
  • GitHub
  • PyPI
  • 用户指南
  • API 参考
  • GitHub
  • PyPI

Section Navigation

  • 选项
  • 引擎
    • 场景
    • 模拟器
    • 求解器
      • RigidSolver
      • MPMSolver
      • FEMSolver
      • PBDSolver
      • SPHSolver
      • SFSolver
      • ToolSolver
      • KinematicSolver
    • 耦合器
      • LegacyCoupler
      • SAPCoupler
      • IPCCoupler
    • 实体
      • 刚体实体
        • RigidEntity
        • RigidLink(刚体连杆)
        • RigidJoint
        • RigidGeom
        • RigidVisGeom(刚体可视几何体)
      • MPMEntity(MPM 实体)
      • FEMEntity(FEM 实体)
      • PBD 实体
        • PBDParticleEntity(PBD 粒子实体)
        • PBDFreeParticleEntity(PBD 自由粒子实体)
        • PBD2DEntity(PBD 2D 实体)
        • PBD3DEntity(PBD 3D 实体)
        • PBDTetEntity(PBD 四面体实体)
      • SPHEntity(SPH 实体)
      • SFParticleEntity
      • DroneEntity(无人机实体)
      • TerrainEntity
      • HybridEntity(混合实体)
      • ToolEntity
      • Emitter(发射器实体)
      • Morph
        • Morph(morph 基类)
        • Primitive
        • FileMorph
        • Nowhere
      • Surface
        • Surface(表面基类)
        • Plastic
        • Metal
        • Emission
        • Glass
        • FoamOptions
      • 纹理
        • Texture(纹理基类)
        • ColorTexture(颜色纹理)
        • ImageTexture(图像纹理)
        • BatchTexture
    • 材质
      • 刚体
      • MPM
        • 弹性体
        • 弹塑性体
        • 液体
        • 肌肉
        • 沙子
        • 雪
      • FEM
        • 布料
        • 弹性体
        • 肌肉
      • PBD
        • 弹性体
        • 布料
        • 液体
        • 粒子
      • 液体
      • 烟雾
      • 混合材质
      • 工具
      • 运动学
    • 状态
    • 传感器
      • 相机传感器
      • 接触传感器
      • IMU 传感器
      • 光线投射传感器
      • 触觉传感器
      • 其他传感器
    • 网格
    • ForceField(力场)
  • 可视化与渲染
    • 可视化器
    • 查看器
    • 相机
    • 渲染器
      • 光栅化器
      • RayTracer
      • BatchRenderer
    • 光源
  • 记录与回放
    • 记录器
    • RecorderManager
    • 文件写入器
    • 绘图器
  • 工具与辅助函数
    • 设备与平台工具
    • 张量工具
    • 几何工具
    • 网格工具
    • 文件 I/O 工具
    • 计时与媒体工具
  • API 参考
  • 引擎
  • 实体
  • 刚体实体
  • RigidLink(刚体连杆)

RigidLink(刚体连杆)#

class genesis.engine.entities.rigid_entity.rigid_link.RigidLink(entity: RigidEntity, idx: int, parent_idx: int, root_idx: int | None, joint_start: int, n_joints: int, geom_start: int, vert_start: int, face_start: int, edge_start: int, free_verts_state_start: int, fixed_verts_state_start: int, vgeom_start: int, vvert_start: int, vface_start: int, visualize_contact: bool, desc: RigidLinkDescription)[source]#

Bases: KinematicLink

RigidLink class. One RigidEntity consists of multiple RigidLinks, each of which is a rigid body and could consist of multiple RigidGeoms (link.geoms, for collision) and RigidVisGeoms (link.vgeoms for visualization).

get_verts()[source]#

Get the vertices of the link’s collision body (concatenation of all link.geoms) in the world frame.

get_AABB()[source]#

Get the vertex-based axis-aligned bounding box (AABB) of the link’s collision body in the world frame by aggregating all the collision geometries associated with this link (link.geoms).

apply_external_wrench(force=None, torque=None, envs_idx=None, *, pos=None, ref: link_ref_frame = link_ref_frame.link_origin, local: bool = False)[source]#

Apply an external wrench over one simulation step on the link.

Parameters:
  • force (None | array_like, optional) – The linear force to apply. None for a pure torque. Defaults to None.

  • torque (None | array_like, optional) – The torque to apply, on top of the moment induced by the linear force. Defaults to None.

  • envs_idx (None | array_like, optional) – The indices of the environments. If None, all environments will be considered. Defaults to None.

  • pos (None | array_like, optional) – Where the linear force is applied, which sets the moment arm of the induced torque. With local=True, an offset from the origin of the ref frame, so the point follows the link as it moves; otherwise a world position. None applies the force at the origin of the ref frame. Defaults to None.

  • ref (gs.link_ref_frame, optional) – The reference frame: the origin of the link (‘link_origin’), or its center of mass (‘link_COM’). It fixes where the linear force acts when pos is None, and the axes of the input coordinates when local=True. Defaults to ‘link_origin’.

  • local (bool, optional) – Whether force, torque and pos are expressed in the coordinates of the ref frame rather than the world frame. Defaults to False.

apply_external_force(force, envs_idx=None, *, pos=None, ref: link_ref_frame = link_ref_frame.link_origin, local: bool = False)[source]#

Apply an external linear force over one simulation step on the link.

Refer to RigidLink.apply_external_wrench for details.

apply_external_torque(torque, envs_idx=None, *, ref: link_ref_frame = link_ref_frame.link_origin, local: bool = False)[source]#

Apply an external torque over one simulation step on the link.

Refer to RigidLink.apply_external_wrench for details.

set_mass(mass: tuple[float, ...])[source]#

Set the mass of the link, in kg.

The inertia of the link is left unchanged, so use set_inertia to change it too. RigidEntity.set_mass scales the inertia of every link of an entity instead, by the same factor as its mass, which is how a body of the same shape made heavier behaves.

Parameters:

mass (float | array_like, shape (n_envs,)) – The mass to set. Per-environment values require RigidOptions.batch_links_info=True.

set_COM(com)[source]#

Set the center of mass (COM) of the link, as an offset in the link’s local frame.

Parameters:

com (array_like, shape (3,) or (n_envs, 3)) – The center of mass to set. Per-environment values require RigidOptions.batch_links_info=True.

set_inertia(inertia)[source]#

Set the inertia matrix of the link, expressed in its inertial frame.

Parameters:

inertia (array_like, shape (3, 3) or (n_envs, 3, 3)) – The inertia matrix to set, which must be symmetric positive definite. Per-environment values require RigidOptions.batch_links_info=True.

get_invweight(envs_idx=None)[source]#

Get the constraint inverse weights of the link: one for forces, one for torques.

See RigidEntity.get_links_invweight for what an inverse weight is and where its value comes from.

Parameters:

envs_idx (None | array_like, optional) – The indices of the environments. If None, all environments are returned. Defaults to None.

Returns:

invweight – The translational and rotational inverse weight of the link, per environment for a batched scene whose link info is batched.

Return type:

torch.Tensor, shape (2,) or (n_envs, 2)

get_mass(envs_idx=None)[source]#

Get the mass of the link, in kg.

Parameters:

envs_idx (None | array_like, optional) – The indices of the environments. If None, all environments are returned. Defaults to None.

Returns:

mass – The mass of the link, per environment for a batched scene whose link info is batched.

Return type:

torch.Tensor, shape (n_envs,) or scalar

set_friction(friction)[source]#

Set the friction of all the link’s geoms.

set_friction_torsional(friction_torsional)[source]#

Set the torsional friction of all the link’s geoms (see ‘gs.materials.Rigid’).

set_friction_rolling(friction_rolling)[source]#

Set the rolling friction of all the link’s geoms (see ‘gs.materials.Rigid’).

property visualize_contact: bool#

Whether to visualize the contact of the link.

property geoms: list[genesis.engine.entities.rigid_entity.rigid_geom.RigidGeom]#

The list of the link’s collision geometries (RigidGeom).

property n_geoms: int#

Number of the link’s collision geometries.

property geom_start: int#

The start index of the link’s collision geometries in the RigidSolver.

property geom_end: int#

The end index of the link’s collision geometries in the RigidSolver.

property n_verts: int#

Number of vertices of all the link’s geoms.

property n_faces: int#

Number of faces of all the link’s geoms.

property n_edges: int#

Number of edges of all the link’s geoms.

property is_free#

previous

RigidEntity

next

RigidJoint

On this page
  • RigidLink
    • RigidLink.get_verts()
    • RigidLink.get_AABB()
    • RigidLink.apply_external_wrench()
    • RigidLink.apply_external_force()
    • RigidLink.apply_external_torque()
    • RigidLink.set_mass()
    • RigidLink.set_COM()
    • RigidLink.set_inertia()
    • RigidLink.get_invweight()
    • RigidLink.get_mass()
    • RigidLink.set_friction()
    • RigidLink.set_friction_torsional()
    • RigidLink.set_friction_rolling()
    • RigidLink.visualize_contact
    • RigidLink.geoms
    • RigidLink.n_geoms
    • RigidLink.geom_start
    • RigidLink.geom_end
    • RigidLink.n_verts
    • RigidLink.n_faces
    • RigidLink.n_edges
    • RigidLink.is_free
Edit on GitHub

This Page

  • Show Source
Genesis AI Genesis AI

© 2026 Genesis AI SAS