Skip to content

Commit fc75ea1

Browse files
clssncassava
authored andcommitted
nop: Provide a NopLaneSensor component
1 parent f9b60c2 commit fc75ea1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

engine/src/plugins/nop_simulator.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <vector> // for vector<>
2929

3030
#include <cloe/component/ego_sensor.hpp> // for NopEgoSensor
31+
#include <cloe/component/lane_sensor.hpp> // for NopLaneSensor
3132
#include <cloe/component/latlong_actuator.hpp> // for LatLongActuator
3233
#include <cloe/component/object_sensor.hpp> // for NopObjectSensor
3334
#include <cloe/handler.hpp> // for ToJson
@@ -51,6 +52,9 @@ struct NopVehicle : public Vehicle {
5152
CloeComponent::DEFAULT_WORLD_SENSOR);
5253
this->new_component(new LatLongActuator(),
5354
CloeComponent::DEFAULT_LATLONG_ACTUATOR);
55+
this->new_component(new NopLaneSensor(),
56+
CloeComponent::GROUNDTRUTH_LANE_SENSOR,
57+
CloeComponent::DEFAULT_LANE_SENSOR);
5458
// clang-format on
5559
}
5660
};

models/include/cloe/component/lane_sensor.hpp

+14
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ class LaneBoundarySensor : public Component {
6262
}
6363
};
6464

65+
class NopLaneSensor : public LaneBoundarySensor {
66+
public:
67+
NopLaneSensor() : LaneBoundarySensor("nop_lane_sensor") {}
68+
virtual ~NopLaneSensor() = default;
69+
const LaneBoundaries& sensed_lane_boundaries() const override { return lane_boundaries_; }
70+
const Frustum& frustum() const override { return frustum_; }
71+
const Eigen::Isometry3d& mount_pose() const override { return mount_pose_; }
72+
73+
private:
74+
LaneBoundaries lane_boundaries_;
75+
Frustum frustum_;
76+
Eigen::Isometry3d mount_pose_;
77+
};
78+
6579
} // namespace cloe
6680

6781
#endif // CLOE_COMPONENT_LANE_SENSOR_HPP_

0 commit comments

Comments
 (0)