Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
EufsAdapter Class Reference

Adapter class to interface with the EUFS simulator. More...

#include <eufs.hpp>

Inheritance diagram for EufsAdapter:
Inheritance graph
Collaboration diagram for EufsAdapter:
Collaboration graph

Public Member Functions

 EufsAdapter (const ControlParameters &params)
 
void vehicle_state_callback (const eufs_msgs::msg::CarState &msg)
 Callback function for velocities and poses, which are coupled in EUFS.
 
void publish_command (common_lib::structures::ControlCommand cmd) override
 Adapters override this function to publish control commands in their environment.
 
 EufsAdapter (std::shared_ptr< SENode > se_node)
 
void mission_state_callback (const eufs_msgs::msg::CanState &msg) const
 
void finish () final
 Function that sends the finish signal to the respective node.
 
void perception_detections_subscription_callback (const eufs_msgs::msg::ConeArrayWithCovariance &msg) const
 
void wheel_speeds_subscription_callback (const eufs_msgs::msg::WheelSpeedsStamped &msg) const
 
 EufsAdapter (const PlanningParameters &params)
 
void mission_state_callback (eufs_msgs::msg::CanState msg)
 
void set_mission_state (int mission, int state)
 
void pose_callback (const eufs_msgs::msg::CarState &msg)
 
void map_callback (const eufs_msgs::msg::ConeArrayWithCovariance &msg)
 
void finish () override
 Function that sends the finish signal to the respective node.
 
- Public Member Functions inherited from ControlNode
 ControlNode (const ControlParameters &params)
 
- Public Member Functions inherited from Adapter
 Adapter (std::shared_ptr< SENode > se_node)
 
void imu_subscription_callback (const sensor_msgs::msg::Imu &msg)
 Function that parses the message sent from the ros IMU topic and calls the respective node's function to update the motion.
 
virtual ~Adapter ()=default
 
- Public Member Functions inherited from Planning
 Planning (const PlanningParameters &params)
 Constructs a Planning node with the specified configuration parameters.
 
void set_mission (Mission mission)
 Sets the mission type for planning execution.
 

Private Attributes

rclcpp::Publisher< ackermann_msgs::msg::AckermannDriveStamped >::SharedPtr control_pub_
 
rclcpp::Subscription< eufs_msgs::msg::CarState >::SharedPtr vehicle_pose_sub_
 
rclcpp::Subscription< eufs_msgs::msg::ConeArrayWithCovariance >::SharedPtr _perception_detections_subscription_
 Subscriber for simulated perception detections.
 
rclcpp::Subscription< eufs_msgs::msg::WheelSpeedsStamped >::SharedPtr _eufs_wheel_speeds_subscription_
 Subscriber for wheel speeds and steering angle.
 
rclcpp::Subscription< eufs_msgs::msg::CanState >::SharedPtr eufs_state_subscription_
 
rclcpp::Client< eufs_msgs::srv::SetCanState >::SharedPtr eufs_mission_state_client_
 
rclcpp::Client< eufs_msgs::srv::SetCanState >::SharedPtr eufs_ebs_client_
 
rclcpp::Subscription< eufs_msgs::msg::CarState >::SharedPtr eufs_pose_subscription_
 
rclcpp::Subscription< eufs_msgs::msg::ConeArrayWithCovariance >::SharedPtr eufs_map_subscription_
 
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr eufs_map_publisher_
 

Additional Inherited Members

- Static Public Member Functions inherited from Planning
static PlanningParameters load_config (std::string &adapter)
 Loads planning configuration from YAML files.
 
- Public Attributes inherited from Adapter
std::shared_ptr< SENodenode_
 
rclcpp::Subscription< sensor_msgs::msg::Imu >::SharedPtr _imu_subscription_
 
- Protected Member Functions inherited from ControlNode
void vehicle_pose_callback (const custom_interfaces::msg::Pose &msg)
 Called when a new vehicle pose is received.
 
void path_callback (const custom_interfaces::msg::PathPointArray &msg)
 Called when a new path is received.
 
void vehicle_state_callback (const custom_interfaces::msg::Velocities &msg)
 Called when a new velocity is received.
 
- Protected Attributes inherited from ControlNode
bool go_signal_ {false}
 
ControlParameters params_
 

Detailed Description

Adapter class to interface with the EUFS simulator.

Works on a publish-subscribe model. Publishes commands to the simulator in the form of AckermannDriveStamped messages and subscribes to CarState messages if using simulated SLAM.

Definition at line 14 of file eufs.hpp.

Constructor & Destructor Documentation

◆ EufsAdapter() [1/3]

EufsAdapter::EufsAdapter ( const ControlParameters params)
explicit

Definition at line 3 of file eufs.cpp.

Here is the call graph for this function:

◆ EufsAdapter() [2/3]

EufsAdapter::EufsAdapter ( std::shared_ptr< SENode se_node)
explicit

Definition at line 8 of file eufs.cpp.

Here is the call graph for this function:

◆ EufsAdapter() [3/3]

EufsAdapter::EufsAdapter ( const PlanningParameters params)
explicit

Definition at line 82 of file eufs.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ finish() [1/2]

void EufsAdapter::finish ( )
finalvirtual

Function that sends the finish signal to the respective node.

Implements Adapter.

Definition at line 47 of file eufs.cpp.

◆ finish() [2/2]

void EufsAdapter::finish ( )
overridevirtual

Function that sends the finish signal to the respective node.

Implements Adapter.

◆ map_callback()

void EufsAdapter::map_callback ( const eufs_msgs::msg::ConeArrayWithCovariance &  msg)

Definition at line 143 of file eufs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mission_state_callback() [1/2]

void EufsAdapter::mission_state_callback ( const eufs_msgs::msg::CanState &  msg) const

Definition at line 37 of file eufs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mission_state_callback() [2/2]

void EufsAdapter::mission_state_callback ( eufs_msgs::msg::CanState  msg)

Definition at line 107 of file eufs.cpp.

Here is the call graph for this function:

◆ perception_detections_subscription_callback()

void EufsAdapter::perception_detections_subscription_callback ( const eufs_msgs::msg::ConeArrayWithCovariance &  msg) const

Definition at line 51 of file eufs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pose_callback()

void EufsAdapter::pose_callback ( const eufs_msgs::msg::CarState &  msg)

Definition at line 126 of file eufs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish_command()

void EufsAdapter::publish_command ( common_lib::structures::ControlCommand  cmd)
overridevirtual

Adapters override this function to publish control commands in their environment.

Parameters
cmdControl command to be published

Implements ControlNode.

Definition at line 34 of file eufs.cpp.

◆ set_mission_state()

void EufsAdapter::set_mission_state ( int  mission,
int  state 
)

Definition at line 114 of file eufs.cpp.

◆ vehicle_state_callback()

void EufsAdapter::vehicle_state_callback ( const eufs_msgs::msg::CarState &  msg)

Callback function for velocities and poses, which are coupled in EUFS.

Definition at line 19 of file eufs.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wheel_speeds_subscription_callback()

void EufsAdapter::wheel_speeds_subscription_callback ( const eufs_msgs::msg::WheelSpeedsStamped &  msg) const

Definition at line 109 of file eufs.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ _eufs_wheel_speeds_subscription_

rclcpp::Subscription<eufs_msgs::msg::WheelSpeedsStamped>::SharedPtr EufsAdapter::_eufs_wheel_speeds_subscription_
private

Subscriber for wheel speeds and steering angle.

Definition at line 12 of file eufs.hpp.

◆ _perception_detections_subscription_

rclcpp::Subscription<eufs_msgs::msg::ConeArrayWithCovariance>::SharedPtr EufsAdapter::_perception_detections_subscription_
private

Subscriber for simulated perception detections.

Definition at line 10 of file eufs.hpp.

◆ control_pub_

rclcpp::Publisher<ackermann_msgs::msg::AckermannDriveStamped>::SharedPtr EufsAdapter::control_pub_
private

Definition at line 16 of file eufs.hpp.

◆ eufs_ebs_client_

rclcpp::Client< eufs_msgs::srv::SetCanState >::SharedPtr EufsAdapter::eufs_ebs_client_
private

Definition at line 15 of file eufs.hpp.

◆ eufs_map_publisher_

rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr EufsAdapter::eufs_map_publisher_
private

Definition at line 13 of file eufs.hpp.

◆ eufs_map_subscription_

rclcpp::Subscription<eufs_msgs::msg::ConeArrayWithCovariance>::SharedPtr EufsAdapter::eufs_map_subscription_
private

Definition at line 12 of file eufs.hpp.

◆ eufs_mission_state_client_

rclcpp::Client< eufs_msgs::srv::SetCanState >::SharedPtr EufsAdapter::eufs_mission_state_client_
private

Definition at line 14 of file eufs.hpp.

◆ eufs_pose_subscription_

rclcpp::Subscription<eufs_msgs::msg::CarState>::SharedPtr EufsAdapter::eufs_pose_subscription_
private

Definition at line 11 of file eufs.hpp.

◆ eufs_state_subscription_

rclcpp::Subscription< eufs_msgs::msg::CanState >::SharedPtr EufsAdapter::eufs_state_subscription_
private

Definition at line 13 of file eufs.hpp.

◆ vehicle_pose_sub_

rclcpp::Subscription<eufs_msgs::msg::CarState>::SharedPtr EufsAdapter::vehicle_pose_sub_
private

Definition at line 17 of file eufs.hpp.


The documentation for this class was generated from the following files: