controllerPurePursuit
Create controller to follow set of waypoints
Description
The controllerPurePursuit
System object™ creates a controller object used to make a car-like or differential-drive
vehicle follow a set of waypoints. The object computes the linear velocity and curvature for
the vehicle given the current pose. Successive calls to the object with updated poses provide
updated velocity commands for the vehicle. Use the MaxCurvature and
DesiredLinearVelocity properties to update the curvature and velocity
based on the vehicle's performance.
The LookaheadDistance property computes a look-ahead point on the
path, which is a local goal for the vehicle. The curvature command is computed based on this
point. Changing LookaheadDistance has a significant impact on the
performance of the algorithm. A higher look-ahead distance results in a smoother trajectory
for the vehicle, but can cause the vehicle to cut corners along the path. A low look-ahead
distance can result in oscillations in tracking the path, causing unstable behavior. For more
information on the pure pursuit algorithm, see Pure Pursuit Controller.
To compute linear velocity and curvature control commands:
Create the
controllerPurePursuitobject and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Description
creates
a pure pursuit object that uses the pure pursuit algorithm to compute the linear
velocity and curvature inputs for a car-like or differential-drive vehicle.controller = controllerPurePursuit
creates a pure pursuit object with additional options specified by one or more
controller = controllerPurePursuit(Name,Value)Name,Value pairs. Name is the property name and Value is the
corresponding value. Name must appear inside single quotes (' '). You
can specify several name-value pair arguments in any order as
Name1,Value1,...,NameN,ValueN. Properties not specified retain
their default values.
Example: controller = controllerPurePursuit('DesiredLinearVelocity',
0.5)
Properties
Usage
Description
[ returns the look-ahead point, which is a
location on the path used to compute the velocity and curvature commands. The controller
object computes this location on the path using the vel,curvature,lookaheadpoint]
= controller(pose)LookaheadDistance
property.
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj, use
this syntax:
release(obj)
Examples
Extended Capabilities
Version History
Introduced in R2019bSee Also
binaryOccupancyMap (Robotics System Toolbox) | occupancyMap | binaryOccupancyMap | occupancyMap | controllerVFH
![Figure Pure Pursuit Waypoint Following With Velocity Commands contains 3 axes objects. Axes object 1 with title XY Pose (Trajectory), xlabel X [m], ylabel Y [m] contains 3 objects of type line. One or more of the lines displays its values using only markers These objects represent Waypoints, Vehicle Position, Trajectory. Axes object 2 with title Linear Velocity Command, xlabel Time [s], ylabel Linear Velocity [m/s] contains an object of type line. Axes object 3 with title Angular Velocity Command, xlabel Time [s], ylabel Angular Velocity [rad/s] contains an object of type line.](../../examples/nav_robotics/win64/FollowWaypointsUsingPurePursuitControllerExample_01.png)