|
Formula Student Autonomous Systems
The code for the main driverless system
|
Adapter class to interface with the Pacsim simulator for SLAM. More...
#include <pacsim.hpp>


Public Member Functions | |
| PacsimAdapter (std::shared_ptr< SENode > se_node) | |
| void | finish () final |
| Function that sends the finish signal to the respective node. | |
| PacsimAdapter (const SLAMParameters ¶ms) | |
| Constructor of the pacsim adapter node. | |
| void | finish () override |
| Function that sends the finish signal to the respective node. | |
| PacsimAdapter (const VEParameters ¶meters) | |
| void | imu_callback (const sensor_msgs::msg::Imu::SharedPtr msg) |
| callback that gets called when the IMU data is received | |
| void | wss_callback (const pacsim::msg::Wheels::SharedPtr msg) |
| callback that gets called when the wheel speeds are received | |
| void | steering_angle_callback (const pacsim::msg::StampedScalar::SharedPtr msg) |
| callback that gets called when the steering angle is received | |
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 SLAMNode | |
| SLAMNode (const SLAMParameters ¶ms) | |
| Constructor that uses the parameters structure. | |
| void | init () |
| Initialize functions @description This method is used to initialize things that require the constructed node. | |
Public Member Functions inherited from VENode | |
| VENode (const VEParameters ¶meters) | |
Private Types | |
| using | WheelSteerPolicy = message_filters::sync_policies::ApproximateTime< pacsim::msg::Wheels, pacsim::msg::StampedScalar > |
| Policy for synchronizing wheel speeds and steering angle. | |
Private Member Functions | |
| void | wheel_speeds_subscription_callback (const pacsim::msg::Wheels &wheels_msg, const pacsim::msg::StampedScalar &steering_angle_msg) |
| Wheel speed subscription callback, which receives both wheel speeds and steering angle through a synchronizer message filter. | |
| void | perception_detections_subscription_callback (const pacsim::msg::PerceptionDetections &msg) |
| Callback for simulated perception detections from pacsim. | |
| void | _pacsim_perception_subscription_callback (const pacsim::msg::PerceptionDetections &msg) |
| Callback for simulated perception detections from pacsim. | |
| void | _pacsim_velocities_subscription_callback (const geometry_msgs::msg::TwistWithCovarianceStamped &msg) |
| Callback for simulated velocities from pacsim. | |
| void | _pacsim_imu_subscription_callback (const sensor_msgs::msg::Imu &msg) |
| Callback for simulated IMU data from pacsim. | |
| void | fetch_discipline () |
| Fetches the mission from the parameters. | |
Private Attributes | |
| message_filters::Subscriber< pacsim::msg::Wheels > | _pacsim_wheel_speeds_subscription_ |
| Subscriber for wheel speeds. | |
| message_filters::Subscriber< pacsim::msg::StampedScalar > | _steering_angle_subscription_ |
| Subscriber for steering angle. | |
| std::shared_ptr< message_filters::Synchronizer< WheelSteerPolicy > > | _sync_ |
| Synchronizer for wheel speeds and steering angle. | |
| rclcpp::Subscription< pacsim::msg::PerceptionDetections >::SharedPtr | _perception_detections_subscription_ |
| Subscriber for simulated perception detections. | |
| rclcpp::Client< std_srvs::srv::Empty >::SharedPtr | _finished_client_ |
| Client for finished signal. | |
| rclcpp::Subscription< geometry_msgs::msg::TwistWithCovarianceStamped >::SharedPtr | _velocities_subscription_ |
| Subscriber for simulated velocities. | |
| rclcpp::Subscription< sensor_msgs::msg::Imu >::SharedPtr | _imu_subscription_ |
| Subscriber for simulated IMU data. | |
| rclcpp::Client< rcl_interfaces::srv::GetParameters >::SharedPtr | param_client_ |
| rclcpp::Subscription< sensor_msgs::msg::Imu >::SharedPtr | _imu_sub_ |
| rclcpp::Subscription< pacsim::msg::Wheels >::SharedPtr | wheel_speeds_sub_ |
| rclcpp::Subscription< pacsim::msg::StampedScalar >::SharedPtr | _steering_angle_sub_ |
Additional Inherited Members | |
Public Attributes inherited from Adapter | |
| std::shared_ptr< SENode > | node_ |
| rclcpp::Subscription< sensor_msgs::msg::Imu >::SharedPtr | _imu_subscription_ |
Protected Member Functions inherited from SLAMNode | |
| void | _perception_subscription_callback (const custom_interfaces::msg::PerceptionOutput &msg) |
| Callback that updates everytime information is received from the perception module. | |
| void | _velocities_subscription_callback (const custom_interfaces::msg::Velocities &msg) |
| Callback that updates everytime information is received from velocity estimation node. | |
| void | _imu_subscription_callback (const sensor_msgs::msg::Imu &msg) |
| Callback that updates everytime information is received from the IMU. | |
| void | _publish_vehicle_pose () |
| publishes the localization ('vehicle_pose') to the topic vehicle_pose | |
| void | _publish_map () |
| publishes the map ('track_map') to the topic track_map | |
| void | _publish_associations () |
| Publishes the visualization of the associations by data association. | |
| void | _publish_covariance () |
| publishes the covariance of the state | |
| void | _publish_lap_counter () |
| publishes the lap counter | |
| bool | _is_mission_finished () |
| Checks if the mission is finished. | |
Protected Member Functions inherited from VENode | |
| void | publish_velocities () const |
Protected Attributes inherited from SLAMNode | |
| rclcpp::CallbackGroup::SharedPtr | _callback_group_ |
| Callback group for subscriptions, used to control if they are concurrent or not. | |
| rclcpp::Subscription< custom_interfaces::msg::PerceptionOutput >::SharedPtr | _perception_subscription_ |
| rclcpp::Subscription< custom_interfaces::msg::Velocities >::SharedPtr | _velocities_subscription_ |
| rclcpp::Publisher< custom_interfaces::msg::Pose >::SharedPtr | _vehicle_pose_publisher_ |
| rclcpp::Publisher< custom_interfaces::msg::ConeArray >::SharedPtr | _map_publisher_ |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | _visualization_map_publisher_ |
| rclcpp::Publisher< visualization_msgs::msg::Marker >::SharedPtr | _position_visualization_publisher_ |
| Publishes the vehicle position. | |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | _trajectory_visualization_publisher_ |
| Publishes full vehicle trajectory. | |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | _associations_visualization_publisher_ |
| rclcpp::Publisher< std_msgs::msg::Float64MultiArray >::SharedPtr | _execution_time_publisher_ |
| rclcpp::Publisher< std_msgs::msg::Float64MultiArray >::SharedPtr | _covariance_publisher_ |
| Publishes the covariance of the pose. | |
| rclcpp::Publisher< std_msgs::msg::Float64 >::SharedPtr | _lap_counter_publisher_ |
| rclcpp::Publisher< std_msgs::msg::Float64 >::SharedPtr | _perception_delta_publisher_ |
| rclcpp::Time | _last_perception_message_time_ = rclcpp::Time(0) |
| rclcpp::CallbackGroup::SharedPtr | _parallel_callback_group_ |
| std::shared_mutex | mutex_ |
| std::shared_ptr< tf2_ros::TransformBroadcaster > | _tf_broadcaster_ |
| rclcpp::TimerBase::SharedPtr | _timer_ |
| timer | |
| std::shared_ptr< SLAMSolver > | _slam_solver_ |
| SLAM solver object. | |
| std::vector< common_lib::structures::Cone > | _perception_map_ |
| common_lib::structures::Velocities | _vehicle_state_velocities_ |
| std::vector< common_lib::structures::Cone > | _track_map_ |
| Eigen::VectorXi | _associations_ |
| Eigen::VectorXd | _observations_global_ |
| Global observations of the cones. | |
| Eigen::VectorXd | _map_coordinates_ |
| Coordinates of the cones in the map. | |
| common_lib::structures::Pose | _vehicle_pose_ |
| std::shared_ptr< std::vector< double > > | _execution_times_ |
| common_lib::competition_logic::Mission | _mission_ = common_lib::competition_logic::Mission::NONE |
| bool | _go_ = true |
| std::string | _adapter_name_ |
| flag to start the mission | |
| std::string | _vehicle_frame_id_ |
| Frame id of the vehicle for the transform. | |
| SLAMParameters | _params_ |
Protected Attributes inherited from VENode | |
| VEParameters | _parameters_ |
| std::shared_ptr< VelocityEstimator > | _velocity_estimator_ |
| rclcpp::Publisher< custom_interfaces::msg::Velocities >::SharedPtr | _velocities_pub_ |
Adapter class to interface with the Pacsim simulator for SLAM.
Adapter class for the pacsim simulator.
This class subscribes to the necessary topics from Pacsim and adapts the data for use in the SLAM node
This class subscribes to the IMU, wheel speeds, and steering angle topics published by the pacsim simulator. It then passes the data to the velocity estimator for processing.
Definition at line 17 of file pacsim.hpp.
|
private |
Policy for synchronizing wheel speeds and steering angle.
Definition at line 23 of file pacsim.hpp.
|
explicit |
| PacsimAdapter::PacsimAdapter | ( | const SLAMParameters & | params | ) |
Constructor of the pacsim adapter node.
Definition at line 10 of file pacsim.cpp.

|
explicit |
|
private |
Callback for simulated IMU data from pacsim.
| msg | Message containing the IMU data of the vehicle |
Definition at line 135 of file pacsim.cpp.


|
private |
Callback for simulated perception detections from pacsim.
| msg | Message containing the array of perceived detections |
Definition at line 98 of file pacsim.cpp.


|
private |
Callback for simulated velocities from pacsim.
| msg | Message containing the velocities of the vehicle |
Definition at line 120 of file pacsim.cpp.


|
private |
Fetches the mission from the parameters.
Definition at line 57 of file pacsim.cpp.

|
finalvirtual |
Function that sends the finish signal to the respective node.
Implements Adapter.
Definition at line 41 of file pacsim.cpp.
|
overridevirtual |
Function that sends the finish signal to the respective node.
Implements Adapter.
| void PacsimAdapter::imu_callback | ( | const sensor_msgs::msg::Imu::SharedPtr | msg | ) |
callback that gets called when the IMU data is received
Definition at line 15 of file pacsim_adapter.cpp.


|
private |
Callback for simulated perception detections from pacsim.
| msg | Message containing the array of perceived detections |
Definition at line 49 of file pacsim.cpp.


| void PacsimAdapter::steering_angle_callback | ( | const pacsim::msg::StampedScalar::SharedPtr | msg | ) |
callback that gets called when the steering angle is received
Definition at line 32 of file pacsim_adapter.cpp.


|
private |
Wheel speed subscription callback, which receives both wheel speeds and steering angle through a synchronizer message filter.
Definition at line 34 of file pacsim.cpp.

| void PacsimAdapter::wss_callback | ( | const pacsim::msg::Wheels::SharedPtr | msg | ) |
callback that gets called when the wheel speeds are received
Definition at line 22 of file pacsim_adapter.cpp.


|
private |
Client for finished signal.
Definition at line 33 of file pacsim.hpp.
|
private |
Definition at line 17 of file pacsim_adapter.hpp.
|
private |
Subscriber for simulated IMU data.
Definition at line 24 of file pacsim.hpp.
|
private |
Subscriber for wheel speeds.
Definition at line 19 of file pacsim.hpp.
|
private |
Subscriber for simulated perception detections.
Definition at line 30 of file pacsim.hpp.
|
private |
Definition at line 19 of file pacsim_adapter.hpp.
|
private |
Subscriber for steering angle.
Definition at line 21 of file pacsim.hpp.
|
private |
Synchronizer for wheel speeds and steering angle.
Definition at line 27 of file pacsim.hpp.
|
private |
Subscriber for simulated velocities.
Definition at line 21 of file pacsim.hpp.
|
private |
Definition at line 29 of file pacsim.hpp.
|
private |
Definition at line 18 of file pacsim_adapter.hpp.