15 #ifndef SIMPLE_SENSOR_SIMULATOR__TEST__TEST_LIDAR_SENSOR_HPP_ 
   16 #define SIMPLE_SENSOR_SIMULATOR__TEST__TEST_LIDAR_SENSOR_HPP_ 
   18 #include <gtest/gtest.h> 
   20 #include <agnocast_wrapper/agnocast_wrapper.hpp> 
   21 #include <rclcpp/rclcpp.hpp> 
   22 #include <sensor_msgs/msg/point_cloud2.hpp> 
   28 #include "../../utils/helper_functions.hpp" 
   38     rclcpp::init(0, 
nullptr);
 
   40     executor_ = std::make_shared<rclcpp::executors::SingleThreadedExecutor>();
 
   41     node_ = std::make_shared<rclcpp::Node>(
"lidar_sensor_test_node");
 
   42     executor_->add_node(node_);
 
   44     initializeEntityStatuses();
 
   46     lidar_ = std::make_unique<LidarSensor<sensor_msgs::msg::PointCloud2>>(0.0, config_, publisher_);
 
   52   rclcpp::executors::SingleThreadedExecutor::SharedPtr 
executor_;
 
   53   agnocast_wrapper::PublisherPtr<sensor_msgs::msg::PointCloud2> 
publisher_;
 
   54   agnocast_wrapper::SubscriptionPtr<sensor_msgs::msg::PointCloud2> 
subscription_;
 
   58   std::unique_ptr<LidarSensorBase> 
lidar_;
 
   59   simulation_api_schema::LidarConfiguration 
config_;
 
   60   agnocast_wrapper::MessagePtr<sensor_msgs::msg::PointCloud2> 
received_msg_;
 
   62   double current_simulation_time_{1.0};
 
   63   rclcpp::Time current_ros_time_{1};
 
   66   auto initializeEntityStatuses() -> 
void 
   71       "ego", EntityType::EGO, 
utils::makePose(5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0), dimensions);
 
   73       "other1", EntityType::VEHICLE, 
utils::makePose(-3.0, -3.0, 0.0, 0.0, 0.0, 0.0, 1.0),
 
   76       "other2", EntityType::VEHICLE, 
utils::makePose(5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0),
 
   79     status_ = {ego_status, other1_status, other2_status};
 
   82   auto makeRosInterface() -> 
void 
   85       agnocast_wrapper::create_publisher<sensor_msgs::msg::PointCloud2>(node_, 
"lidar_output", 10);
 
   86     subscription_ = agnocast_wrapper::create_subscription<sensor_msgs::msg::PointCloud2>(
 
   87       node_, 
"lidar_output", 10,
 
   88       [
this](
const agnocast_wrapper::MessagePtr<sensor_msgs::msg::PointCloud2> msg) {
 
Definition: test_lidar_sensor.hpp:33
agnocast_wrapper::MessagePtr< sensor_msgs::msg::PointCloud2 > received_msg_
Definition: test_lidar_sensor.hpp:60
agnocast_wrapper::SubscriptionPtr< sensor_msgs::msg::PointCloud2 > subscription_
Definition: test_lidar_sensor.hpp:54
std::unique_ptr< LidarSensorBase > lidar_
Definition: test_lidar_sensor.hpp:58
rclcpp::executors::SingleThreadedExecutor::SharedPtr executor_
Definition: test_lidar_sensor.hpp:52
~LidarSensorTest()
Definition: test_lidar_sensor.hpp:49
std::vector< EntityStatus > status_
Definition: test_lidar_sensor.hpp:56
agnocast_wrapper::PublisherPtr< sensor_msgs::msg::PointCloud2 > publisher_
Definition: test_lidar_sensor.hpp:53
rclcpp::Node::SharedPtr node_
Definition: test_lidar_sensor.hpp:51
LidarSensorTest()
Definition: test_lidar_sensor.hpp:35
simulation_api_schema::LidarConfiguration config_
Definition: test_lidar_sensor.hpp:59
Definition: constants.hpp:19
Definition: helper_functions.hpp:35
auto makePose(const double px, const double py, const double pz, const double ox, const double oy, const double oz, const double ow) -> geometry_msgs::msg::Pose
Definition: helper_functions.hpp:45
auto constructLidarConfiguration(const std::string &entity, const std::string &architecture_type, const double lidar_sensor_delay, const double horizontal_resolution) -> const simulation_api_schema::LidarConfiguration
Definition: helper_functions.hpp:60
auto makeEntity(const std::string &name, const EntityType::Enum type, const EntitySubtype::Enum subtype, const geometry_msgs::msg::Pose &pose, const geometry_msgs::msg::Vector3 &dimensions) -> EntityStatus
Definition: helper_functions.hpp:125
auto makeDimensions(const double x, const double y, const double z) -> geometry_msgs::msg::Vector3
Definition: helper_functions.hpp:54