internutopia.core.robot.rigid_body#
rigid_body#
- class internutopia.core.robot.rigid_body.IRigidBody[source]#
Represents a rigid body in the simulation environment.
- A RigidBody is a solid, non-deformable physical entity that can either be:
A robot link within an articulation
An independent object such as a box.
if rigid body is an independent object, it possesses six DoFs, corresponding to translational motion along the x, y, z axes and rotational motion and its motion like linear velocity can be directly controlled. However, if rigidBody is a rigid link within an articulation, its motion must be regulated by controlling the DoFs of the articulation.
- classmethod create(simulator_type: str = 'isaac_sim', prim_path: str | None = None, usd_path: str | None = None, name: str | None = None, position: ndarray | None = None, translation: ndarray | None = None, orientation: ndarray | None = None, scale: ndarray | None = None, visible: bool | None = None, mass: float | None = None, linear_velocity: ndarray | None = None, angular_velocity: ndarray | None = None, owner_articulation: IArticulation | None = None) IRigidBody [source]#
Factory method to create IRigidBody instances based on simulator_type.
- Parameters:
simulator_type (str) – simulator type.
prim_path (str, optional) – prim path of the Prim to encapsulate or create.
usd_path (str, optional) – The file path containing the rigid body definition.
name (str, optional) – shortname to be used as a key by Scene class. Note: needs to be unique if the object is added to the Scene.
position (Optional[np.ndarray], optional) – position in the world frame of the prim. shape is (3, ). Defaults to None, which means left unchanged.
translation (Optional[np.ndarray], optional) – translation in the local frame of the prim (with respect to its parent prim). shape is (3, ). Defaults to None, which means left unchanged.
orientation (Optional[np.ndarray], optional) – quaternion orientation in the world/ local frame of the prim (depends if translation or position is specified). quaternion is scalar-first (w, x, y, z). shape is (4, ). Defaults to None, which means left unchanged.
scale (Optional[np.ndarray], optional) – local scale to be applied to the prim’s dimensions. shape is (3, ). Defaults to None, which means left unchanged.
visible (bool, optional) – set to false for an invisible prim in the stage while rendering. Defaults to True.
mass (Optional[float], optional) – mass in kg. Defaults to None.
linear_velocity (Optional[np.ndarray], optional) – linear velocity in the world frame. Defaults to None.
angular_velocity (Optional[np.ndarray], optional) – angular velocity in the world frame. Defaults to None.
owner_articulation (Optional[IArticulation], optional) – The articulation to which the rigid body belongs if rigid body represents a link. Defaults to None.
- abstract get_angular_velocity()[source]#
Get the angular velocity of the rigid body
- Returns:
current angular velocity of the the rigid prim. Shape (3,).
- Return type:
np.ndarray
- abstract get_linear_velocity() ndarray [source]#
Get the linear velocity of the rigid body
- Returns:
current linear velocity of the the rigid prim. Shape (3,).
- Return type:
np.ndarray
- abstract get_mass() float [source]#
Get the mass of the rigid body
- Returns:
mass of the rigid body in kg.
- Return type:
float