MPlib\n\nMPlib is a lightweight python package for motion planning, which is decoupled from ROS and is easy to set up. With a few lines of python code, one can achieve most of the motion planning functionalities in robot manipulation.
\n\nInstallation
\n\nPre-built pip packages support Ubuntu 18.04+ with Python 3.6+.
\n\npip install mplib\n
\n\nUsage
\n\nSee our tutorial for detailed usage and examples.
\n"}, {"fullname": "mplib.examples", "modulename": "mplib.examples", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.collision_avoidance", "modulename": "mplib.examples.collision_avoidance", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo", "kind": "class", "doc": "The shows the planner's ability to generate a collision free path with the straight path causes collisions
\n", "bases": "mplib.examples.demo_setup.DemoSetup"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo.__init__", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo.__init__", "kind": "function", "doc": "Same setup as demo.py except the boxes are of difference sizes and different use\nRed box is the target we want to grab\nBlue box is the obstacle we want to avoid\ngreen box is the landing pad on which we want to place the red box
\n", "signature": "()"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo.table", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo.table", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo.red_cube", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo.red_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo.green_cube", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo.green_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo.blue_cube", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo.blue_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo.add_point_cloud", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo.add_point_cloud", "kind": "function", "doc": "we tell the planner about the obstacle through a point cloud
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.collision_avoidance.PlanningDemo.demo", "modulename": "mplib.examples.collision_avoidance", "qualname": "PlanningDemo.demo", "kind": "function", "doc": "We pick up the red box while avoiding the blue box and place it back down on top of the green box
\n", "signature": "(self, with_screw=True, use_point_cloud=True, use_attach=True):", "funcdef": "def"}, {"fullname": "mplib.examples.constrained_planning", "modulename": "mplib.examples.constrained_planning", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.constrained_planning.ConstrainedPlanningDemo", "modulename": "mplib.examples.constrained_planning", "qualname": "ConstrainedPlanningDemo", "kind": "class", "doc": "This demo shows the planner's ability to plan with constraints.\nFor this particular demo, we move to several poses while pointing the end effector roughly 15 degrees w.r.t. -z axis
\n", "bases": "mplib.examples.demo_setup.DemoSetup"}, {"fullname": "mplib.examples.constrained_planning.ConstrainedPlanningDemo.__init__", "modulename": "mplib.examples.constrained_planning", "qualname": "ConstrainedPlanningDemo.__init__", "kind": "function", "doc": "set up the scene and load the robot
\n", "signature": "()"}, {"fullname": "mplib.examples.constrained_planning.ConstrainedPlanningDemo.add_point_cloud", "modulename": "mplib.examples.constrained_planning", "qualname": "ConstrainedPlanningDemo.add_point_cloud", "kind": "function", "doc": "add some random obstacles to make the planning more challenging
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.constrained_planning.ConstrainedPlanningDemo.get_eef_z", "modulename": "mplib.examples.constrained_planning", "qualname": "ConstrainedPlanningDemo.get_eef_z", "kind": "function", "doc": "helper function for constraint
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.constrained_planning.ConstrainedPlanningDemo.make_f", "modulename": "mplib.examples.constrained_planning", "qualname": "ConstrainedPlanningDemo.make_f", "kind": "function", "doc": "create a constraint function that takes in a qpos and outputs a scalar\nA valid constraint function should evaluates to 0 when the constraint is satisfied\nSee ompl constrained planning for more details
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.constrained_planning.ConstrainedPlanningDemo.make_j", "modulename": "mplib.examples.constrained_planning", "qualname": "ConstrainedPlanningDemo.make_j", "kind": "function", "doc": "create the jacobian of the constraint function w.r.t. qpos\nThis is needed because the planner uses the jacobian to project a random sample to the constraint manifold
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.constrained_planning.ConstrainedPlanningDemo.demo", "modulename": "mplib.examples.constrained_planning", "qualname": "ConstrainedPlanningDemo.demo", "kind": "function", "doc": "We first plan with constraints to three poses, then plan without constraints to the same poses\nWhile not always the case, sometimes without constraints, the end effector will tilt almost upside down
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.demo", "modulename": "mplib.examples.demo", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.demo.PlanningDemo", "modulename": "mplib.examples.demo", "qualname": "PlanningDemo", "kind": "class", "doc": "This is the most basic demo of the motion planning library where the robot tries to shuffle three boxes around
\n", "bases": "mplib.examples.demo_setup.DemoSetup"}, {"fullname": "mplib.examples.demo.PlanningDemo.__init__", "modulename": "mplib.examples.demo", "qualname": "PlanningDemo.__init__", "kind": "function", "doc": "Setting up the scene, the planner, and adding some objects to the scene\nAfterwards, put down a table and three boxes. For details on how to do this, see the sapien documentation
\n", "signature": "()"}, {"fullname": "mplib.examples.demo.PlanningDemo.table", "modulename": "mplib.examples.demo", "qualname": "PlanningDemo.table", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.demo.PlanningDemo.red_cube", "modulename": "mplib.examples.demo", "qualname": "PlanningDemo.red_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.demo.PlanningDemo.green_cube", "modulename": "mplib.examples.demo", "qualname": "PlanningDemo.green_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.demo.PlanningDemo.blue_cube", "modulename": "mplib.examples.demo", "qualname": "PlanningDemo.blue_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.demo.PlanningDemo.demo", "modulename": "mplib.examples.demo", "qualname": "PlanningDemo.demo", "kind": "function", "doc": "Declare three poses for the robot to move to, each one corresponding to the position of a box\nPick up the box, and set it down 0.1m to the right of its original position
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup", "modulename": "mplib.examples.demo_setup", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.demo_setup.DemoSetup", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup", "kind": "class", "doc": "This class is the super class to abstract away some of the setups for the demos\nYou will need to install Sapien via pip install sapien
for this to work if you want to use the viewer
\n"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.__init__", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.__init__", "kind": "function", "doc": "Nothing to do
\n", "signature": "()"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.setup_scene", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.setup_scene", "kind": "function", "doc": "This is the Sapien simulator setup and has nothing to do with mplib
\n", "signature": "(self, **kwargs):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.load_robot", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.load_robot", "kind": "function", "doc": "This function loads a robot from a URDF file into the Sapien Scene created above.\nNote that does mean that setup_scene() must be called before this function.
\n", "signature": "(self, **kwargs):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.setup_planner", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.setup_planner", "kind": "function", "doc": "Create an mplib planner using the default robot\nsee planner.py for more details on the arguments
\n", "signature": "(self, **kwargs):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.follow_path", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.follow_path", "kind": "function", "doc": "Helper function to follow a path generated by the planner
\n", "signature": "(self, result):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.set_gripper", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.set_gripper", "kind": "function", "doc": "Helper function to activate gripper joints\nArgs:\n pos: position of the gripper joint in real number
\n", "signature": "(self, pos):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.open_gripper", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.open_gripper", "kind": "function", "doc": "\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.close_gripper", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.close_gripper", "kind": "function", "doc": "\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.move_to_pose_with_RRTConnect", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.move_to_pose_with_RRTConnect", "kind": "function", "doc": "Plan and follow a path to a pose using RRTConnect
\n\nArgs:\n pose: [x, y, z, qx, qy, qz, qw]\n use_point_cloud (optional): if to take the point cloud into consideration for collision checking.\n use_attach (optional): if to take the attach into consideration for collision checking.
\n", "signature": "(self, pose, use_point_cloud=False, use_attach=False):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.move_to_pose_with_screw", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.move_to_pose_with_screw", "kind": "function", "doc": "Interpolative planning with screw motion.\nWill not avoid collision and will fail if the path contains collision.
\n", "signature": "(self, pose, use_point_cloud=False, use_attach=False):", "funcdef": "def"}, {"fullname": "mplib.examples.demo_setup.DemoSetup.move_to_pose", "modulename": "mplib.examples.demo_setup", "qualname": "DemoSetup.move_to_pose", "kind": "function", "doc": "API to multiplex between the two planning methods
\n", "signature": "(self, pose, with_screw=True, use_point_cloud=False, use_attach=False):", "funcdef": "def"}, {"fullname": "mplib.examples.detect_collision", "modulename": "mplib.examples.detect_collision", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.detect_collision.DetectCollisionDemo", "modulename": "mplib.examples.detect_collision", "qualname": "DetectCollisionDemo", "kind": "class", "doc": "This demonstrates some of the collision detection functions in the planner.
\n", "bases": "mplib.examples.demo_setup.DemoSetup"}, {"fullname": "mplib.examples.detect_collision.DetectCollisionDemo.__init__", "modulename": "mplib.examples.detect_collision", "qualname": "DetectCollisionDemo.__init__", "kind": "function", "doc": "Only the planner is needed this time. No simulation env required
\n", "signature": "()"}, {"fullname": "mplib.examples.detect_collision.DetectCollisionDemo.print_collisions", "modulename": "mplib.examples.detect_collision", "qualname": "DetectCollisionDemo.print_collisions", "kind": "function", "doc": "Helper function to abstract away the printing of collisions
\n", "signature": "(self, collisions):", "funcdef": "def"}, {"fullname": "mplib.examples.detect_collision.DetectCollisionDemo.demo", "modulename": "mplib.examples.detect_collision", "qualname": "DetectCollisionDemo.demo", "kind": "function", "doc": "We test several configurations:
\n\n\n- Set robot to a self-collision-free qpos and check for self-collision returns no collision
\n- Set robot to a self-collision qpos and check for self-collision returns a collision
\n- Set robot to a env-collision-free qpos and check for env-collision returns no collision
\n- Set robot to a env-collision qpos and check for env-collision returns a collision
\n- Attempts to plan a path to a qpos is in collision with the world. This will cause the planner to timeout
\n- Remove the floor and check for env-collision returns no collision
\n
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.moving_robot", "modulename": "mplib.examples.moving_robot", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.moving_robot.PlanningDemo", "modulename": "mplib.examples.moving_robot", "qualname": "PlanningDemo", "kind": "class", "doc": "This is identical to demo.py except the whole scene is shifted to the bottom right by 1 meter respectively
\n", "bases": "mplib.examples.demo_setup.DemoSetup"}, {"fullname": "mplib.examples.moving_robot.PlanningDemo.__init__", "modulename": "mplib.examples.moving_robot", "qualname": "PlanningDemo.__init__", "kind": "function", "doc": "Setting up the scene, the planner, and adding some objects to the scene\nNote that we place the robot at [1,1,0] in the simulation and also tell the planner that the robot is at [1,1,0]\nAfterwards, put down a table and three boxes. For details on how to do this, see the sapien documentation\nCompared to demo.py, all the props are shifted by 1 meter in the x and y direction
\n", "signature": "()"}, {"fullname": "mplib.examples.moving_robot.PlanningDemo.table", "modulename": "mplib.examples.moving_robot", "qualname": "PlanningDemo.table", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.moving_robot.PlanningDemo.red_cube", "modulename": "mplib.examples.moving_robot", "qualname": "PlanningDemo.red_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.moving_robot.PlanningDemo.green_cube", "modulename": "mplib.examples.moving_robot", "qualname": "PlanningDemo.green_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.moving_robot.PlanningDemo.blue_cube", "modulename": "mplib.examples.moving_robot", "qualname": "PlanningDemo.blue_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.moving_robot.PlanningDemo.demo", "modulename": "mplib.examples.moving_robot", "qualname": "PlanningDemo.demo", "kind": "function", "doc": "Same demo as demo.py.\nAlthough we shifted everything, the poses have not changed because these are w.r.t. the robot base\nAlternatively, we can also shift the poses by 1 meter in the x and y direction and tell the planner\nthe poses are specified with respect to the world
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.two_stage_motion", "modulename": "mplib.examples.two_stage_motion", "kind": "module", "doc": "\n"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo", "kind": "class", "doc": "This demo is the same as collision_avoidance.py except we added a track for the robot to move along\nWe reach the target in two stages:
\n\n\n- First, we move the base while fixing the arm joints
\n- Then, we move the arm while fixing the base joints\nThis corresponds to a mobile robot which can move in the x and y direction with a manipulator on top
\n
\n", "bases": "mplib.examples.demo_setup.DemoSetup"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.__init__", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.__init__", "kind": "function", "doc": "We have modified the urdf file to include a track for the robot to move along\nOtherwise, the setup is the same as collision_avoidance.py
\n", "signature": "()"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.table", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.table", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.red_cube", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.red_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.green_cube", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.green_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.blue_cube", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.blue_cube", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.add_point_cloud", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.add_point_cloud", "kind": "function", "doc": "see collision_avoidance.py for details
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.plan_without_base", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.plan_without_base", "kind": "function", "doc": "a subroutine to plan a path without moving the base
\n", "signature": "(self, pose, has_attach=False):", "funcdef": "def"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.move_in_two_stage", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.move_in_two_stage", "kind": "function", "doc": "first, we do a full IK but only generate motions for the base\nthen, do another partial IK for the arm and generate motions for the arm
\n", "signature": "(self, pose, has_attach=False):", "funcdef": "def"}, {"fullname": "mplib.examples.two_stage_motion.PlanningDemo.demo", "modulename": "mplib.examples.two_stage_motion", "qualname": "PlanningDemo.demo", "kind": "function", "doc": "We reach the pick up and drop off poses in two stages, first by moving the base only and then the arm only
\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "mplib.planner", "modulename": "mplib.planner", "kind": "module", "doc": "\n"}, {"fullname": "mplib.planner.Planner", "modulename": "mplib.planner", "qualname": "Planner", "kind": "class", "doc": "Motion planner.
\n"}, {"fullname": "mplib.planner.Planner.__init__", "modulename": "mplib.planner", "qualname": "Planner.__init__", "kind": "function", "doc": "Motion planner for robots.
\n\nArgs:\n urdf: Unified Robot Description Format file.\n user_link_names: names of links, the order. if empty, all links will be used.\n user_joint_names: names of the joints to plan. if empty, all active joints will be used.\n move_group: target link to move, usually the end-effector.\n joint_vel_limits: maximum joint velocities for time parameterization,\n which should have the same length as\n joint_acc_limits: maximum joint accelerations for time parameterization,\n which should have the same length as\n srdf: Semantic Robot Description Format file.\nReferences:\n http://docs.ros.org/en/kinetic/api/moveit_tutorials/html/doc/urdf_srdf/urdf_srdf_tutorial.html
\n", "signature": "(\turdf: str,\tmove_group: str,\tsrdf: str = '',\tpackage_keyword_replacement: str = '',\tuser_link_names: Sequence[str] = [],\tuser_joint_names: Sequence[str] = [],\tjoint_vel_limits: Union[Sequence[float], numpy.ndarray] = [],\tjoint_acc_limits: Union[Sequence[float], numpy.ndarray] = [],\t**kwargs)"}, {"fullname": "mplib.planner.Planner.urdf", "modulename": "mplib.planner", "qualname": "Planner.urdf", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.robot", "modulename": "mplib.planner", "qualname": "Planner.robot", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.pinocchio_model", "modulename": "mplib.planner", "qualname": "Planner.pinocchio_model", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.planning_world", "modulename": "mplib.planner", "qualname": "Planner.planning_world", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.user_link_names", "modulename": "mplib.planner", "qualname": "Planner.user_link_names", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.user_joint_names", "modulename": "mplib.planner", "qualname": "Planner.user_joint_names", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.joint_name_2_idx", "modulename": "mplib.planner", "qualname": "Planner.joint_name_2_idx", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.link_name_2_idx", "modulename": "mplib.planner", "qualname": "Planner.link_name_2_idx", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.move_group", "modulename": "mplib.planner", "qualname": "Planner.move_group", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.move_group_joint_indices", "modulename": "mplib.planner", "qualname": "Planner.move_group_joint_indices", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.joint_types", "modulename": "mplib.planner", "qualname": "Planner.joint_types", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.joint_limits", "modulename": "mplib.planner", "qualname": "Planner.joint_limits", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.joint_vel_limits", "modulename": "mplib.planner", "qualname": "Planner.joint_vel_limits", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.joint_acc_limits", "modulename": "mplib.planner", "qualname": "Planner.joint_acc_limits", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.move_group_link_id", "modulename": "mplib.planner", "qualname": "Planner.move_group_link_id", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.planner", "modulename": "mplib.planner", "qualname": "Planner.planner", "kind": "variable", "doc": "\n"}, {"fullname": "mplib.planner.Planner.replace_package_keyword", "modulename": "mplib.planner", "qualname": "Planner.replace_package_keyword", "kind": "function", "doc": "some ROS URDF files use package:// keyword to refer the package dir\nreplace it with the given string (default is empty)
\n\nArgs:\n package_keyword_replacement: the string to replace 'package://' keyword
\n", "signature": "(self, package_keyword_replacement):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.generate_collision_pair", "modulename": "mplib.planner", "qualname": "Planner.generate_collision_pair", "kind": "function", "doc": "we read the srdf file to get the link pairs that should not collide.\nif not provided, we need to randomly sample configurations to find the link pairs that will always collide.
\n", "signature": "(self, sample_time=1000000, echo_freq=100000):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.distance_6D", "modulename": "mplib.planner", "qualname": "Planner.distance_6D", "kind": "function", "doc": "compute the distance between two poses
\n\nArgs:\n p1: position of pose 1\n q1: quaternion of pose 1\n p2: position of pose 2\n q2: quaternion of pose 2
\n", "signature": "(self, p1, q1, p2, q2):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.check_joint_limit", "modulename": "mplib.planner", "qualname": "Planner.check_joint_limit", "kind": "function", "doc": "check if the joint configuration is within the joint limits
\n\nArgs:\n q: joint configuration
\n\nReturns:\n True if the joint configuration is within the joint limits
\n", "signature": "(self, q):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.pad_qpos", "modulename": "mplib.planner", "qualname": "Planner.pad_qpos", "kind": "function", "doc": "if the user does not provide the full qpos but only the move_group joints,\npad the qpos with the rest of the joints
\n", "signature": "(self, qpos, articulation=None):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.check_for_collision", "modulename": "mplib.planner", "qualname": "Planner.check_for_collision", "kind": "function", "doc": "helper function to check for collision
\n", "signature": "(\tself,\tcollision_function,\tarticulation: mplib.pymp.articulation.ArticulatedModel = None,\tqpos: numpy.ndarray = None) -> list:", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.check_for_self_collision", "modulename": "mplib.planner", "qualname": "Planner.check_for_self_collision", "kind": "function", "doc": "Check if the robot is in self-collision.
\n\nArgs:\n articulation: robot model. if none will be self.robot\n qpos: robot configuration. if none will be the current pose
\n\nReturns:\n A list of collisions.
\n", "signature": "(\tself,\tarticulation: mplib.pymp.articulation.ArticulatedModel = None,\tqpos: numpy.ndarray = None) -> list:", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.check_for_env_collision", "modulename": "mplib.planner", "qualname": "Planner.check_for_env_collision", "kind": "function", "doc": "Check if the robot is in collision with the environment
\n\nArgs:\n articulation: robot model. if none will be self.robot\n qpos: robot configuration. if none will be the current pose\n with_point_cloud: whether to check collision against point cloud\n use_attach: whether to include the object attached to the end effector in collision checking\nReturns:\n A list of collisions.
\n", "signature": "(\tself,\tarticulation: mplib.pymp.articulation.ArticulatedModel = None,\tqpos: numpy.ndarray = None,\twith_point_cloud=False,\tuse_attach=False) -> list:", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.IK", "modulename": "mplib.planner", "qualname": "Planner.IK", "kind": "function", "doc": "Inverse kinematics
\n\nArgs:\n goal_pose: [x,y,z,qw,qx,qy,qz] pose of the goal\n start_qpos: initial configuration\n mask: if the value at a given index is True, the joint is not used in the IK\n n_init_qpos: number of random initial configurations\n threshold: threshold for the distance between the goal pose and the result pose
\n", "signature": "(\tself,\tgoal_pose,\tstart_qpos,\tmask=[],\tn_init_qpos=20,\tthreshold=0.001):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.TOPP", "modulename": "mplib.planner", "qualname": "Planner.TOPP", "kind": "function", "doc": "Time-Optimal Path Parameterization
\n\nArgs:\n path: numpy array of shape (n, dof)\n step: step size for the discretization\n verbose: if True, will print the log of TOPPRA
\n", "signature": "(self, path, step=0.1, verbose=False):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.update_point_cloud", "modulename": "mplib.planner", "qualname": "Planner.update_point_cloud", "kind": "function", "doc": "Args:\n pc: numpy array of shape (n, 3)\n radius: radius of each point. This gives a buffer around each point that planner will avoid
\n", "signature": "(self, pc, radius=0.001):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.update_attached_tool", "modulename": "mplib.planner", "qualname": "Planner.update_attached_tool", "kind": "function", "doc": "helper function to update the attached tool
\n", "signature": "(self, fcl_collision_geometry, pose, link_id=-1):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.update_attached_sphere", "modulename": "mplib.planner", "qualname": "Planner.update_attached_sphere", "kind": "function", "doc": "attach a sphere to some link
\n\nArgs:\n radius: radius of the sphere\n pose: [x,y,z,qw,qx,qy,qz] pose of the sphere\n link_id: if not provided, the end effector will be the target.
\n", "signature": "(self, radius, pose, link_id=-1):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.update_attached_box", "modulename": "mplib.planner", "qualname": "Planner.update_attached_box", "kind": "function", "doc": "attach a box to some link
\n\nArgs:\n size: [x,y,z] size of the box\n pose: [x,y,z,qw,qx,qy,qz] pose of the box\n link_id: if not provided, the end effector will be the target.
\n", "signature": "(self, size, pose, link_id=-1):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.update_attached_mesh", "modulename": "mplib.planner", "qualname": "Planner.update_attached_mesh", "kind": "function", "doc": "attach a mesh to some link
\n\nArgs:\n mesh_path: path to the mesh\n pose: [x,y,z,qw,qx,qy,qz] pose of the mesh\n link_id: if not provided, the end effector will be the target.
\n", "signature": "(self, mesh_path, pose, link_id=-1):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.set_base_pose", "modulename": "mplib.planner", "qualname": "Planner.set_base_pose", "kind": "function", "doc": "tell the planner where the base of the robot is w.r.t the world frame
\n\nArgs:\n pose: [x,y,z,qw,qx,qy,qz] pose of the base
\n", "signature": "(self, pose):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.set_normal_object", "modulename": "mplib.planner", "qualname": "Planner.set_normal_object", "kind": "function", "doc": "adds or updates a non-articulated collision object in the scene
\n", "signature": "(self, name, collision_object):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.remove_normal_object", "modulename": "mplib.planner", "qualname": "Planner.remove_normal_object", "kind": "function", "doc": "returns true if the object was removed, false if it was not found
\n", "signature": "(self, name):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.plan_qpos_to_qpos", "modulename": "mplib.planner", "qualname": "Planner.plan_qpos_to_qpos", "kind": "function", "doc": "plan a path from a specified joint position to a goal pose
\n\nArgs:\n goal_pose: 7D pose of the end-effector [x,y,z,qw,qx,qy,qz]\n current_qpos: current joint configuration (either full or move_group joints)\n mask: mask for IK. When set, the IK will leave certain joints out of planning\n time_step: time step for TOPP\n rrt_range: step size for RRT\n planning_time: time limit for RRT\n fix_joint_limits: if True, will clip the joint configuration to be within the joint limits\n use_point_cloud: if True, will use the point cloud to avoid collision\n use_attach: if True, will consider the attached tool collision when planning\n verbose: if True, will print the log of OMPL and TOPPRA\n planner_name: planner name pick from {\"RRTConnect\", \"RRT*\"}\n fixed_joint_indices: list of indices of joints that are fixed during planning\n constraint_function: evals to 0 when constraint is satisfied\n constraint_jacobian: jacobian of constraint_function\n constraint_tolerance: tolerance for constraint_function\n no_simplification: if true, will not simplify the path. constraint planning does not support simplification
\n", "signature": "(\tself,\tgoal_qposes: list,\tcurrent_qpos,\ttime_step=0.1,\trrt_range=0.1,\tplanning_time=1,\tfix_joint_limits=True,\tuse_point_cloud=False,\tuse_attach=False,\tverbose=False,\tplanner_name='RRTConnect',\tno_simplification=False,\tconstraint_function=None,\tconstraint_jacobian=None,\tconstraint_tolerance=0.001,\tfixed_joint_indices=[]):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.plan_qpos_to_pose", "modulename": "mplib.planner", "qualname": "Planner.plan_qpos_to_pose", "kind": "function", "doc": "plan from a start configuration to a goal pose of the end-effector
\n\nArgs:\n goal_pose: [x,y,z,qw,qx,qy,qz] pose of the goal\n current_qpos: current joint configuration (either full or move_group joints)\n mask: if the value at a given index is True, the joint is not used in the IK\n time_step: time step for TOPPRA (time parameterization of path)\n rrt_range: step size for RRT\n planning_time: time limit for RRT\n fix_joint_limits: if True, will clip the joint configuration to be within the joint limits\n use_point_cloud: if True, will use the point cloud to avoid collision\n use_attach: if True, will consider the attached tool collision when planning\n verbose: if True, will print the log of OMPL and TOPPRA\n wrt_world: if true, interpret the target pose with respect to the world frame instead of the base frame
\n", "signature": "(\tself,\tgoal_pose,\tcurrent_qpos,\tmask=[],\ttime_step=0.1,\trrt_range=0.1,\tplanning_time=1,\tfix_joint_limits=True,\tuse_point_cloud=False,\tuse_attach=False,\tverbose=False,\twrt_world=False,\tplanner_name='RRTConnect',\tno_simplification=False,\tconstraint_function=None,\tconstraint_jacobian=None,\tconstraint_tolerance=0.001):", "funcdef": "def"}, {"fullname": "mplib.planner.Planner.plan_screw", "modulename": "mplib.planner", "qualname": "Planner.plan_screw", "kind": "function", "doc": "plan from a start configuration to a goal pose of the end-effector using screw motion
\n\nArgs:\n target_pose: [x,y,z,qw,qx,qy,qz] pose of the goal\n qpos: current joint configuration (either full or move_group joints)\n qpos_step: size of the random step for RRT\n time_step: time step for the discretization\n use_point_cloud: if True, will use the point cloud to avoid collision\n use_attach: if True, will use the attached tool to avoid collision\n verbose: if True, will print the log of TOPPRA
\n", "signature": "(\tself,\ttarget_pose,\tqpos,\tqpos_step=0.1,\ttime_step=0.1,\tuse_point_cloud=False,\tuse_attach=False,\tverbose=False):", "funcdef": "def"}, {"fullname": "mplib.pymp", "modulename": "mplib.pymp", "kind": "module", "doc": "Motion planning python binding. To see its documentation, please see the stub files in your IDE.
\n"}];
+
+ // mirrored in build-search-index.js (part 1)
+ // Also split on html tags. this is a cheap heuristic, but good enough.
+ elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/);
+
+ let searchIndex;
+ if (docs._isPrebuiltIndex) {
+ console.info("using precompiled search index");
+ searchIndex = elasticlunr.Index.load(docs);
+ } else {
+ console.time("building search index");
+ // mirrored in build-search-index.js (part 2)
+ searchIndex = elasticlunr(function () {
+ this.pipeline.remove(elasticlunr.stemmer);
+ this.pipeline.remove(elasticlunr.stopWordFilter);
+ this.addField("qualname");
+ this.addField("fullname");
+ this.addField("annotation");
+ this.addField("default_value");
+ this.addField("signature");
+ this.addField("bases");
+ this.addField("doc");
+ this.setRef("fullname");
+ });
+ for (let doc of docs) {
+ searchIndex.addDoc(doc);
+ }
+ console.timeEnd("building search index");
+ }
+
+ return (term) => searchIndex.search(term, {
+ fields: {
+ qualname: {boost: 4},
+ fullname: {boost: 2},
+ annotation: {boost: 2},
+ default_value: {boost: 2},
+ signature: {boost: 2},
+ bases: {boost: 2},
+ doc: {boost: 1},
+ },
+ expand: true
+ });
+})();
\ No newline at end of file
diff --git a/mplib/README.md b/mplib/README.md
new file mode 120000
index 0000000..32d46ee
--- /dev/null
+++ b/mplib/README.md
@@ -0,0 +1 @@
+../README.md
\ No newline at end of file
diff --git a/mplib/__init__.py b/mplib/__init__.py
index 1c3f8f4..477ef55 100644
--- a/mplib/__init__.py
+++ b/mplib/__init__.py
@@ -1,2 +1,5 @@
-from .planner import Planner
+"""
+.. include:: ./README.md
+"""
+from mplib.planner import Planner
diff --git a/examples/__init__.py b/mplib/examples/__init__.py
similarity index 100%
rename from examples/__init__.py
rename to mplib/examples/__init__.py
diff --git a/examples/collision_avoidance.py b/mplib/examples/collision_avoidance.py
similarity index 99%
rename from examples/collision_avoidance.py
rename to mplib/examples/collision_avoidance.py
index e851464..f49382d 100644
--- a/examples/collision_avoidance.py
+++ b/mplib/examples/collision_avoidance.py
@@ -1,5 +1,5 @@
import sapien.core as sapien
-from demo_setup import DemoSetup
+from .demo_setup import DemoSetup
class PlanningDemo(DemoSetup):
""" The shows the planner's ability to generate a collision free path with the straight path causes collisions """
diff --git a/examples/constrained_planning.py b/mplib/examples/constrained_planning.py
similarity index 99%
rename from examples/constrained_planning.py
rename to mplib/examples/constrained_planning.py
index bada5a6..33e967c 100644
--- a/examples/constrained_planning.py
+++ b/mplib/examples/constrained_planning.py
@@ -2,7 +2,7 @@
import numpy as np
import transforms3d
-from demo_setup import DemoSetup
+from .demo_setup import DemoSetup
class ConstrainedPlanningDemo(DemoSetup):
"""
diff --git a/examples/demo.py b/mplib/examples/demo.py
similarity index 98%
rename from examples/demo.py
rename to mplib/examples/demo.py
index 6ebbe2d..6f47c8c 100644
--- a/examples/demo.py
+++ b/mplib/examples/demo.py
@@ -1,5 +1,5 @@
import sapien.core as sapien
-from demo_setup import DemoSetup
+from .demo_setup import DemoSetup
class PlanningDemo(DemoSetup):
"""
diff --git a/examples/demo_setup.py b/mplib/examples/demo_setup.py
similarity index 100%
rename from examples/demo_setup.py
rename to mplib/examples/demo_setup.py
diff --git a/examples/detect_collision.py b/mplib/examples/detect_collision.py
similarity index 98%
rename from examples/detect_collision.py
rename to mplib/examples/detect_collision.py
index d1481f7..efcd75a 100644
--- a/examples/detect_collision.py
+++ b/mplib/examples/detect_collision.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
import mplib
-from demo_setup import DemoSetup
+from .demo_setup import DemoSetup
class DetectCollisionDemo(DemoSetup):
"""
diff --git a/examples/moving_robot.py b/mplib/examples/moving_robot.py
similarity index 99%
rename from examples/moving_robot.py
rename to mplib/examples/moving_robot.py
index dbd8036..cf354ff 100644
--- a/examples/moving_robot.py
+++ b/mplib/examples/moving_robot.py
@@ -1,5 +1,5 @@
import sapien.core as sapien
-from demo_setup import DemoSetup
+from .demo_setup import DemoSetup
class PlanningDemo(DemoSetup):
""" This is identical to demo.py except the whole scene is shifted to the bottom right by 1 meter respectively """
diff --git a/examples/two_stage_motion.py b/mplib/examples/two_stage_motion.py
similarity index 99%
rename from examples/two_stage_motion.py
rename to mplib/examples/two_stage_motion.py
index 5f279fe..ff70de4 100644
--- a/examples/two_stage_motion.py
+++ b/mplib/examples/two_stage_motion.py
@@ -1,7 +1,7 @@
import sapien.core as sapien
import mplib
import numpy as np
-from demo_setup import DemoSetup
+from .demo_setup import DemoSetup
class PlanningDemo(DemoSetup):
"""
diff --git a/setup.py b/setup.py
index e153277..bdcb67b 100644
--- a/setup.py
+++ b/setup.py
@@ -89,4 +89,6 @@ def build_extension(self, ext):
ext_modules=[CMakeExtension("mplib.pymp")],
cmdclass={"build_ext": CMakeBuild},
zip_safe=False,
+ package_data={"mplib": ["README.md"]},
+ include_package_data=True,
)