AvatarEntity#
- class genesis.engine.entities.avatar_entity.avatar_entity.AvatarEntity(scene: Scene, solver: RigidSolver, material: Material, morph: Morph, surface: Surface, idx: int, idx_in_solver, link_start: int = 0, joint_start: int = 0, q_start=0, dof_start=0, geom_start=0, cell_start=0, vert_start=0, verts_state_start=0, face_start=0, edge_start=0, vgeom_start=0, vvert_start=0, vface_start=0, equality_start=0, visualize_contact: bool = False)[source]#
Bases:
RigidEntity- add_link(name: str, pos, quat, inertial_pos, inertial_quat, inertial_i, inertial_mass: float, parent_idx: int, invweight: ndarray[Any, dtype[float64]]) AvatarLink[source]#
Add a new link (AvatarLink) to the entity.
- Parameters:
name (str) – Name of the link.
pos (array-like) – Position of the link in world or parent frame.
quat (array-like) – Orientation (quaternion) of the link.
inertial_pos (array-like) – Position of the inertial frame relative to the link.
inertial_quat (array-like) – Orientation of the inertial frame.
inertial_i (array-like) – Inertia tensor in the local frame.
inertial_mass (float) – Mass of the link.
parent_idx (int) – Index of the parent link in the kinematic tree.
invweight (np array of 2 float elements) – Inverse weight for optimization or simulation purposes.
- Returns:
link – The created AvatarLink instance.
- Return type:
- add_joint(name: str, n_qs: int, n_dofs: int, type: str, pos, quat, dofs_motion_ang, dofs_motion_vel, dofs_limit, dofs_invweight, dofs_stiffness, dofs_damping, dofs_armature, dofs_kp, dofs_kv, dofs_force_range, init_q) AvatarJoint[source]#
Add a new joint (AvatarJoint) to the entity.
- Parameters:
name (str) – Name of the joint.
n_qs (int) – Number of configuration variables (generalized coordinates).
n_dofs (int) – Number of degrees of freedom for the joint.
type (str) – Type of the joint (e.g., “revolute”, “prismatic”).
pos (array-like) – Position of the joint frame.
quat (array-like) – Orientation (quaternion) of the joint frame.
dofs_motion_ang (array-like) – Angular motions allowed for each DOF.
dofs_motion_vel (array-like) – Velocity directions for each DOF.
dofs_limit (array-like) – Limits for each DOF (e.g., min/max).
dofs_invweight (array-like) – Inverse weight for each DOF.
dofs_stiffness (array-like) – Stiffness values for each DOF.
dofs_damping (array-like) – Damping values for each DOF.
dofs_armature (array-like) – Armature inertia values.
dofs_kp (array-like) – Proportional gains for control.
dofs_kv (array-like) – Derivative gains for control.
dofs_force_range (array-like) – Allowed force/torque range for each DOF.
init_q (array-like) – Initial configuration (position/orientation) for the joint.
- Returns:
joint – The created AvatarJoint instance.
- Return type: