fcl¶
- class mplib.collision_detection.fcl.BVHModel¶
Bases:
CollisionGeometryBVHModel collision geometry.
Inheriting from CollisionGeometry, this class specializes to a mesh geometry represented by a BVH tree.
- __init__(self: mplib.pymp.collision_detection.fcl.BVHModel) None¶
- property aabb_center¶
- property aabb_radius¶
- add_sub_model(*args, **kwargs)¶
Overloaded function.
add_sub_model(self: mplib.pymp.collision_detection.fcl.BVHModel, vertices: list[numpy.ndarray[numpy.float64[3, 1]]]) -> int
Add a sub-model to the BVHModel.
- Parameters:
vertices – vertices of the sub-model
add_sub_model(self: mplib.pymp.collision_detection.fcl.BVHModel, vertices: list[numpy.ndarray[numpy.float64[3, 1]]], faces: list[mplib.pymp.collision_detection.fcl.Triangle]) -> int
Add a sub-model to the BVHModel.
- Parameters:
vertices – vertices of the sub-model
faces – faces of the sub-model represented by a list of vertex indices
add_sub_model(self: mplib.pymp.collision_detection.fcl.BVHModel, vertices: list[numpy.ndarray[numpy.float64[3, 1]]], faces: list[numpy.ndarray[numpy.int32[3, 1]]]) -> None
Add a sub-model to the BVHModel.
- Parameters:
vertices – vertices of the sub-model
faces – faces of the sub-model represented by a list of vertex indices
- begin_model(
- self: mplib.pymp.collision_detection.fcl.BVHModel,
- num_faces: int = 0,
- num_vertices: int = 0,
Begin to construct a BVHModel.
- Parameters:
num_faces – number of faces of the mesh
num_vertices – number of vertices of the mesh
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- end_model(self: mplib.pymp.collision_detection.fcl.BVHModel) int¶
End the construction of a BVHModel.
- get_faces( ) list[mplib.pymp.collision_detection.fcl.Triangle]¶
Get the faces of the BVHModel.
- Returns:
faces of the BVHModel
- get_vertices( ) list[numpy.ndarray[numpy.float64[3, 1]]]¶
Get the vertices of the BVHModel.
- Returns:
vertices of the BVHModel
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain( ) bool¶
- property num_faces¶
- property num_vertices¶
- class mplib.collision_detection.fcl.Box¶
Bases:
CollisionGeometryBox collision geometry.
Inheriting from CollisionGeometry, this class specializes to a box geometry.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.Box, side: numpy.ndarray[numpy.float64[3, 1]]) -> None
Construct a box with given side length.
- Parameters:
side – side length of the box in an array [x, y, z]
__init__(self: mplib.pymp.collision_detection.fcl.Box, x: float, y: float, z: float) -> None
Construct a box with given side length.
- Parameters:
x – side length of the box in x direction
y – side length of the box in y direction
z – side length of the box in z direction
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- property side¶
- class mplib.collision_detection.fcl.Capsule¶
Bases:
CollisionGeometryCapsule collision geometry.
Inheriting from CollisionGeometry, this class specializes to a capsule geometry.
- __init__(
- self: mplib.pymp.collision_detection.fcl.Capsule,
- radius: float,
- lz: float,
Construct a capsule with given radius and height.
- Parameters:
radius – radius of the capsule
lz – height of the capsule along z axis
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- property lz¶
- property radius¶
- class mplib.collision_detection.fcl.CollisionGeometry¶
Bases:
pybind11_objectCollision geometry base class.
This is an FCL class so you can refer to the FCL doc here. https://flexible-collision-library.github.io/d6/d5d/classfcl_1_1CollisionGeometry.html
- __init__(*args, **kwargs)¶
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- is_free( ) bool¶
- is_occupied( ) bool¶
- is_uncertain( ) bool¶
- class mplib.collision_detection.fcl.CollisionObject¶
Bases:
pybind11_objectCollision object class.
This class contains the collision geometry and the transformation of the geometry.
- __init__(
- self: mplib.pymp.collision_detection.fcl.CollisionObject,
- collision_geometry: mplib.pymp.collision_detection.fcl.CollisionGeometry,
- pose: mplib.pymp.Pose = Pose([0, 0, 0], [1, 0, 0, 0]),
Construct a collision object with given collision geometry and transformation.
- Parameters:
collision_geometry – collision geometry of the object
pose – pose of the object
- get_collision_geometry( ) mplib.pymp.collision_detection.fcl.CollisionGeometry¶
- get_pose( ) mplib.pymp.Pose¶
Gets the current pose of the collision object in world
- Returns:
The current pose of the collision object
- property pose¶
Pose of the collision object in world
- set_pose( ) None¶
Sets the pose of the collision object in world
- Parameters:
pose – New pose of the collision object
- class mplib.collision_detection.fcl.CollisionRequest¶
Bases:
pybind11_object- __init__(
- self: mplib.pymp.collision_detection.fcl.CollisionRequest,
- num_max_contacts: int = 1,
- enable_contact: bool = False,
- num_max_cost_sources: int = 1,
- enable_cost: bool = False,
- use_approximate_cost: bool = True,
- gjk_solver_type: mplib.pymp.collision_detection.fcl.GJKSolverType = <GJKSolverType.GST_LIBCCD: 0>,
- gjk_tolerance: float = 1e-06,
- is_satisfied(
- self: mplib.pymp.collision_detection.fcl.CollisionRequest,
- result: fcl::CollisionResult<double>,
- class mplib.collision_detection.fcl.CollisionResult¶
Bases:
pybind11_object- __init__( ) None¶
- add_contact(
- self: mplib.pymp.collision_detection.fcl.CollisionResult,
- c: fcl::Contact<double>,
- add_cost_source(
- self: mplib.pymp.collision_detection.fcl.CollisionResult,
- c: fcl::CostSource<double>,
- num_max_cost_sources: int,
- clear(self: mplib.pymp.collision_detection.fcl.CollisionResult) None¶
- get_contact(
- self: mplib.pymp.collision_detection.fcl.CollisionResult,
- i: int,
- get_contacts( ) list[fcl::Contact<double>]¶
- get_cost_sources( ) list[fcl::CostSource<double>]¶
- is_collision( ) bool¶
- num_contacts( ) int¶
- num_cost_sources( ) int¶
- class mplib.collision_detection.fcl.Cone¶
Bases:
CollisionGeometryCone collision geometry.
Inheriting from CollisionGeometry, this class specializes to a cone geometry.
- __init__(
- self: mplib.pymp.collision_detection.fcl.Cone,
- radius: float,
- lz: float,
Construct a cone with given radius and height.
- Parameters:
radius – radius of the cone
lz – height of the cone along z axis
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- property lz¶
- property radius¶
- class mplib.collision_detection.fcl.Contact¶
Bases:
pybind11_object- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.Contact) -> None
__init__(self: mplib.pymp.collision_detection.fcl.Contact, o1: mplib.pymp.collision_detection.fcl.CollisionGeometry, o2: mplib.pymp.collision_detection.fcl.CollisionGeometry, b1: int, b2: int) -> None
__init__(self: mplib.pymp.collision_detection.fcl.Contact, o1: mplib.pymp.collision_detection.fcl.CollisionGeometry, o2: mplib.pymp.collision_detection.fcl.CollisionGeometry, b1: int, b2: int, pos: numpy.ndarray[numpy.float64[3, 1]], normal: numpy.ndarray[numpy.float64[3, 1]], depth: float) -> None
- property normal¶
- property penetration_depth¶
- property pos¶
- class mplib.collision_detection.fcl.ContactPoint¶
Bases:
pybind11_object- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.ContactPoint) -> None
__init__(self: mplib.pymp.collision_detection.fcl.ContactPoint, normal: numpy.ndarray[numpy.float64[3, 1]], pos: numpy.ndarray[numpy.float64[3, 1]], penetration_depth: float) -> None
- property normal¶
- property penetration_depth¶
- property pos¶
- class mplib.collision_detection.fcl.Convex¶
Bases:
CollisionGeometryConvex collision geometry.
Inheriting from CollisionGeometry, this class specializes to a convex geometry.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.Convex, vertices: std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > >, num_faces: int, faces: std::vector<int, std::allocator<int> >, throw_if_invalid: bool = True) -> None
Construct a convex with given vertices and faces.
- Parameters:
vertices – vertices of the convex
num_faces – number of faces of the convex
faces – faces of the convex geometry represented by a list of vertex indices
throw_if_invalid – if
True, throw an exception if the convex is invalid
__init__(self: mplib.pymp.collision_detection.fcl.Convex, vertices: numpy.ndarray[numpy.float64[m, 3]], faces: numpy.ndarray[numpy.int32[m, 3]], throw_if_invalid: bool = True) -> None
Construct a convex with given vertices and faces.
- Parameters:
vertices – vertices of the convex
faces – faces of the convex geometry represented by a list of vertex indices
throw_if_invalid – if
True, throw an exception if the convex is invalid
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume(self: mplib.pymp.collision_detection.fcl.Convex) float¶
Compute the volume of the convex.
- Returns:
volume of the convex
- property cost_density¶
- get_face_count(self: mplib.pymp.collision_detection.fcl.Convex) int¶
Get the number of faces of the convex.
- Returns:
number of faces of the convex
- get_faces(self: mplib.pymp.collision_detection.fcl.Convex) list[int]¶
Get the faces of the convex.
- Returns:
faces of the convex represented by a list of vertex indices
- get_interior_point( ) numpy.ndarray[numpy.float64[3, 1]]¶
Sample a random interior point of the convex geometry
- Returns:
interior point of the convex
- get_vertices( ) list[numpy.ndarray[numpy.float64[3, 1]]]¶
Get the vertices of the convex.
- Returns:
vertices of the convex
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- class mplib.collision_detection.fcl.CostSource¶
Bases:
pybind11_object- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.CostSource) -> None
__init__(self: mplib.pymp.collision_detection.fcl.CostSource, aabb_min: numpy.ndarray[numpy.float64[3, 1]], aabb_max: numpy.ndarray[numpy.float64[3, 1]], cost_density: float) -> None
- property aabb_max¶
- property aabb_min¶
- property cost_density¶
- property total_cost¶
- class mplib.collision_detection.fcl.Cylinder¶
Bases:
CollisionGeometryCylinder collision geometry.
Inheriting from CollisionGeometry, this class specializes to a cylinder geometry.
- __init__(
- self: mplib.pymp.collision_detection.fcl.Cylinder,
- radius: float,
- lz: float,
Construct a cylinder with given radius and height.
- Parameters:
radius – radius of the cylinder
lz – height of the cylinder along z axis
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain( ) bool¶
- property lz¶
- property radius¶
- class mplib.collision_detection.fcl.DistanceRequest¶
Bases:
pybind11_object- __init__(
- self: mplib.pymp.collision_detection.fcl.DistanceRequest,
- enable_nearest_points: bool = False,
- enable_signed_distance: bool = False,
- rel_err: float = 0.0,
- abs_err: float = 0.0,
- distance_tolerance: float = 1e-06,
- gjk_solver_type: mplib.pymp.collision_detection.fcl.GJKSolverType = <GJKSolverType.GST_LIBCCD: 0>,
- is_satisfied(
- self: mplib.pymp.collision_detection.fcl.DistanceRequest,
- result: fcl::DistanceResult<double>,
- class mplib.collision_detection.fcl.DistanceResult¶
Bases:
pybind11_object- __init__(
- self: mplib.pymp.collision_detection.fcl.DistanceResult,
- min_distance: float = 1.7976931348623157e+308,
- clear(self: mplib.pymp.collision_detection.fcl.DistanceResult) None¶
- property min_distance¶
- property nearest_points¶
- class mplib.collision_detection.fcl.Ellipsoid¶
Bases:
CollisionGeometryEllipsoid collision geometry.
Inheriting from CollisionGeometry, this class specializes to a ellipsoid geometry.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.Ellipsoid, a: float, b: float, c: float) -> None
Construct a ellipsoid with given parameters.
- Parameters:
a – length of the
xsemi-axisb – length of the
ysemi-axisc – length of the
zsemi-axis
__init__(self: mplib.pymp.collision_detection.fcl.Ellipsoid, radii: numpy.ndarray[numpy.float64[3, 1]]) -> None
Construct a ellipsoid with given parameters.
- Parameters:
radii – vector of the length of the
x,y, andzsemi-axes
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied( ) bool¶
- is_uncertain( ) bool¶
- property radii¶
- class mplib.collision_detection.fcl.FCLModel¶
Bases:
pybind11_objectFCL collision model of an articulation
See https://github.com/flexible-collision-library/fcl
- __init__(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- urdf_filename: str,
- *,
- convex: bool = False,
- verbose: bool = False,
Construct an FCL model from URDF and SRDF files.
- Parameters:
urdf_filename – path to URDF file, can be relative to the current working directory
convex – use convex decomposition for collision objects. Default:
False.verbose – print debug information. Default:
False.
- check_collision_with(*args, **kwargs)¶
Overloaded function.
check_collision_with(self: mplib.pymp.collision_detection.fcl.FCLModel, other: mplib.pymp.collision_detection.fcl.FCLModel, request: mplib.pymp.collision_detection.fcl.CollisionRequest = <mplib.pymp.collision_detection.fcl.CollisionRequest object at 0x7f5817365c70>, *, acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f5817365c30>) -> list[mplib.pymp.collision_detection.WorldCollisionResult]
Check for collision in the current state with another
FCLModel, ignoring the distances between links that are allowed to always collide (as specified by acm).- Parameters:
other – another
FCLModelto check collision withacm – allowed collision matrix.
request – collision request
- Returns:
List of
WorldCollisionResultobjects. If empty, no collision.
check_collision_with(self: mplib.pymp.collision_detection.fcl.FCLModel, object: mplib::collision_detection::fcl::FCLObject<double>, request: mplib.pymp.collision_detection.fcl.CollisionRequest = <mplib.pymp.collision_detection.fcl.CollisionRequest object at 0x7f5817365df0>, *, acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f5817355db0>) -> list[mplib.pymp.collision_detection.WorldCollisionResult]
Check for collision in the current state with an
FCLObject, ignoring the distances between objects that are allowed to always collide (as specified by acm).- Parameters:
object – an
FCLObjectto check collision withacm – allowed collision matrix.
request – collision request
- Returns:
List of
WorldCollisionResultobjects. If empty, no collision.
- check_self_collision(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- request: mplib.pymp.collision_detection.fcl.CollisionRequest = <mplib.pymp.collision_detection.fcl.CollisionRequest object at 0x7f5817365ab0>,
- *,
- acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f58256eae70>,
Check for self-collision in the current state and returns all found collisions, ignoring the distances between links that are allowed to always collide (as specified by acm).
- Parameters:
request – collision request
acm – allowed collision matrix.
- Returns:
List of
WorldCollisionResultobjects. If empty, no self-collision.
- static create_from_urdf_string(urdf_string: str, collision_links: list[mplib::collision_detection::fcl::FCLObject<double>], *, verbose: bool = False) mplib.pymp.collision_detection.fcl.FCLModel¶
Constructs a FCLModel from URDF string and collision links
- Parameters:
urdf_string – URDF string (without visual/collision elements for links)
collision_links – Vector of collision links as FCLObjectPtr. Format is:
[FCLObjectPtr, ...]. The collision objects are at the shape’s local_pose.verbose – print debug information. Default:
False.
- Returns:
a unique_ptr to FCLModel
- distance_self(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- request: mplib.pymp.collision_detection.fcl.DistanceRequest = <mplib.pymp.collision_detection.fcl.DistanceRequest object at 0x7f58173660f0>,
- *,
- acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f581735b530>,
Get the minimum distance to self-collision given the robot in current state, ignoring the distances between links that are allowed to always collide (as specified by acm).
- Parameters:
request – distance request.
acm – allowed collision matrix.
- Returns:
a
WorldDistanceResultobject
- distance_to_collision_with(*args, **kwargs)¶
Overloaded function.
distance_to_collision_with(self: mplib.pymp.collision_detection.fcl.FCLModel, other: mplib.pymp.collision_detection.fcl.FCLModel, *, acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f5817356230>) -> float
The minimum distance to collision with another
FCLModelgiven the robot in current state, ignoring the distances between links that are allowed to always collide (as specified by acm).- Parameters:
other – another
FCLModelto get minimum distance-to-collision withacm – allowed collision matrix.
- Returns:
minimum distance-to-collision with the other
FCLModel
distance_to_collision_with(self: mplib.pymp.collision_detection.fcl.FCLModel, object: mplib::collision_detection::fcl::FCLObject<double>, *, acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f58173566f0>) -> float
The minimum distance to collision with an
FCLObjectgiven the robot in current state, ignoring the distances between objects that are allowed to always collide (as specified by acm).- Parameters:
object – an
FCLObjectto get minimum distance-to-collision withacm – allowed collision matrix.
- Returns:
minimum distance-to-collision with the
FCLObject
- distance_to_self_collision(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- *,
- acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f5817365f70>,
The minimum distance to self-collision given the robot in current state, ignoring the distances between links that are allowed to always collide (as specified by acm). Calls
distanceSelf().- Parameters:
acm – allowed collision matrix.
- Returns:
minimum distance-to-self-collision
- distance_with(*args, **kwargs)¶
Overloaded function.
distance_with(self: mplib.pymp.collision_detection.fcl.FCLModel, other: mplib.pymp.collision_detection.fcl.FCLModel, request: mplib.pymp.collision_detection.fcl.DistanceRequest = <mplib.pymp.collision_detection.fcl.DistanceRequest object at 0x7f5817366430>, *, acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f581735a130>) -> mplib.pymp.collision_detection.WorldDistanceResult
Get the minimum distance to collision with another
FCLModelgiven the robot in current state, ignoring the distances between links that are allowed to always collide (as specified by acm).- Parameters:
other – another
FCLModelto get minimum distance-to-collision withrequest – distance request.
acm – allowed collision matrix.
- Returns:
a
WorldDistanceResultobject
distance_with(self: mplib.pymp.collision_detection.fcl.FCLModel, object: mplib::collision_detection::fcl::FCLObject<double>, request: mplib.pymp.collision_detection.fcl.DistanceRequest = <mplib.pymp.collision_detection.fcl.DistanceRequest object at 0x7f5824cd24f0>, *, acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f58173592f0>) -> mplib.pymp.collision_detection.WorldDistanceResult
Get the minimum distance to collision with an
FCLObjectgiven the robot in current state, ignoring the distances between objects that are allowed to always collide (as specified by acm).- Parameters:
object – an
FCLObjectto get minimum distance-to-collision withrequest – distance request.
acm – allowed collision matrix.
- Returns:
a
WorldDistanceResultobject
- get_collision_link_names( ) list[str]¶
- get_collision_objects( ) list[mplib::collision_detection::fcl::FCLObject<double>]¶
Get the collision objects of the FCL model.
- Returns:
all collision objects of the FCL model
- get_collision_pairs( ) list[tuple[int, int]]¶
Get the collision pairs of the FCL model.
- Returns:
collision pairs of the FCL model. If the FCL model has N collision objects, the collision pairs is a list of N*(N-1)/2 pairs minus the disabled collision pairs
- get_name(self: mplib.pymp.collision_detection.fcl.FCLModel) str¶
Get name of the articulated model.
- Returns:
name of the articulated model
- is_state_colliding(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- *,
- acm: mplib.pymp.collision_detection.AllowedCollisionMatrix = <mplib.pymp.collision_detection.AllowedCollisionMatrix object at 0x7f5817c81ef0>,
Check if the current state is in self-collision, ignoring the distances between links that are allowed to always collide (as specified by acm).
- Parameters:
acm – allowed collision matrix.
- Returns:
Trueif any collision pair collides andFalseotherwise.
- property name¶
Name of the fcl model
- remove_collision_pairs_from_srdf(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- srdf_filename: str,
Remove collision pairs from SRDF file.
- Parameters:
srdf_filename – path to SRDF file, can be relative to the current working directory
- set_link_order(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- names: list[str],
Set the link order of the FCL model.
- Parameters:
names – list of link names in the order that you want to set.
- update_collision_objects(
- self: mplib.pymp.collision_detection.fcl.FCLModel,
- link_poses: list[mplib.pymp.Pose],
Update the collision objects of the FCL model.
- Parameters:
link_poses – list of link poses in the order of the link order
- class mplib.collision_detection.fcl.FCLObject¶
Bases:
pybind11_objectA general high-level object which consists of multiple FCLCollisionObjects. It is the top level data structure which is used in the collision checking process.
Mimicking MoveIt2’s
collision_detection::FCLObjectandcollision_detection::World::Objecthttps://moveit.picknik.ai/main/api/html/structcollision__detection_1_1FCLObject.html https://moveit.picknik.ai/main/api/html/structcollision__detection_1_1World_1_1Object.html
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.FCLObject, name: str) -> None
Construct a new FCLObject with the given name
- Parameters:
name – name of this FCLObject
__init__(self: mplib.pymp.collision_detection.fcl.FCLObject, name: str, pose: mplib.pymp.Pose, shapes: list[mplib.pymp.collision_detection.fcl.CollisionObject], shape_poses: list[mplib.pymp.Pose]) -> None
Construct a new FCLObject with the given name and shapes
- Parameters:
name – name of this FCLObject
pose – pose of this FCLObject. All shapes are relative to this pose
shapes – all collision shapes as a vector of
fcl::CollisionObjectPtrshape_poses – relative poses from this FCLObject to each collision shape
- property name¶
Name of this FCLObject
- property pose¶
Pose of this FCLObject. All shapes are relative to this pose
- property shape_poses¶
Relative poses from this FCLObject to each collision shape
- property shapes¶
All collision shapes (
fcl::CollisionObjectPtr) making up this FCLObject
- class mplib.collision_detection.fcl.GJKSolverType¶
Bases:
pybind11_objectMembers:
GST_LIBCCD
GST_INDEP
- GST_INDEP = <GJKSolverType.GST_INDEP: 1>¶
- GST_LIBCCD = <GJKSolverType.GST_LIBCCD: 0>¶
- __init__(
- self: mplib.pymp.collision_detection.fcl.GJKSolverType,
- value: int,
- property name¶
- property value¶
- class mplib.collision_detection.fcl.Halfspace¶
Bases:
CollisionGeometryInfinite halfspace collision geometry.
Inheriting from CollisionGeometry, this class specializes to a halfspace geometry.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.Halfspace, n: numpy.ndarray[numpy.float64[3, 1]], d: float) -> None
Construct a halfspace with given normal direction and offset where
n * p = d. Points in the negative side of the separation plane{p | n * p < d}are inside the half space (will have collision).- Parameters:
n – normal direction of the halfspace
d – offset of the halfspace
__init__(self: mplib.pymp.collision_detection.fcl.Halfspace, a: float, b: float, c: float, d: float) -> None
Construct a halfspace with given halfspace parameters where
ax + by + cz = d. Points in the negative side of the separation plane{(x, y, z) | ax + by + cz < d}are inside the half space (will have collision).
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- property d¶
- distance(
- self: mplib.pymp.collision_detection.fcl.Halfspace,
- p: numpy.ndarray[numpy.float64[3, 1]],
Compute the distance of a point to the halfspace as
abs(n * p - d).- Parameters:
p – a point in 3D space
- Returns:
distance of the point to the halfspace
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied( ) bool¶
- is_uncertain( ) bool¶
- property n¶
- signed_distance(
- self: mplib.pymp.collision_detection.fcl.Halfspace,
- p: numpy.ndarray[numpy.float64[3, 1]],
Compute the signed distance of a point to the halfspace as
n * p - d.- Parameters:
p – a point in 3D space
- Returns:
signed distance of the point to the halfspace
- class mplib.collision_detection.fcl.OcTree¶
Bases:
CollisionGeometryOcTree collision geometry.
Inheriting from CollisionGeometry, this class specializes to a point cloud geometry represented by an OcTree.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.OcTree, resolution: float = 0.01) -> None
Construct an OcTree with given resolution.
- Parameters:
resolution – resolution of the OcTree (smallest size of a voxel). You can treat this is as the diameter of a point. Default is 0.01.
__init__(self: mplib.pymp.collision_detection.fcl.OcTree, vertices: numpy.ndarray[numpy.float64[m, 3]], resolution: float = 0.01) -> None
Construct an OcTree with given vertices and resolution.
- Parameters:
vertices – vertices of the point cloud
resolution – resolution of the OcTree. Default is 0.01
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- class mplib.collision_detection.fcl.Plane¶
Bases:
CollisionGeometryInfinite plane collision geometry.
Inheriting from CollisionGeometry, this class specializes to a plane geometry.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.Plane, n: numpy.ndarray[numpy.float64[3, 1]], d: float) -> None
Construct a plane with given normal direction and offset where
n * p = d.- Parameters:
n – normal direction of the plane
d – offset of the plane
__init__(self: mplib.pymp.collision_detection.fcl.Plane, a: float, b: float, c: float, d: float) -> None
Construct a plane with given plane parameters where
ax + by + cz = d.
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- property d¶
- distance(
- self: mplib.pymp.collision_detection.fcl.Plane,
- p: numpy.ndarray[numpy.float64[3, 1]],
Compute the distance of a point to the plane as
abs(n * p - d).- Parameters:
p – a point in 3D space
- Returns:
distance of the point to the plane
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- property n¶
- signed_distance(
- self: mplib.pymp.collision_detection.fcl.Plane,
- p: numpy.ndarray[numpy.float64[3, 1]],
Compute the signed distance of a point to the plane as
n * p - d.- Parameters:
p – a point in 3D space
- Returns:
signed distance of the point to the plane
- class mplib.collision_detection.fcl.Sphere¶
Bases:
CollisionGeometrySphere collision geometry.
Inheriting from CollisionGeometry, this class specializes to a sphere geometry.
- __init__(self: mplib.pymp.collision_detection.fcl.Sphere, radius: float) None¶
Construct a sphere with given radius.
- Parameters:
radius – radius of the sphere
- property aabb_center¶
- property aabb_radius¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_uncertain(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- property radius¶
- class mplib.collision_detection.fcl.Triangle¶
Bases:
pybind11_objectTriangle with 3 indices for points.
This is an FCL class so you can refer to the FCL doc here. https://flexible-collision-library.github.io/de/daa/classfcl_1_1Triangle.html
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: mplib.pymp.collision_detection.fcl.Triangle) -> None
__init__(self: mplib.pymp.collision_detection.fcl.Triangle, p1: int, p2: int, p3: int) -> None
- get(self: mplib.pymp.collision_detection.fcl.Triangle, arg0: int) int¶
- set(
- self: mplib.pymp.collision_detection.fcl.Triangle,
- arg0: int,
- arg1: int,
- arg2: int,
- class mplib.collision_detection.fcl.TriangleP¶
Bases:
CollisionGeometryTriangleP collision geometry.
Inheriting from CollisionGeometry, this class specializes to a triangleP geometry.
- __init__(
- self: mplib.pymp.collision_detection.fcl.TriangleP,
- a: numpy.ndarray[numpy.float64[3, 1]],
- b: numpy.ndarray[numpy.float64[3, 1]],
- c: numpy.ndarray[numpy.float64[3, 1]],
Construct a set of triangles from vectors of point coordinates.
- Parameters:
a – vector of point
xcoordinatesb – vector of point
ycoordinatesc – vector of point
zcoordinates
- property a¶
- property aabb_center¶
- property aabb_radius¶
- property b¶
- property c¶
- compute_com( ) numpy.ndarray[numpy.float64[3, 1]]¶
- compute_local_aabb( ) None¶
- compute_moment_of_inertia( ) numpy.ndarray[numpy.float64[3, 3]]¶
-
) numpy.ndarray[numpy.float64[3, 3]]¶
- compute_volume( ) float¶
- property cost_density¶
- is_free(self: mplib.pymp.collision_detection.fcl.CollisionGeometry) bool¶
- is_occupied( ) bool¶
- is_uncertain( ) bool¶
- mplib.collision_detection.fcl.collide(*args, **kwargs)¶
Overloaded function.
collide(obj1: mplib.pymp.collision_detection.fcl.CollisionObject, obj2: mplib.pymp.collision_detection.fcl.CollisionObject, request: mplib.pymp.collision_detection.fcl.CollisionRequest = <mplib.pymp.collision_detection.fcl.CollisionRequest object at 0x7f5817365070>) -> mplib.pymp.collision_detection.fcl.CollisionResult
collide(obj1: mplib.pymp.collision_detection.fcl.FCLObject, obj2: mplib.pymp.collision_detection.fcl.FCLObject, request: mplib.pymp.collision_detection.fcl.CollisionRequest = <mplib.pymp.collision_detection.fcl.CollisionRequest object at 0x7f58173573f0>) -> mplib.pymp.collision_detection.fcl.CollisionResult
- mplib.collision_detection.fcl.distance(*args, **kwargs)¶
Overloaded function.
distance(obj1: mplib.pymp.collision_detection.fcl.CollisionObject, obj2: mplib.pymp.collision_detection.fcl.CollisionObject, request: mplib.pymp.collision_detection.fcl.DistanceRequest = <mplib.pymp.collision_detection.fcl.DistanceRequest object at 0x7f5817365270>) -> mplib.pymp.collision_detection.fcl.DistanceResult
distance(obj1: mplib.pymp.collision_detection.fcl.FCLObject, obj2: mplib.pymp.collision_detection.fcl.FCLObject, request: mplib.pymp.collision_detection.fcl.DistanceRequest = <mplib.pymp.collision_detection.fcl.DistanceRequest object at 0x7f58173670f0>) -> mplib.pymp.collision_detection.fcl.DistanceResult
- mplib.collision_detection.fcl.load_mesh_as_BVH(
- mesh_path: str,
- scale: numpy.ndarray[numpy.float64[3, 1]],
Load a triangle mesh from mesh_path as a non-convex collision object.
- Parameters:
mesh_path – path to the mesh
scale – mesh scale factor
- Returns:
a shared_ptr to an fcl::BVHModel_OBBRSS<S> collision object
- mplib.collision_detection.fcl.load_mesh_as_Convex(
- mesh_path: str,
- scale: numpy.ndarray[numpy.float64[3, 1]],
Load a convex mesh from mesh_path.
- Parameters:
mesh_path – path to the mesh
scale – mesh scale factor
- Returns:
a shared_ptr to an fcl::Convex<S> collision object
- Raises:
RuntimeError – if the mesh is not convex.