|
Formula Student Autonomous Systems
The code for the main driverless system
|
Computes velocity profiles for a planned path based on curvature and dynamics constraints. More...
#include <velocity_planning.hpp>

Public Member Functions | |
| VelocityPlanning ()=default | |
| Construct a new default Velocity Planning object. | |
| VelocityPlanning (VelocityPlanningConfig config) | |
| Construct a new Velocity Planning object with a given configuration. | |
| void | set_velocity (std::vector< PathPoint > &final_path) |
| Assigns an velocity to each point of the path. | |
| void | trackdrive_velocity (std::vector< PathPoint > &final_path) |
| Computes velocity for trackdrive scenarios. | |
| void | stop (std::vector< PathPoint > &final_path, double braking_distance) |
| Applies a braking velocity profile starting after a given braking distance. | |
Private Member Functions | |
| double | find_curvature (const PathPoint &p1, const PathPoint &p2, const PathPoint &p3) |
| Computes the curvature at a point using the Menger curvature formula. | |
| void | point_speed (const std::vector< double > &curvatures, std::vector< double > &velocities) |
| Computes the maximum velocity at each point based on curvature constraints. | |
| void | acceleration_limiter (const std::vector< PathPoint > &points, std::vector< double > &velocities, const std::vector< double > &curvatures) |
| Limits velocities based on forward acceleration constraints and friction ellipse. | |
| void | braking_limiter (std::vector< PathPoint > &points, std::vector< double > &velocities, const std::vector< double > &curvatures) |
| Limits velocities based on backward braking constraints and friction ellipse. | |
Private Attributes | |
| VelocityPlanningConfig | config_ |
| configuration of the velocity planning algorithm | |
Static Private Attributes | |
| static constexpr double | epsilon = 1e-9 |
| Numerical tolerance for floating-point comparisons. | |
Computes velocity profiles for a planned path based on curvature and dynamics constraints.
The VelocityPlanning class generates a velocity profile along a path by:
The velocity planner respects the friction circle constraint: a_x² + a_y² ≤ a_max², ensuring that the vehicle stays within tire grip limits during combined cornering and acceleration/braking.
Definition at line 23 of file velocity_planning.hpp.
|
default |
Construct a new default Velocity Planning object.
|
inlineexplicit |
Construct a new Velocity Planning object with a given configuration.
Definition at line 34 of file velocity_planning.hpp.
|
private |
Limits velocities based on forward acceleration constraints and friction ellipse.
| points | Vector of path points (used for distance calculations) |
| velocities | Vector of velocities to be updated (input/output) |
| curvatures | Vector of curvature values (used to compute lateral acceleration) |
Definition at line 41 of file velocity_planning.cpp.

|
private |
Limits velocities based on backward braking constraints and friction ellipse.
| points | Vector of path points (used for distance calculations) |
| velocities | Vector of velocities to be updated (input/output) |
| curvatures | Vector of curvature values (used to compute lateral acceleration) |
Definition at line 66 of file velocity_planning.cpp.

|
private |
Computes the curvature at a point using the Menger curvature formula.
| p1 | Previous point |
| p2 | Current point where curvature is computed |
| p3 | Next point |
Definition at line 3 of file velocity_planning.cpp.

|
private |
Computes the maximum velocity at each point based on curvature constraints.
| curvatures | Vector of curvature values for each path point |
| velocities | Output vector to store the computed maximum velocities |
Definition at line 25 of file velocity_planning.cpp.

| void VelocityPlanning::set_velocity | ( | std::vector< PathPoint > & | final_path | ) |
Assigns an velocity to each point of the path.
| final_path | Vector of path points to update with planned velocities. |
Definition at line 97 of file velocity_planning.cpp.


| void VelocityPlanning::stop | ( | std::vector< PathPoint > & | final_path, |
| double | braking_distance | ||
| ) |
Applies a braking velocity profile starting after a given braking distance.
| final_path | Vector of path points to update with planned velocities. |
| braking_distance | Distance along the path before braking begins. |
Definition at line 151 of file velocity_planning.cpp.


| void VelocityPlanning::trackdrive_velocity | ( | std::vector< PathPoint > & | final_path | ) |
Computes velocity for trackdrive scenarios.
| final_path | Vector of path points to update with planned velocities. |
Definition at line 124 of file velocity_planning.cpp.


|
private |
configuration of the velocity planning algorithm
Definition at line 63 of file velocity_planning.hpp.
|
staticconstexprprivate |
Numerical tolerance for floating-point comparisons.
Definition at line 68 of file velocity_planning.hpp.