Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
base_decoupled_controller.hpp
Go to the documentation of this file.
1#pragma once
2
6
8 // Controller for throttle
9 std::shared_ptr<LateralController> lateral_controller_;
10 // Controller for steering
11 std::shared_ptr<LongitudinalController> longitudinal_controller_;
12public:
13 void path_callback(const custom_interfaces::msg::PathPointArray& msg) override;
14 void vehicle_state_callback(const custom_interfaces::msg::Velocities& msg) override;
15 void vehicle_pose_callback(const custom_interfaces::msg::Pose& msg) override;
17 void publish_solver_data(std::shared_ptr<rclcpp::Node> node, std::map<std::string, std::shared_ptr<rclcpp::PublisherBase>>& publisher_map) override;
18
20 virtual ~DecoupledController() = default;
21};
Base class for control solvers, that calculate both lateral and longitudinal control commands.
std::shared_ptr< LongitudinalController > longitudinal_controller_
void path_callback(const custom_interfaces::msg::PathPointArray &msg) override
Called when a new path is sent by Path Planning.
std::shared_ptr< LateralController > lateral_controller_
void publish_solver_data(std::shared_ptr< rclcpp::Node > node, std::map< std::string, std::shared_ptr< rclcpp::PublisherBase > > &publisher_map) override
Publishes solver specific data using the provided ControlNode.
common_lib::structures::ControlCommand get_control_command() override
Returns the control command calculated by the solver.
void vehicle_state_callback(const custom_interfaces::msg::Velocities &msg) override
Called when the car state (currently just velocity) is updated.
void vehicle_pose_callback(const custom_interfaces::msg::Pose &msg) override
Called when the car pose is updated by SLAM.
virtual ~DecoupledController()=default