Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
Steering Class Reference
A class for managing steering angle calculations based on current and desired heading and specified intercept distance along the new path. More...
#include <Steering.h>
Public Member Functions | |
Steering (float wheelbase, float track) | |
create a new steering calculator | |
void | setIntercept (float intercept) |
set intercept distance | |
float | calcSA (float theta) |
convert course change to average steering angle assumes Ackerman steering, with track and wheelbase and course intercept distance specified. | |
float | calcSA (float theta, float limit) |
convert course change to average steering angle assumes Ackerman steering, with track and wheelbase and course intercept distance specified. | |
float | purePursuitSA (float hdg, float Bx, float By, float Ax, float Ay, float Bx, float By) |
compute steering angle based on pure pursuit algorithm | |
float | crossTrack (float Bx, float By, float Ax, float Ay, float Bx, float By) |
Compute cross track error given last waypoint, next waypoint, and robot coordinates. |
Detailed Description
A class for managing steering angle calculations based on current and desired heading and specified intercept distance along the new path.
See Notebook entry: http://mbed.org/users/shimniok/notebook/smooth-steering-for-rc-car/
Definition at line 9 of file Steering.h.
Constructor & Destructor Documentation
Steering | ( | float | wheelbase, |
float | track | ||
) |
create a new steering calculator
create a new steering calculator for a particular vehicle
- Parameters:
-
wheelbase vehicle wheelbase track vehicle track width intercept new course intercept distance
Definition at line 7 of file Steering.cpp.
Member Function Documentation
float calcSA | ( | float | theta ) |
convert course change to average steering angle assumes Ackerman steering, with track and wheelbase and course intercept distance specified.
Calculate a steering angle based on relative bearing.
See notebook: http://mbed.org/users/shimniok/notebook/smooth-steering-for-rc-car/
- Parameters:
-
theta relative bearing of the new course
- Returns:
- steering angle in degrees
Definition at line 22 of file Steering.cpp.
float calcSA | ( | float | theta, |
float | limit | ||
) |
convert course change to average steering angle assumes Ackerman steering, with track and wheelbase and course intercept distance specified.
calcSA minRadius -- radius limit (minRadius < 0 disables limiting)
Also, |radius| of turn is limited to limit
See notebook: http://mbed.org/users/shimniok/notebook/smooth-steering-for-rc-car/
- Parameters:
-
theta relative bearing of the new course limit is the limit of the turn circle radius (absolute value)
- Returns:
- steering angle in degrees
Definition at line 29 of file Steering.cpp.
float crossTrack | ( | float | Bx, |
float | By, | ||
float | Ax, | ||
float | Ay, | ||
float | Bx, | ||
float | By | ||
) |
Compute cross track error given last waypoint, next waypoint, and robot coordinates.
Bxy - robot coordinates Axy - previous waypoint coords Cxy - next waypoint coords.
- Returns:
- cross track error
Definition at line 70 of file Steering.cpp.
float purePursuitSA | ( | float | hdg, |
float | Bx, | ||
float | By, | ||
float | Ax, | ||
float | Ay, | ||
float | Bx, | ||
float | By | ||
) |
compute steering angle based on pure pursuit algorithm
Definition at line 100 of file Steering.cpp.
void setIntercept | ( | float | intercept ) |
set intercept distance
- Parameters:
-
intercept distance along new course at which turn arc will intercept
Definition at line 14 of file Steering.cpp.
Generated on Tue Jul 12 2022 14:09:28 by 1.7.2