|
Formula Student Autonomous Systems
The code for the main driverless system
|
Responsible for path planning and trajectory generation for the autonomous vehicle. More...
#include <planning.hpp>


Public Member Functions | |
| Planning (const PlanningParameters ¶ms) | |
| Constructs a Planning node with the specified configuration parameters. | |
| void | set_mission (Mission mission) |
| Sets the mission type for planning execution. | |
Static Public Member Functions | |
| static PlanningParameters | load_config (std::string &adapter) |
| Loads planning configuration from YAML files. | |
Private Member Functions | |
| void | vehicle_localization_callback (const custom_interfaces::msg::Pose &message) |
| Callback for vehicle localization pose updates. | |
| void | track_map_callback (const custom_interfaces::msg::ConeArray &message) |
| Callback for track map updates. | |
| void | compute_path_orientation (std::vector< PathPoint > &path) |
| Computes and assigns the orientation for each point in the path. | |
| void | run_full_map () |
| Generates and optimizes a closed-loop global track path. | |
| void | run_acceleration () |
| Executes planning for the acceleration mission. | |
| void | run_autocross () |
| Executes planning for the autocross mission. | |
| void | run_trackdrive () |
| Executes planning for the trackdrive mission. | |
| void | fetch_discipline () |
| Fetches the current mission/discipline from the pacsim simulation service. | |
| void | run_planning_algorithms () |
| Runs the appropriate planning algorithm based on current mission. | |
| void | publish_path_points () const |
| Publishes the final planned path to the control module. | |
| void | publish_visualization_msgs () const |
| Publishes all visualization markers. | |
| void | publish_execution_time (rclcpp::Time start_time) |
| Publishes the planning algorithm execution time. | |
| virtual void | finish ()=0 |
| Called when planning mission is completed. | |
Private Attributes | |
| Mission | mission_ = Mission::NONE |
| PlanningConfig | planning_config_ |
| Pose | pose_ |
| std::string | map_frame_id_ |
| double | desired_velocity_ |
| double | initial_car_orientation_ |
| int | lap_counter_ = 0 |
| PathCalculation | path_calculation_ |
| PathSmoothing | path_smoothing_ |
| VelocityPlanning | velocity_planning_ |
| Skidpad | skidpad_ |
| bool | is_braking_ = false |
| bool | has_received_track_ = false |
| bool | has_received_pose_ = false |
| bool | is_path_final_ = false |
| bool | is_path_closed_ = false |
| std::chrono::steady_clock::time_point | brake_time_ |
| std::vector< PathPoint > | full_path_ |
| std::vector< PathPoint > | smoothed_path_ |
| std::vector< Cone > | cone_array_ |
| rclcpp::Subscription< custom_interfaces::msg::Pose >::SharedPtr | vehicle_localization_sub_ |
| rclcpp::Subscription< custom_interfaces::msg::ConeArray >::SharedPtr | track_map_sub_ |
| rclcpp::Subscription< std_msgs::msg::Float64 >::SharedPtr | lap_counter_sub_ |
| rclcpp::Publisher< custom_interfaces::msg::PathPointArray >::SharedPtr | path_pub_ |
| < Publisher of the smoothed path to control | |
| rclcpp::Publisher< std_msgs::msg::Float64 >::SharedPtr | planning_execution_time_pub_ |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | yellow_cones_pub_ |
| < Publisher for the yellow cones | |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | blue_cones_pub_ |
| Publisher for Delaunay triangulations. | |
| rclcpp::Publisher< visualization_msgs::msg::Marker >::SharedPtr | triangulations_pub_ |
| Publisher for the past portion of the path (from the start to a lookback distance behind the car’s current position) | |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | path_to_car_pub_ |
| Publisher for the entire planned path (from start to finish) | |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | full_path_pub_ |
| Publisher for the smoothed path. | |
| rclcpp::Publisher< visualization_msgs::msg::Marker >::SharedPtr | smoothed_path_pub_ |
| Publisher for velocity hover markers. | |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | velocity_hover_pub_ |
| rclcpp::Client< rcl_interfaces::srv::GetParameters >::SharedPtr | param_client_ |
Friends | |
| class | PacSimAdapter |
| class | EufsAdapter |
| class | FsdsAdapter |
| class | VehicleAdapter |
Responsible for path planning and trajectory generation for the autonomous vehicle.
The Planning class handles multiple mission types (acceleration, skidpad, autocross, trackdrive) and generates optimal paths based on cone positions. It subscribes to vehicle localization and track map data, performs path calculation and smoothing, applies velocity planning, and publishes the final trajectory for the control module.
This class integrates several planning modules:
Definition at line 54 of file planning.hpp.
|
explicit |
Constructs a Planning node with the specified configuration parameters.
Initializes all planning modules, subscriptions, and publishers. Sets up communication with state estimation and pacsim services. Determines the operating adapter type and configures frame IDs accordingly.
| params | Configuration parameters loaded from YAML files |
Definition at line 102 of file planning.cpp.

|
private |
Computes and assigns the orientation for each point in the path.
| path | The path whose points will have their orientation field updated in-place. |
Definition at line 233 of file planning.cpp.

|
private |
Fetches the current mission/discipline from the pacsim simulation service.
Definition at line 161 of file planning.cpp.

|
privatepure virtual |
Called when planning mission is completed.
Implemented in EufsAdapter, FsdsAdapter, VehicleAdapter, EufsAdapter, FsdsAdapter, PacSimAdapter, VehicleAdapter, and VehicleAdapter.
|
static |
Loads planning configuration from YAML files.
Reads global configuration to determine the adapter type, then loads adapter-specific planning parameters from the corresponding YAML file.
| adapter | Output parameter that stores the adapter type ("eufs", "pacsim", "vehicle") |
Definition at line 11 of file planning.cpp.


|
private |
Publishes the planning algorithm execution time.
| start_time | ROS time when planning algorithms began execution |
Definition at line 458 of file planning.cpp.

|
private |
Publishes the final planned path to the control module.
Definition at line 451 of file planning.cpp.


|
private |
Publishes all visualization markers.
Publishes triangulation, full path, smoothed path, and path_to_car markers.
Definition at line 465 of file planning.cpp.


|
private |
Executes planning for the acceleration mission.
Definition at line 327 of file planning.cpp.


|
private |
Executes planning for the autocross mission.
On the first lap, calculates and smooths the path with velocity planning. On subsequent laps, reuses the calculated full path and applies stopping logic after the first lap completion.
Definition at line 334 of file planning.cpp.


|
private |
Generates and optimizes a closed-loop global track path.
Definition at line 271 of file planning.cpp.


|
private |
Runs the appropriate planning algorithm based on current mission.
Dispatches to mission-specific planning functions and publishes the resulting trajectory.
Definition at line 390 of file planning.cpp.


|
private |
Executes planning for the trackdrive mission.
Implements multi-lap logic:
Definition at line 361 of file planning.cpp.


| void Planning::set_mission | ( | Mission | mission | ) |
Sets the mission type for planning execution.
| mission | The mission type to execute |
Definition at line 199 of file planning.cpp.

|
private |
Callback for track map updates.
Processes incoming cone detections and triggers run_planning_algorithms() if vehicle pose has already been received.
| message | The received ConeArray message |
Definition at line 220 of file planning.cpp.


|
private |
Callback for vehicle localization pose updates.
Updates the current vehicle pose and triggers run_planning_algorithms() if track map have been received.
| message | The received Pose message containing vehicle position and orientation |
Definition at line 203 of file planning.cpp.


|
friend |
Definition at line 86 of file planning.hpp.
|
friend |
Definition at line 87 of file planning.hpp.
|
friend |
Definition at line 85 of file planning.hpp.
|
friend |
Definition at line 88 of file planning.hpp.
|
private |
Publisher for Delaunay triangulations.
Definition at line 134 of file planning.hpp.
|
private |
Definition at line 112 of file planning.hpp.
|
private |
Definition at line 118 of file planning.hpp.
|
private |
Definition at line 96 of file planning.hpp.
|
private |
Definition at line 116 of file planning.hpp.
|
private |
Publisher for the smoothed path.
Definition at line 141 of file planning.hpp.
|
private |
Definition at line 109 of file planning.hpp.
|
private |
Definition at line 108 of file planning.hpp.
|
private |
Definition at line 97 of file planning.hpp.
|
private |
Definition at line 107 of file planning.hpp.
|
private |
Definition at line 111 of file planning.hpp.
|
private |
Definition at line 110 of file planning.hpp.
|
private |
Definition at line 98 of file planning.hpp.
|
private |
Definition at line 123 of file planning.hpp.
|
private |
Definition at line 95 of file planning.hpp.
|
private |
Definition at line 92 of file planning.hpp.
|
private |
Definition at line 148 of file planning.hpp.
|
private |
Definition at line 101 of file planning.hpp.
|
private |
< Publisher of the smoothed path to control
Definition at line 127 of file planning.hpp.
|
private |
Definition at line 102 of file planning.hpp.
|
private |
Publisher for the entire planned path (from start to finish)
Definition at line 139 of file planning.hpp.
|
private |
Definition at line 93 of file planning.hpp.
|
private |
Definition at line 128 of file planning.hpp.
|
private |
Definition at line 94 of file planning.hpp.
|
private |
Definition at line 104 of file planning.hpp.
|
private |
Definition at line 117 of file planning.hpp.
|
private |
Publisher for velocity hover markers.
Definition at line 143 of file planning.hpp.
|
private |
Definition at line 122 of file planning.hpp.
|
private |
Publisher for the past portion of the path (from the start to a lookback distance behind the car’s current position)
Definition at line 136 of file planning.hpp.
|
private |
Definition at line 121 of file planning.hpp.
|
private |
Definition at line 145 of file planning.hpp.
|
private |
Definition at line 103 of file planning.hpp.
|
private |
< Publisher for the yellow cones
Publisher for the blue cones
Definition at line 132 of file planning.hpp.