10#include <unordered_map>
24#include "custom_interfaces/msg/cone_array.hpp"
25#include "custom_interfaces/msg/operational_status.hpp"
26#include "custom_interfaces/msg/perception_output.hpp"
27#include "custom_interfaces/msg/velocities.hpp"
34#include "rclcpp/rclcpp.hpp"
35#include "sensor_msgs/msg/point_cloud2.hpp"
36#include "std_msgs/msg/float64.hpp"
37#include "std_msgs/msg/float64_multi_array.hpp"
38#include "std_msgs/msg/header.hpp"
39#include "std_srvs/srv/empty.hpp"
40#include "std_srvs/srv/trigger.hpp"
41#include "visualization_msgs/msg/marker_array.hpp"
44#include "yaml-cpp/yaml.h"
58 std::shared_ptr<std::unordered_map<int16_t, std::shared_ptr<FovTrimming>>>
fov_trim_map_;
63 std::shared_ptr<LeastSquaresDifferentiation>
66 std::unordered_map<std::string, double>
106 std::shared_ptr<std::unordered_map<int16_t, std::shared_ptr<FovTrimming>>>
112 std::shared_ptr<ConeDifferentiation>
116 rclcpp::Subscription<custom_interfaces::msg::OperationalStatus>::SharedPtr
118 rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr
121 rclcpp::Publisher<custom_interfaces::msg::PerceptionOutput>::SharedPtr
123 rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr
125 rclcpp::Publisher<std_msgs::msg::Float64MultiArray>::SharedPtr
127 rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr
129 rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr
131 rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr
150 void publish_cones(std::vector<Cluster>* cones,
double exec_time, rclcpp::Time start_time);
Node for perception tasks, such as ground removal and cone detection.
rclcpp::Subscription< custom_interfaces::msg::Velocities >::SharedPtr _velocities_subscription_
std::string _vehicle_frame_id_
String for the vehicle's frame id.
std::shared_ptr< Clustering > _clustering_
Shared pointer to the Clustering object.
std::shared_ptr< ConeEvaluator > _cone_evaluator_
Shared pointer to ConeEvaluator object.
static PerceptionParameters load_config()
Turns the parameters in the yaml file into PerceptionParameters class.
rclcpp::Publisher< sensor_msgs::msg::PointCloud2 >::SharedPtr _fov_trimmed_publisher_
Point cloud after fov trimming publisher.
std::string _adapter_
String for the current adapter being used.
std::shared_ptr< ConeDifferentiation > _cone_differentiator_
Shared pointer to ConeDifferentiation object.
rclcpp::Subscription< custom_interfaces::msg::OperationalStatus >::SharedPtr _operational_status_subscription
Master Log subscription to aquire mission type.
std::shared_ptr< WallRemoval > _wall_removal_
Shared pointer to the WallRemoval object.
rclcpp::Subscription< sensor_msgs::msg::PointCloud2 >::SharedPtr _point_cloud_subscription
PointCloud2 subscription.
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr _cone_marker_array_
MarkerArray publisher.
void point_cloud_callback(const sensor_msgs::msg::PointCloud2::SharedPtr msg)
Callback function for the PointCloud2 subscription.
std::shared_ptr< GroundRemoval > _ground_removal_
Shared pointer to the GroundRemoval object.
void publish_cones(std::vector< Cluster > *cones, double exec_time, rclcpp::Time start_time)
Publishes information about clusters (cones) using a custom ROS2 message.
bool _publish_ground_removed_cloud_
Whether to publish the ground removed point cloud.
void velocities_callback(const custom_interfaces::msg::Velocities &msg)
Callback function for the Velocities subscription.
std::shared_ptr< std::unordered_map< int16_t, std::shared_ptr< FovTrimming > > > _fov_trim_map_
Shared pointer to the FovTrimming object.
std::shared_ptr< Deskew > _deskew_
Shared pointer to Deskew object.
int16_t _mission_type_
integer value for the current mission type running.
void lidar_timer_callback()
Callback function for the LiDAR timer to check for emergency.
rclcpp::Publisher< sensor_msgs::msg::PointCloud2 >::SharedPtr _ground_removed_publisher_
Point cloud after ground removal publisher.
bool _publish_wall_removed_cloud_
Whether to publish the wall removed point cloud.
rclcpp::Publisher< std_msgs::msg::Float64MultiArray >::SharedPtr _perception_execution_time_publisher_
Perception execution time publisher.
std::shared_ptr< std::vector< double > > _execution_times_
Vector to store execution times.
std::shared_ptr< GroundGrid > _ground_grid_
Model for the ground grid.
rclcpp::Publisher< sensor_msgs::msg::PointCloud2 >::SharedPtr _wall_removed_publisher_
Point cloud after wall removal publisher.
rclcpp::Client< std_srvs::srv::Trigger >::SharedPtr emergency_client_
common_lib::structures::Velocities _vehicle_velocity_
bool _publish_fov_trimmed_cloud_
Whether to publish the FOV trimmed point cloud.
rclcpp::Publisher< custom_interfaces::msg::PerceptionOutput >::SharedPtr _cones_publisher
ConeArray + exec publisher.
rclcpp::TimerBase::SharedPtr lidar_off_timer_
Timer to check for lidar emergency.
Struct containing parameters and interfaces used in perception.
std::shared_ptr< WallRemoval > wall_removal_
Shared pointer to the WallRemoval object.
std::shared_ptr< GroundRemoval > ground_removal_
Shared pointer to the GroundRemoval object.
std::string adapter_
String for the name of the current adapter.
std::string vehicle_frame_id_
String for the vehicle's frame id.
std::shared_ptr< ConeEvaluator > cone_evaluator_
Shared pointer to ConeEvaluator object.
bool publish_wall_removed_cloud
std::shared_ptr< std::unordered_map< int16_t, std::shared_ptr< FovTrimming > > > fov_trim_map_
bool publish_fov_trimmed_cloud
bool publish_ground_removed_cloud
std::unordered_map< std::string, double > weight_values
Map containing all weight value parameters for cone evaluation.
std::shared_ptr< GroundGrid > ground_grid_
Model for the ground grid.
std::shared_ptr< Clustering > clustering_
Shared pointer to the Clustering object.
std::shared_ptr< LeastSquaresDifferentiation > cone_differentiator_
Shared pointer to ConeDifferentiation object.