28 #ifndef CLOE_COMPONENT_OBJECT_SENSOR_FUNCTIONAL_HPP_ 29 #define CLOE_COMPONENT_OBJECT_SENSOR_FUNCTIONAL_HPP_ 54 using ObjectFilterMap = std::function<std::shared_ptr<Object>(
const std::shared_ptr<Object>&)>;
94 :
ObjectSensor(
"object_sensor_filter"), sensor_(obs), filter_func_(f) {}
103 for (
auto o : sensor_->sensed_objects()) {
104 if (filter_func_(*o)) {
105 objects_.push_back(o);
115 const Eigen::Isometry3d&
mount_pose()
const override {
return sensor_->mount_pose(); }
129 if (t < sync.
time()) {
134 t = sensor_->process(sync);
157 mutable bool cached_;
159 std::shared_ptr<ObjectSensor> sensor_;
184 for (
auto o : sensor_->sensed_objects()) {
185 auto obj = map_func_(o);
187 objects_.push_back(obj);
197 const Eigen::Isometry3d&
mount_pose()
const override {
return sensor_->mount_pose(); }
211 if (t < sync.
time()) {
216 t = sensor_->process(sync);
233 virtual void clear_cache() {
239 mutable bool cached_;
241 std::shared_ptr<ObjectSensor> sensor_;
247 #endif // CLOE_COMPONENT_OBJECT_SENSOR_FUNCTIONAL_HPP_ const Frustum & frustum() const override
Definition: object_sensor_functional.hpp:113
Definition: object_sensor_functional.hpp:174
void abort() override
Definition: object_sensor_functional.hpp:227
virtual Duration time() const =0
Duration process(const Sync &sync) override
Definition: object_sensor_functional.hpp:125
void reset() override
Definition: object_sensor_functional.hpp:139
const Objects & sensed_objects() const override
Definition: object_sensor_functional.hpp:182
std::vector< std::shared_ptr< Object > > Objects
Definition: object.hpp:111
std::function< bool(const Object &)> ObjectFilter
Definition: object_sensor_functional.hpp:44
Definition: frustum.hpp:37
Definition: coordinator.hpp:36
Duration process(const Sync &sync) override
Definition: component.hpp:182
std::chrono::nanoseconds Duration
Definition: duration.hpp:45
Definition: object_sensor.hpp:33
std::function< std::shared_ptr< Object >(const std::shared_ptr< Object > &)> ObjectFilterMap
Definition: object_sensor_functional.hpp:54
void abort() override
Definition: object_sensor_functional.hpp:145
Duration process(const Sync &sync) override
Definition: object_sensor_functional.hpp:207
const Eigen::Isometry3d & mount_pose() const override
Definition: object_sensor_functional.hpp:197
const Objects & sensed_objects() const override
Definition: object_sensor_functional.hpp:101
const Frustum & frustum() const override
Definition: object_sensor_functional.hpp:195
void abort() override
Definition: component.hpp:192
std::string name() const
Definition: entity.hpp:68
const Eigen::Isometry3d & mount_pose() const override
Definition: object_sensor_functional.hpp:115
void reset() override
Definition: component.hpp:187
void reset() override
Definition: object_sensor_functional.hpp:221
Definition: object_sensor_functional.hpp:91