Class proximity_sensor

Inheritance Relationships

Base Types

  • public rer::client< proximity_sensor >

  • public chal::sensors::base_sensor< proximity_sensor_impl_type >

Class Documentation

class proximity_sensor : public rer::client<proximity_sensor>, public chal::sensors::base_sensor<proximity_sensor_impl_type>

Proxmity sensor wrapper to provide a uniform interface to sensing “is

there something near me” regardless of robot and platform. Provides some additional higher level functionality beyond raw sensor readings too.

Public Types

using impl_type = chsensors::base_sensor<proximity_sensor_impl_type>

Public Functions

proximity_sensor(const proximity_sensor&) = delete
proximity_sensor(proximity_sensor&&) = default
inline boost::optional<rmath::vector2d> avg_prox_obj(void) const

Return the average object reading within proximity for the robot. Proximity is defined as within the “go straight” angle range for the robot.

If there are not enough objects meeting this criteria that are close enough such that the average distance to them is > than the provided delta, nothing is returned.

inline void disable(void) override
inline void enable(void) override
inline bool is_enabled(void) const override
proximity_sensor &operator=(const proximity_sensor&) = delete
proximity_sensor &operator=(proximity_sensor&&) = default
inline std::vector<proximity_sensor_reading> readings(void) const
inline void reset(void) override