Planning with Motion interface

The same Planner object that we introduced before is used for planning motions with the motion interface. For any motion type described in earlier sections, we can plan the motion by simply invoking the plan method.

planner = Planner(environment)
trajectory = planner.plan(motion)

The planner will return a trajectory that is optimized for the given motion type.

If we want to associate a motion with a planner, we can add it via:

planner.add_motion(grasp_to_place_motion)

Then, we can plan a motion given its name only and, in case the start or goal were not specified, the exact start and goal waypoints.

# In case the start and goal are known exactly
trajectory = planner.plan('grasp-to-place')

# In case the goal is a region
trajectory = planner.plan('home-to-bin', goal=goal)

Failure Cases

When planning with the motion interface, the plan method will throw an error if the planning problem is not well defined, namely if:

  • (Motion) The start, goal or an intermediate waypoint has a different number of degrees of freedom than the robot, is outside the robot’s limits, or is in collision with specified obstacles.

  • (Motion) An inverse kinematics solution cannot be found for the start, goal or any waypoint.

  • (Motion) More than 3 intermediate waypoints are provided (only up to 3 are supported).

  • (Motion) An inverse kinematics solution cannot be found for the linear retraction from the start point or for the linear approach to the goal point.

  • (Motion) The given start or goal configuration does not match the motion configuration. This might happen if start or goal are defined as regions in the motion, and then an exact point outside of this region is passed for planning.

  • (LinearMotion) No Cartesian trajectory can be found.

  • (LinearMotion) An inverse kinematics solution cannot be found for the linear section.

  • (PathFollowingMotion) Joint velocity limits are exceeded by a large factor, indicating a possible singularity.

  • (PathFollowingMotion) No trajectory can be found that adheres to the joint velocity limits.

To avoid planning failures, ensure that relevant conditions are met before calling the plan method.