concepts.simulator.sapien2.test_planning.SapienPlanningWorld#

class SapienPlanningWorld[source]#

Bases: PlanningWorld

Methods

check_collision_between(obj_A, obj_B, *[, acm])

Check collision between two objects, which can either be a ArticulationBase or an ActorBase.

convert_sapien_actor(actor)

Converts a SAPIEN Actor Base to an FCLObject.

distance_between(obj_A, obj_B, *[, acm, ...])

Check distance-to-collision between two objects, which can either be a ArticulationBase or an ActorBase.

update_from_simulation(*[, ...])

Updates PlanningWorld's articulations/objects pose with current Scene state.

__call__(*args, **kwargs)#

Call self as a function.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

__getitem__(key)#
Parameters:

key (Any)

Return type:

_MockObject

__init__(sapien_scene, planned_articulations=[])[source]#

Creates an mplib.PlanningWorld from a sapien.Scene.

Parameters:
  • planned_articulations (list[sapien.core.Articulation]) – list of planned articulations.

  • sapien_scene (sapien.core.Scene)

__iter__()#
Return type:

Iterator[Any]

__len__()#
Return type:

int

static __new__(cls, *args, **kwargs)#
Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

check_collision_between(obj_A, obj_B, *, acm=AllowedCollisionMatrix())[source]#

Check collision between two objects, which can either be a ArticulationBase or an ActorBase.

Parameters:
  • obj_A (ArticulationBase | ActorBase) – object A to check for collision.

  • obj_B (ArticulationBase | ActorBase) – object B to check for collision.

  • acm (AllowedCollisionMatrix) – allowed collision matrix.

Returns:

a list of WorldCollisionResult. Empty if there’s no collision.

Return type:

list[WorldCollisionResult]

static convert_sapien_actor(actor)[source]#

Converts a SAPIEN Actor Base to an FCLObject. All shapes in the returned FCLObject are already set at their world poses.

Parameters:

actor (ActorBase) – a SAPIEN ActorBase.

Returns:

an FCLObject containing all collision shapes in the Physx component. If the component has no collision shapes, return None.

Return type:

FCLObject | None

distance_between(obj_A, obj_B, *, acm=AllowedCollisionMatrix(), return_distance_only=True)[source]#

Check distance-to-collision between two objects, which can either be a ArticulationBase or an ActorBase.

Parameters:
  • obj_A (ArticulationBase | ActorBase) – object A to check for collision.

  • obj_B (ArticulationBase | ActorBase) – object B to check for collision.

  • acm (AllowedCollisionMatrix) – allowed collision matrix.

  • return_distance_only (bool) – if True, return distance only.

Returns:

a WorldDistanceResult or a float if return_distance_only==True.

Return type:

WorldDistanceResult | float

update_from_simulation(*, update_attached_object=True)[source]#

Updates PlanningWorld’s articulations/objects pose with current Scene state. Note that shape’s local_pose is not updated. If those are changed, please recreate a new SapienPlanningWorld instance.

Parameters:

update_attached_object (bool) – whether to update the attached pose of all attached objects

Return type:

None