11#include "utils/utils.hpp"
12#include "gtest/gtest.h"
13#include "rclcpp/rclcpp.hpp"
29 std::shared_ptr<Filter>
lpf_;
52 void publish_closest_point(std::shared_ptr<rclcpp::Node> node, std::map<std::string, std::shared_ptr<rclcpp::PublisherBase>>& publisher_map);
60 void publish_lookahead_point(std::shared_ptr<rclcpp::Node> node, std::map<std::string, std::shared_ptr<rclcpp::PublisherBase>>& publisher_map);
69 void path_callback(
const custom_interfaces::msg::PathPointArray& msg)
override;
77 void publish_solver_data(std::shared_ptr<rclcpp::Node> node, std::map<std::string, std::shared_ptr<rclcpp::PublisherBase>>& publisher_map)
override;
93 double dist_cg_2_rear_axis);
Base (abstract) class for lateral control solvers (that calculate steering command)
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.
bool received_first_state_
FRIEND_TEST(PurePursuitTests, Test_calculate_alpha_2)
bool received_first_path_
void path_callback(const custom_interfaces::msg::PathPointArray &msg) override
Called when a new path is sent by Path Planning.
std::shared_ptr< Filter > lpf_
std::vector< custom_interfaces::msg::PathPoint > last_path_msg_
FRIEND_TEST(PurePursuitTests, Test_pp_steering_control_law_1)
FRIEND_TEST(PurePursuitTests, Test_calculate_alpha_3)
common_lib::structures::Position lookahead_point_
void vehicle_state_callback(const custom_interfaces::msg::Velocities &msg) override
Called when the car state (currently just velocity) is updated.
custom_interfaces::msg::Velocities last_velocity_msg_
custom_interfaces::msg::Pose last_pose_msg_
FRIEND_TEST(PurePursuitTests, Test_calculate_alpha_4)
double absolute_velocity_
double get_steering_command() override
Returns the steering command calculated by the solver.
double pp_steering_control_law(common_lib::structures::Position rear_axis, common_lib::structures::Position cg, common_lib::structures::Position lookahead_point, double dist_cg_2_rear_axis)
Pure Pursuit control law.
FRIEND_TEST(PurePursuitTests, Test_calculate_alpha_5)
FRIEND_TEST(PurePursuitTests, Test_calculate_alpha_1)
void vehicle_pose_callback(const custom_interfaces::msg::Pose &msg) override
Called when the car pose is updated by SLAM.
double calculate_alpha(common_lib::structures::Position vehicle_rear_wheel, common_lib::structures::Position vehicle_cg, common_lib::structures::Position lookahead_point, double rear_wheel_2_c_g)
Calculate alpha (angle between the vehicle and lookahead point)
void publish_lookahead_point(std::shared_ptr< rclcpp::Node > node, std::map< std::string, std::shared_ptr< rclcpp::PublisherBase > > &publisher_map)
Function that publishes the lookahead point marker.
bool received_first_pose_
common_lib::structures::Position closest_point_
void publish_closest_point(std::shared_ptr< rclcpp::Node > node, std::map< std::string, std::shared_ptr< rclcpp::PublisherBase > > &publisher_map)
Function that publishes the closest point marker.