mani_skill.utils.structs.actor ============================== .. py:module:: mani_skill.utils.structs.actor Classes ------- .. autoapisummary:: mani_skill.utils.structs.actor.Actor Module Contents --------------- .. py:class:: Actor Bases: :py:obj:`mani_skill.utils.structs.base.PhysxRigidDynamicComponentStruct`\ [\ :py:obj:`sapien.Entity`\ ] Wrapper around sapien.Entity objects mixed in with useful properties from the RigidBodyDynamicComponent components At the moment, on GPU and CPU one can query pose, linear velocity, and angular velocity easily On CPU, more properties are available .. py:method:: __hash__() .. py:method:: __repr__() .. py:method:: __str__() .. py:method:: apply_force(force) Apply an instantaneous external force to this actor in Newtons to the body's center of mass. Once called no need to call any gpu_apply_x functions as this handles it for you. .. py:method:: create_from_entities(entities, scene, scene_idxs, shared_name = None) :classmethod: .. py:method:: get_collision_meshes(to_world_frame = True, first_only = False) Returns the collision mesh of each managed actor object. Note results of this are not cached or optimized at the moment so this function can be slow if called too often. Some actors have no collision meshes, in which case this function returns an empty list. :param to_world_frame: Whether to transform the collision mesh pose to the world frame :type to_world_frame: bool :param first_only: Whether to return the collision mesh of just the first actor managed by this object. If True, this also returns a single Trimesh.Mesh object instead of a list. This can be useful for efficiency reasons if you know ahead of time all of the managed actors have the same collision mesh :type first_only: bool .. py:method:: get_first_collision_mesh(to_world_frame = True) Returns the collision mesh of the first managed actor object. Note results of this are not cached or optimized at the moment so this function can be slow if called too often. Some actors have no collision meshes, in which case this function returns None :param to_world_frame: Whether to transform the collision mesh pose to the world frame :type to_world_frame: bool .. py:method:: get_state() .. py:method:: hide_visual() Hides this actor from view. In CPU simulation the visual body is simply set to visibility 0 For GPU simulation, currently this is implemented by moving the actor very far away as visiblity cannot be changed on the fly. As a result we do not permit hiding and showing visuals of objects with collision shapes as this affects the actual simulation. Note that this operation can also be fairly slow as we need to run px.gpu_apply_rigid_dynamic_data and px.gpu_fetch_rigid_dynamic_data. .. py:method:: is_static(lin_thresh=0.01, ang_thresh=0.1) Checks if this actor is static within the given linear velocity threshold `lin_thresh` and angular velocity threshold `ang_thresh` .. py:method:: merge(actors, name = None) :classmethod: Merge actors together under one view so that they can all be managed by one python dataclass object. This can be useful for e.g. randomizing the asset loaded into a task and being able to do object.pose to fetch the pose of all randomized assets or object.set_pose to change the pose of each of the different assets, despite the assets not being uniform across all sub-scenes. For example usage of this method, see mani_skill/envs/tasks/pick_single_ycb.py :param actors: The actors to merge into one actor object to manage :type actors: list[Actor] :param name: A new name to give the merged actors. If none, the name will default to the first actor's name :type name: str .. py:method:: remove_from_scene() .. py:method:: set_collision_group(group, value) .. py:method:: set_collision_group_bit(group, bit_idx, bit) Set's a specific collision group bit for all collision shapes in all parallel actors .. py:method:: set_pose(arg1) .. py:method:: set_state(state, env_idx = None) .. py:method:: show_visual() .. py:property:: has_collision_shapes .. py:attribute:: hidden :type: bool :value: False .. py:attribute:: initial_pose :type: mani_skill.utils.structs.pose.Pose :value: None The initial pose of this Actor, as defined when creating the actor via the ActorBuilder. It is necessary to track this pose to ensure the actor is still at the correct pose once gpu system is initialized. It may also be useful to help reset a environment to an initial state without having to manage initial poses yourself .. py:attribute:: merged :type: bool :value: False Whether this object is a view of other actors as a result of Actor.merge .. py:attribute:: name :type: str :value: None .. py:property:: per_scene_id Returns a int32 torch tensor of the actor level segmentation ID for each managed actor object. .. py:property:: pose :type: mani_skill.utils.structs.pose.Pose .. py:attribute:: px_body_type :type: Literal['kinematic', 'static', 'dynamic'] :value: None