28 #include <Eigen/Geometry>
30 #include <esminiLib.hpp>
33 #include <cloe/utility/osi_message_handler.hpp>
34 #include <cloe/utility/osi_transceiver.hpp>
39 namespace cloe_esmini {
52 if (update_static_ground_truth_) {
53 ierr += SE_UpdateOSIStaticGroundTruth();
54 update_static_ground_truth_ =
false;
57 ierr += SE_UpdateOSIDynamicGroundTruth(
false);
75 throw cloe::ModelError(
"ESMiniOsiReceiver: SensorView is currently not supported.");
83 esmini_logger()->warn(
84 "ESMiniOsiReceiver: Non-zero length of message vector before retrieval: {}", msgs.size());
87 const auto* sd =
reinterpret_cast<const osi3::SensorData*
>(SE_GetOSISensorDataRaw());
88 if (!sd->has_timestamp()) {
91 msgs.push_back(std::make_shared<osi3::SensorData>(*sd));
98 void receive_osi_msgs(std::vector<std::shared_ptr<osi3::GroundTruth>>& msgs)
override {
100 esmini_logger()->warn(
101 "ESMiniOsiReceiver: Non-zero length of message vector before retrieval: {}", msgs.size());
105 auto gt = *
reinterpret_cast<const osi3::GroundTruth*
>(SE_GetOSIGroundTruthRaw());
106 if (!gt.has_timestamp()) {
109 msgs.push_back(std::make_shared<osi3::GroundTruth>(std::move(gt)));
113 void clear_cache()
override {
121 void to_json(cloe::Json& j)
const override {
128 mutable bool update_static_ground_truth_{
true};
148 ESMiniEnvData::clear_cache();
153 "ESMiniOsiSensor: ESMini data at wrong timestamp. Expected: {}. Actual: {}.",
159 void store_object(std::shared_ptr<cloe::Object> obj)
override {
world_objects_.push_back(obj); }
163 void store_ego_object(std::shared_ptr<cloe::Object> ego_obj)
override {
ego_object_ = ego_obj; }
165 void store_sensor_meta_data(
const Eigen::Vector3d& bbcenter_to_veh_origin,
166 const Eigen::Vector3d& ego_dimensions)
override {
168 (void)bbcenter_to_veh_origin;
169 (void)ego_dimensions;
177 const Eigen::Vector3d& ego_dimensions)
override {
178 Eigen::Isometry3d mount_osi =
mount_;
181 mount_osi.translation().z() =
182 mount_osi.translation().z() - (0.5 * ego_dimensions(2) + bbcenter_to_veh_origin(2));
189 void set_mock_conf(std::shared_ptr<const cloe::utility::SensorMockConf> mock)
override {
195 ESMiniEnvData::clear_cache();
202 {
"osi_connection", s.osi_comm_},
Definition: lane_boundary.hpp:36
virtual Duration time() const =0
virtual Duration step_width() const =0
Definition: esmini_world_data.hpp:36
virtual void set_reset_state()
Definition: esmini_world_data.hpp:81
cloe::LaneBoundaries lanes_
Lane id-to-boundary-map.
Definition: esmini_world_data.hpp:141
cloe::Objects world_objects_
World objects from last processed frame.
Definition: esmini_world_data.hpp:132
Eigen::Isometry3d mount_
Sensor mounting position and orientation.
Definition: esmini_world_data.hpp:126
bool restart_
Indicates whether reset has been requested.
Definition: esmini_world_data.hpp:117
cloe::Duration env_data_time_next_
Expected simulation time for next data message.
Definition: esmini_world_data.hpp:123
cloe::Duration env_data_time_
Simulation time from last processed data message.
Definition: esmini_world_data.hpp:120
std::shared_ptr< cloe::Object > ego_object_
ego object information from last processed frame.
Definition: esmini_world_data.hpp:135
Definition: esmini_osi_sensor.hpp:41
bool has_ground_truth() const override
Definition: esmini_osi_sensor.hpp:50
bool has_sensor_view() const override
Definition: esmini_osi_sensor.hpp:64
void receive_osi_msgs(std::vector< std::shared_ptr< osi3::GroundTruth >> &msgs) override
Definition: esmini_osi_sensor.hpp:98
void receive_osi_msgs(std::vector< std::shared_ptr< osi3::SensorView >> &) override
Definition: esmini_osi_sensor.hpp:74
bool has_sensor_data() const override
Definition: esmini_osi_sensor.hpp:69
void receive_osi_msgs(std::vector< std::shared_ptr< osi3::SensorData >> &msgs) override
Definition: esmini_osi_sensor.hpp:81
Definition: esmini_osi_sensor.hpp:138
Eigen::Isometry3d get_static_mounting_position(const Eigen::Vector3d &bbcenter_to_veh_origin, const Eigen::Vector3d &ego_dimensions) override
Definition: esmini_osi_sensor.hpp:176
void set_mock_conf(std::shared_ptr< const cloe::utility::SensorMockConf > mock) override
Definition: esmini_osi_sensor.hpp:189
void reset() override
Definition: esmini_osi_sensor.hpp:194
void step(const cloe::Sync &s) override
Definition: esmini_osi_sensor.hpp:147