Intermediate

Motion Planning

Master path planning algorithms, kinematics, and obstacle avoidance to enable robots to navigate and manipulate objects in complex environments.

What is Motion Planning?

Motion planning is the problem of finding a sequence of valid configurations (positions and orientations) that move a robot from a start state to a goal state while avoiding obstacles. It is one of the most fundamental challenges in robotics, spanning both mobile robot navigation and robotic arm manipulation.

Planning Approaches

🗺

Grid-Based Search

A*, Dijkstra's, and D* algorithms search a discretized grid. Simple and complete but memory-intensive for high-dimensional spaces.

🌳

Sampling-Based

RRT, RRT*, and PRM randomly sample the configuration space. Effective for high-dimensional problems like robotic arm planning.

📈

Optimization-Based

CHOMP, TrajOpt, and MPC formulate planning as optimization problems. Produce smooth trajectories with cost minimization.

🧠

Learning-Based

Neural motion planners and reinforcement learning policies learn to plan from experience. Fast inference but require training data.

Mobile Robot Navigation with Nav2

# Launch Nav2 navigation stack
ros2 launch nav2_bringup navigation_launch.py \
    use_sim_time:=True \
    params_file:=/path/to/nav2_params.yaml

# Send a navigation goal programmatically
from geometry_msgs.msg import PoseStamped
from nav2_simple_commander.robot_navigator import BasicNavigator

navigator = BasicNavigator()
goal = PoseStamped()
goal.header.frame_id = 'map'
goal.pose.position.x = 3.0
goal.pose.position.y = 2.0
goal.pose.orientation.w = 1.0

navigator.goToPose(goal)
while not navigator.isTaskComplete():
    feedback = navigator.getFeedback()
    print(f'Distance remaining: {feedback.distance_remaining:.2f}m')

Robotic Arm Planning with MoveIt 2

MoveIt 2 is the standard motion planning framework for robotic manipulators in ROS 2. It provides:

  • Inverse kinematics (IK): Computing joint angles to reach a desired end-effector pose
  • Collision checking: Ensuring the robot doesn't collide with itself or the environment
  • Multiple planners: OMPL (RRT, PRM), STOMP, Pilz industrial planner
  • Grasp planning: Generating feasible grasp poses for pick-and-place tasks

Algorithm Comparison

AlgorithmTypeCompletenessBest For
A*Grid searchComplete & optimal2D mobile robot navigation
RRT*SamplingAsymptotically optimalHigh-dimensional arm planning
DWALocal plannerReactiveReal-time obstacle avoidance
MPCOptimizationReceding horizonDynamic environments, smooth control
TEBOptimizationLocal optimalTime-elastic band for mobile robots
Key takeaway: Motion planning is a layered problem. Use a global planner (A*, RRT*) for high-level path finding and a local planner (DWA, MPC) for real-time obstacle avoidance. For manipulation tasks, MoveIt 2 provides a complete solution out of the box.

Ready to Go Deeper?

Live instructor-led courses from our partners. Affiliate disclosure.