15 #ifndef SIMPLE_SENSOR_SIMULATOR__SIMPLE_SENSOR_SIMULATOR_HPP_
16 #define SIMPLE_SENSOR_SIMULATOR__SIMPLE_SENSOR_SIMULATOR_HPP_
18 #include <tf2/LinearMath/Quaternion.h>
19 #include <tf2_ros/transform_broadcaster.h>
21 #include <geographic_msgs/msg/geo_point.hpp>
22 #include <geometry_msgs/msg/pose_stamped.hpp>
23 #include <geometry_msgs/msg/transform_stamped.hpp>
26 #include <rclcpp/rclcpp.hpp>
36 #include <visualization_msgs/msg/marker_array.hpp>
44 #if defined _WIN32 || defined __CYGWIN__
46 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_EXPORT __attribute__((dllexport))
47 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_IMPORT __attribute__((dllimport))
49 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_EXPORT __declspec(dllexport)
50 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_IMPORT __declspec(dllimport)
52 #ifdef SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_BUILDING_DLL
53 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC \
54 SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_EXPORT
56 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC \
57 SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_IMPORT
59 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC_TYPE \
60 SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC
61 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_LOCAL
63 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_EXPORT \
64 __attribute__((visibility("default")))
65 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_IMPORT
67 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC \
68 __attribute__((visibility("default")))
69 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_LOCAL \
70 __attribute__((visibility("hidden")))
72 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC
73 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_LOCAL
75 #define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC_TYPE
93 auto initialize(
const simulation_api_schema::InitializeRequest &)
94 -> simulation_api_schema::InitializeResponse;
96 auto updateFrame(
const simulation_api_schema::UpdateFrameRequest &)
97 -> simulation_api_schema::UpdateFrameResponse;
99 auto updateStepTime(
const simulation_api_schema::UpdateStepTimeRequest &)
100 -> simulation_api_schema::UpdateStepTimeResponse;
102 auto updateEntityStatus(
const simulation_api_schema::UpdateEntityStatusRequest &)
103 -> simulation_api_schema::UpdateEntityStatusResponse;
105 auto spawnVehicleEntity(
const simulation_api_schema::SpawnVehicleEntityRequest &)
106 -> simulation_api_schema::SpawnVehicleEntityResponse;
108 template <
typename SpawnRequestType>
109 auto insertEntitySpawnedStatus(
110 const SpawnRequestType & spawn_request,
const traffic_simulator_msgs::EntityType::Enum & type,
111 const traffic_simulator_msgs::EntitySubtype::Enum & subtype) -> void;
113 auto spawnPedestrianEntity(
const simulation_api_schema::SpawnPedestrianEntityRequest &)
114 -> simulation_api_schema::SpawnPedestrianEntityResponse;
116 auto spawnMiscObjectEntity(
const simulation_api_schema::SpawnMiscObjectEntityRequest &)
117 -> simulation_api_schema::SpawnMiscObjectEntityResponse;
119 auto despawnEntity(
const simulation_api_schema::DespawnEntityRequest &)
120 -> simulation_api_schema::DespawnEntityResponse;
122 auto attachImuSensor(
const simulation_api_schema::AttachImuSensorRequest &)
123 -> simulation_api_schema::AttachImuSensorResponse;
125 auto attachDetectionSensor(
const simulation_api_schema::AttachDetectionSensorRequest &)
126 -> simulation_api_schema::AttachDetectionSensorResponse;
128 auto attachLidarSensor(
const simulation_api_schema::AttachLidarSensorRequest &)
129 -> simulation_api_schema::AttachLidarSensorResponse;
131 auto attachOccupancyGridSensor(
const simulation_api_schema::AttachOccupancyGridSensorRequest &)
132 -> simulation_api_schema::AttachOccupancyGridSensorResponse;
134 auto updateTrafficLights(
const simulation_api_schema::UpdateTrafficLightsRequest &)
135 -> simulation_api_schema::UpdateTrafficLightsResponse;
137 auto attachPseudoTrafficLightDetector(
138 const simulation_api_schema::AttachPseudoTrafficLightDetectorRequest &)
139 -> simulation_api_schema::AttachPseudoTrafficLightDetectorResponse;
143 std::vector<traffic_simulator_msgs::VehicleParameters> ego_vehicles_;
144 std::vector<traffic_simulator_msgs::VehicleParameters> vehicles_;
145 std::vector<traffic_simulator_msgs::PedestrianParameters> pedestrians_;
146 std::vector<traffic_simulator_msgs::MiscObjectParameters> misc_objects_;
147 double realtime_factor_;
149 double current_simulation_time_;
150 double current_scenario_time_;
151 rclcpp::Time current_ros_time_;
153 std::map<std::string, simulation_api_schema::EntityStatus> entity_status_;
154 simulation_api_schema::UpdateTrafficLightsRequest traffic_signals_states_;
155 traffic_simulator_msgs::BoundingBox getBoundingBox(
const std::string & name);
157 geographic_msgs::msg::GeoPoint getOrigin();
158 std::shared_ptr<hdmap_utils::HdMapUtils> hdmap_utils_;
159 std::shared_ptr<vehicle_simulation::EgoEntitySimulation> ego_entity_simulation_;
Definition: simple_sensor_simulator.hpp:84
~ScenarioSimulator()
Definition: simple_sensor_simulator.cpp:70
SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC ScenarioSimulator(const rclcpp::NodeOptions &options)
Definition: simple_sensor_simulator.cpp:30
Definition: sensor_simulation.hpp:35
Definition: zmq_multi_server.hpp:32
Definition: constants.hpp:19
std::string string
Definition: junit5.hpp:26
#define SIMPLE_SENSOR_SIMULATOR_SIMPLE_SENSOR_SIMULATOR_COMPONENT_PUBLIC
Definition: simple_sensor_simulator.hpp:72