Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
fsds.cpp
Go to the documentation of this file.
2
4
7 RCLCPP_WARN(this->get_logger(),
8 "FSDS shouldn't be used with simulated State Estimation\n The planning node will "
9 "not determine the middle path\n");
10 this->fsds_state_subscription_ = this->create_subscription<fs_msgs::msg::GoSignal>(
11 "/signal/go", 10,
12 std::bind(&FsdsAdapter::mission_state_callback, this, std::placeholders::_1));
13 this->fsds_position_subscription_ = this->create_subscription<nav_msgs::msg::Odometry>(
14 "/testing_only/odom", 10,
15 std::bind(&FsdsAdapter::pose_callback, this, std::placeholders::_1));
16 }
18 this->create_publisher<fs_msgs::msg::FinishedSignal>("/signal/finished", 10);
19 RCLCPP_DEBUG(this->get_logger(), "Planning : FSDS adapter created");
20}
21
22void FsdsAdapter::mission_state_callback(const fs_msgs::msg::GoSignal msg) {
23 auto mission = msg.mission;
24 // map fsds mission to system mission
26}
27
29 RCLCPP_INFO(this->get_logger(), "Planning : Set mission undefined for FSDS");
30}
31
33 auto message = fs_msgs::msg::FinishedSignal();
34 message.placeholder = true; // unnecessary
35
36 this->fsds_ebs_publisher_->publish(message);
37}
38
39void FsdsAdapter::pose_callback(const nav_msgs::msg::Odometry& msg) {
40 custom_interfaces::msg::Pose pose;
41 pose.header = msg.header;
42 tf2::Quaternion q(msg.pose.pose.orientation.x, msg.pose.pose.orientation.y,
43 msg.pose.pose.orientation.z, msg.pose.pose.orientation.w);
44 tf2::Matrix3x3 m(q);
45 double roll;
46 double pitch;
47 double yaw;
48 m.getRPY(roll, pitch, yaw);
49 pose.theta = yaw;
50 pose.x = msg.pose.pose.position.x;
51 pose.y = msg.pose.pose.position.y;
53}
void pose_callback(const nav_msgs::msg::Odometry &msg)
Definition fsds.cpp:39
rclcpp::Publisher< fs_msgs::msg::FinishedSignal >::SharedPtr fsds_ebs_publisher_
Definition fsds.hpp:9
void set_mission_state()
Definition fsds.cpp:28
void mission_state_callback(const fs_msgs::msg::GoSignal &msg) const
Definition fsds.cpp:22
void finish() final
Function that sends the finish signal to the respective node.
Definition fsds.cpp:29
rclcpp::Subscription< fs_msgs::msg::GoSignal >::SharedPtr fsds_state_subscription_
Definition fsds.hpp:8
rclcpp::Subscription< nav_msgs::msg::Odometry >::SharedPtr fsds_position_subscription_
Definition fsds.hpp:23
Responsible for path planning and trajectory generation for the autonomous vehicle.
Definition planning.hpp:54
void vehicle_localization_callback(const custom_interfaces::msg::Pose &message)
Callback for vehicle localization pose updates.
Definition planning.cpp:203
friend class FsdsAdapter
Definition planning.hpp:87
void set_mission(Mission mission)
Sets the mission type for planning execution.
Definition planning.cpp:199
PlanningConfig planning_config_
Definition planning.hpp:93
const std::unordered_map< std::string, Mission > fsds_to_system