lateralControllerStanley
Compute steering angle command for path following by using Stanley method
Syntax
Description
computes the steering angle command, in degrees, that adjusts the current pose of a vehicle
to match a reference pose, given the current velocity of the vehicle. By default, the
function assumes that the vehicle is in forward motion.steerCmd
= lateralControllerStanley(refPose
,currPose
,currVelocity
)
The controller computes the steering angle command using the Stanley method [1], whose control law is based on a kinematic bicycle model. Use this controller for path following in low-speed environments, where inertial effects are minimal.
specifies options using one or more name-value pairs. For example,
steerCmd
= lateralControllerStanley(refPose
,currPose
,currVelocity
,Name,Value
)lateralControllerStanley(refPose,currPose,currVelocity,'Direction',-1)
computes the steering angle command for a vehicle in reverse motion.
Examples
Input Arguments
Output Arguments
Algorithms
To compute the steering angle command, the controller minimizes the position error and the angle error of the current pose with respect to the reference pose. The driving direction of the vehicle determines these error values.
When the vehicle is in forward motion ('Direction'
name-value pair is
1
):
The position error is the lateral distance from the center of the front axle to the reference point on the path.
The angle error is the angle of the front wheel with respect to reference path.
When the vehicle is in reverse motion ('Direction'
name-value pair is
-1
):
The position error is the lateral distance from the center of the rear axle to the reference point on the path.
The angle error is the angle of the rear wheel with respect to reference path.
For details on how the controller minimizes these errors, see [1].
References
[1] Hoffmann, Gabriel M., Claire J. Tomlin, Michael Montemerlo, and Sebastian Thrun. "Autonomous Automobile Trajectory Tracking for Off-Road Driving: Controller Design, Experimental Validation and Racing." American Control Conference. 2007, pp. 2296–2301. doi:10.1109/ACC.2007.4282788
Extended Capabilities
Version History
Introduced in R2018b