15 #ifndef SIMPLE_SENSOR_SIMULATOR__SENSOR_SIMULATION__DETECTION_SENSOR__DETECTION_SENSOR_HPP_
16 #define SIMPLE_SENSOR_SIMULATOR__SENSOR_SIMULATION__DETECTION_SENSOR__DETECTION_SENSOR_HPP_
18 #include <simulation_api_schema.pb.h>
21 #include <geometry_msgs/msg/pose.hpp>
26 #include <rclcpp/rclcpp.hpp>
41 const double current_simulation_time,
42 const simulation_api_schema::DetectionSensorConfiguration & configuration)
51 const std::vector<traffic_simulator_msgs::EntityStatus> &)
const
52 -> std::vector<traffic_simulator_msgs::EntityStatus>::const_iterator;
55 const geometry_msgs::Pose & npc_pose,
const geometry_msgs::Pose & ego_pose) -> bool;
61 const double current_simulation_time,
const std::vector<traffic_simulator_msgs::EntityStatus> &,
62 const rclcpp::Time & current_ros_time,
63 const std::vector<std::string> & lidar_detected_entities) = 0;
66 std::optional<math::geometry::Plane> ego_plane_opt_{std::nullopt};
67 std::optional<geometry_msgs::msg::Pose> ego_plane_pose_opt_{std::nullopt};
70 template <
typename T,
typename U = autoware_perception_msgs::msg::TrackedObjects>
73 const typename rclcpp::Publisher<T>::SharedPtr detected_objects_publisher;
75 const typename rclcpp::Publisher<U>::SharedPtr ground_truth_objects_publisher;
77 std::default_random_engine random_engine_;
79 std::queue<std::pair<autoware_perception_msgs::msg::DetectedObjects, double>>
80 detected_objects_queue;
82 std::queue<std::pair<autoware_perception_msgs::msg::TrackedObjects, double>>
83 ground_truth_objects_queue;
87 const double current_simulation_time,
88 const simulation_api_schema::DetectionSensorConfiguration & configuration,
89 const typename rclcpp::Publisher<T>::SharedPtr & publisher,
90 const typename rclcpp::Publisher<U>::SharedPtr & ground_truth_publisher =
nullptr)
92 detected_objects_publisher(publisher),
93 ground_truth_objects_publisher(ground_truth_publisher),
94 random_engine_(configuration.random_seed())
101 const double,
const std::vector<traffic_simulator_msgs::EntityStatus> &,
const rclcpp::Time &,
102 const std::vector<std::string> & lidar_detected_entities) ->
void override;
Definition: detection_sensor.hpp:34
auto isOnOrAboveEgoPlane(const geometry_msgs::Pose &npc_pose, const geometry_msgs::Pose &ego_pose) -> bool
Definition: detection_sensor.cpp:67
DetectionSensorBase(const double current_simulation_time, const simulation_api_schema::DetectionSensorConfiguration &configuration)
Definition: detection_sensor.hpp:40
virtual ~DetectionSensorBase()=default
simulation_api_schema::DetectionSensorConfiguration configuration_
Definition: detection_sensor.hpp:38
auto isEgoEntityStatusToWhichThisSensorIsAttached(const traffic_simulator_msgs::EntityStatus &) const -> bool
Definition: detection_sensor.cpp:44
double previous_simulation_time_
Definition: detection_sensor.hpp:36
virtual void update(const double current_simulation_time, const std::vector< traffic_simulator_msgs::EntityStatus > &, const rclcpp::Time ¤t_ros_time, const std::vector< std::string > &lidar_detected_entities)=0
auto findEgoEntityStatusToWhichThisSensorIsAttached(const std::vector< traffic_simulator_msgs::EntityStatus > &) const -> std::vector< traffic_simulator_msgs::EntityStatus >::const_iterator
Definition: detection_sensor.cpp:51
Definition: detection_sensor.hpp:72
DetectionSensor(const double current_simulation_time, const simulation_api_schema::DetectionSensorConfiguration &configuration, const typename rclcpp::Publisher< T >::SharedPtr &publisher, const typename rclcpp::Publisher< U >::SharedPtr &ground_truth_publisher=nullptr)
Definition: detection_sensor.hpp:86
~DetectionSensor() override=default
auto update(const double, const std::vector< traffic_simulator_msgs::EntityStatus > &, const rclcpp::Time &, const std::vector< std::string > &lidar_detected_entities) -> void override
Definition: constants.hpp:19
traffic_simulator_msgs::EntityStatus EntityStatus
Definition: helper_functions.hpp:32