AttachedBody#

class mplib.AttachedBody#

Bases: pybind11_object

Object defining bodies that can be attached to robot links. This is useful when handling objects picked up by the robot.

Mimicking MoveIt2’s moveit::core::AttachedBody

https://moveit.picknik.ai/main/api/html/classmoveit_1_1core_1_1AttachedBody.html

__init__(
self: mplib.pymp.AttachedBody,
name: str,
object: mplib.pymp.collision_detection.fcl.FCLObject,
attached_articulation: mplib.pymp.ArticulatedModel,
attached_link_id: int,
pose: mplib.pymp.Pose,
touch_links: list[str] = [],
) None#

Construct an attached body for a specified link.

Parameters:
  • name – name of the attached body

  • object – collision object of the attached body

  • attached_articulation – robot articulated model to attach to

  • attached_link_id – id of the articulation link to attach to

  • pose – attached pose (relative pose from attached link to object)

  • touch_links – the link names that the attached body touches

get_attached_articulation(
self: mplib.pymp.AttachedBody,
) mplib.pymp.ArticulatedModel#

Gets the articulation that this body is attached to

Gets the global pose of the articulation link that this body is attached to

Gets the articulation link id that this body is attached to

get_global_pose(self: mplib.pymp.AttachedBody) mplib.pymp.Pose#

Gets the global pose of the attached object

get_name(self: mplib.pymp.AttachedBody) str#

Gets the attached object name

get_object(
self: mplib.pymp.AttachedBody,
) mplib.pymp.collision_detection.fcl.FCLObject#

Gets the attached object (FCLObjectPtr)

get_pose(self: mplib.pymp.AttachedBody) mplib.pymp.Pose#

Gets the attached pose (relative pose from attached link to object)

Gets the link names that the attached body touches

property pose#

The attached pose (relative pose from attached link to object)

set_pose(self: mplib.pymp.AttachedBody, pose: mplib.pymp.Pose) None#

Sets the attached pose (relative pose from attached link to object)

Sets the link names that the attached body touches

update_pose(self: mplib.pymp.AttachedBody) None#

Updates the global pose of the attached object using current state