concepts.dm.crowhat.impl.maniskill3.maniskill3_planning_world_interface.ManiSkill3PlanningWorldInterface#

class ManiSkill3PlanningWorldInterface[source]#

Bases: PlanningWorldInterface

Here I give the type correspondence between planningworld interface and sapien: - object: actor - body: articulation - link: link - object_id: per_scene_id In ManiSkill3, name must be unique for each actor and articulation, so I use name to identify objects. Note that the quaternion convention is wxyz.

Methods

add_attachment(a, a_link, b, b_link[, a_to_b])

Set the attachment between object a and object b.

check_collision([a, b, ...])

Check if there is a collision between the object with the given identifiers.

check_collision_pairs(pairs[, ...])

Check if there is a collision between the pairs of objects.

check_collision_with_other_objects(object_id)

Check if there is a collision between the object with the given identifier and other objects.

checkpoint_world()

find_joint_by_name_with_body(body_name, ...)

find_link_by_name_with_body(body_name, link_name)

get_contact_points([a, b, max_distance, ...])

Get the contact points of the object between a and b, which are the identifiers of two objects.

get_link_pose(body_id, link_id)

Get the pose of the link with the given body and link identifiers.

get_object_mesh(identifier[, mode])

Get the mesh of the object with the given identifier.

get_object_name(identifier)

Get the name of the object with the given identifier.

get_object_point_cloud(identifier, **kwargs)

Get the point cloud of the object with the given identifier.

get_object_pose(identifier)

Get the pose of the object with the given identifier.

get_objects()

Get a list of objects in the world.

get_single_contact_normal(object_id, ...[, ...])

remove_attachment(a, a_link, b, b_link)

Remove the attachment between object a and object b.

restore_world(world)

Restore the world state from the given world state.

save_world()

Save the current world state.

set_object_pose(identifier, pose)

Set the pose of the object with the given identifier.

update_name2body()

update_name2object()

Attributes

__init__(env)[source]#
Parameters:

env (mani_skill.BaseEnv)

__new__(**kwargs)#
add_attachment(a, a_link, b, b_link, a_to_b=None)#

Set the attachment between object a and object b. This is an optional functionality that can be implemented in subclasses

Parameters:
Returns:

an identifier of the attachment.

Return type:

Any

check_collision(a=None, b=None, ignored_collision_bodies=None, max_distance=None)#

Check if there is a collision between the object with the given identifiers.

Parameters:
  • a (int | str | None) – the identifier of the first object.

  • b (int | str | None) – the identifier of the second object.

  • ignored_collision_bodies (List[str | int] | None) – a list of identifiers of the bodies to ignore.

  • max_distance (float | None)

Returns:

True if there is a collision, False otherwise.

Return type:

bool

check_collision_pairs(pairs, ignored_collision_bodies=None)#

Check if there is a collision between the pairs of objects.

Parameters:
  • pairs (List[Tuple[str | int, str | int]]) – a list of pairs of objects.

  • ignored_collision_bodies (List[str | int] | None) – a list of identifiers of the bodies to ignore.

Returns:

True if there is a collision, False otherwise.

Return type:

bool

check_collision_with_other_objects(object_id, ignore_self_collision=True, ignored_collision_bodies=None, max_distance=None, return_list=False, verbose=False)#

Check if there is a collision between the object with the given identifier and other objects.

Parameters:
  • object_id (str | int) – the identifier of the object.

  • ignore_self_collision (bool) – whether to ignore the collision between the object and itself.

  • ignored_collision_bodies (List[str | int] | None) – a list of identifiers of the bodies to ignore.

  • max_distance (float | None) – the maximum distance to consider a collision.

  • return_list (bool) – whether to return the list of identifiers of the colliding objects.

  • verbose (bool)

Returns:

True if there is a collision, False otherwise. If return_list is True, it will return the list of identifiers of the colliding objects.

Return type:

bool | List[str | int]

checkpoint_world()#
Return type:

Iterator[Any]

find_joint_by_name_with_body(body_name, joint_name)[source]#
Parameters:
  • body_name (str)

  • joint_name (str)

Return type:

sapien.pysapien.physx.PhysxArticulationJoint

Parameters:
  • body_name (str)

  • link_name (str)

Return type:

sapien.Entity

get_contact_points(a=None, b=None, max_distance=None, ignored_collision_bodies=None)#

Get the contact points of the object between a and b, which are the identifiers of two objects. If either a or b is None, it will return the contact points of the object with the given identifier. When both a and b are None, it will return all the contact points in the world.

Parameters:
  • a (int | str | None) – the identifier of the first object.

  • b (int | str | None) – the identifier of the second object.

  • ignored_collision_bodies (List[str | int] | None) – a list of identifiers of the bodies to ignore.

  • max_distance (float | None)

Returns:

a list of contact points.

Return type:

List[GeometricContactInfo]

Get the pose of the link with the given body and link identifiers.

Parameters:
  • body_id (str | int) – the identifier of the body.

  • link_id (str | int) – the identifier of the link.

Returns:

a tuple of the position and quaternion of the link.

Return type:

Tuple[Tuple[float, float, float] | List[float] | ndarray, Tuple[float, float, float, float] | List[float] | ndarray]

get_object_mesh(identifier, mode='open3d', **kwargs)#

Get the mesh of the object with the given identifier.

Parameters:
  • identifier (str | int) – the identifier of the object.

  • mode (str) – the mode of the mesh. Default is ‘open3d’.

Returns:

the mesh of the object.

Return type:

open3d.geometry.TriangleMesh | trimesh.Trimesh

get_object_name(identifier)#

Get the name of the object with the given identifier.

Parameters:

identifier (str | int) – the identifier of the object.

Returns:

the name of the object.

Return type:

str

get_object_point_cloud(identifier, **kwargs)#

Get the point cloud of the object with the given identifier.

Parameters:

identifier (str | int) – the identifier of the object.

Returns:

the point cloud of the object.

Return type:

open3d.geometry.PointCloud

get_object_pose(identifier)#

Get the pose of the object with the given identifier.

Parameters:

identifier (str | int) – the identifier of the object.

Returns:

a tuple of the position and quaternion of the object.

Return type:

Tuple[Tuple[float, float, float] | List[float] | ndarray, Tuple[float, float, float, float] | List[float] | ndarray]

get_objects()#

Get a list of objects in the world.

Returns:

a list of objects in the world.

Return type:

List[Any]

get_single_contact_normal(object_id, support_object_id, deviation_tol=0.05, return_center=False)[source]#
Parameters:
  • object_id (str)

  • support_object_id (str)

  • deviation_tol (float)

  • return_center (bool)

Return type:

ndarray | Tuple[ndarray, ndarray]

remove_attachment(a, a_link, b, b_link)#

Remove the attachment between object a and object b. This is an optional functionality that can be implemented in subclasses.

Parameters:
  • a (str | int) – the identifier of the first object.

  • a_link (str | int) – the link index of the first object.

  • b (str | int) – the identifier of the second object.

  • b_link (str | int) – the link index of the second object.

restore_world(world)#

Restore the world state from the given world state.

Parameters:

world (Any)

save_world()#

Save the current world state.

Return type:

Any

set_object_pose(identifier, pose)#

Set the pose of the object with the given identifier.

Parameters:
update_name2body()[source]#
update_name2object()[source]#
property sapien_scene: sapien.Scene#