Robot Arm Potential Field Navigation

A path planner for n-link planar robot arm moving among polygonal obstacles (or point obstacles). Set parameter to see prebuilt examples.
Updated 27 Sep 2021

View License

A path planner for an n-link planar robot arm moving among polygonal obstacles (or point obstacles).
Video overview at The video uses workspace potential fields that attract the origins of the DH frames to their goal locations while avoiding obstacles. The robot is blue, the goal configuration is green. The attractive forces to the goal are drawn with green arrows. The obstacles (red) are point lasers which the robot must avoid. When the robot is within the avoidance region (pink) of an obstacle it experiences repulsive forces (blue arrows). The shortest distance from each obstacle to each link is drawn in magenta.
Simply set the input parameter "choice" to run preset demos, or modify the demos for your needs:
if choice == 2, "two-link robot that gets stuck in a local minimum and must do a random walk to escape"
elseif choice == 3, "This local minimum is very deep, requiring a LONG random walk to escape. It doesn't always escape (SOMETIMES IT IS STUCK FOREVER)."
elseif choice == 4, "polygonal obstacles, does hit a local minimum, but usually escapes quickly"
elseif choice == 5, " 4-link robot, polygonal obstacles, has 'chatter' that makes it take time to settle"
Based off chapter 5.2 in "Robot Modeling and Control" by Spong, Hutchinson, and Vidyasagar
Aaron T. Becker, 04-13-2016 -- 11/14/2019, This solution uses code by Mary Burbage, MS 2017.

Cite As

Aaron T. Becker's Robot Swarm Lab (2024). Robot Arm Potential Field Navigation (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

formatted and clarified the description


added screen shot