Class for modelling sensors. The interface follows closely the interface exposed by Webots see: https://cyberbotics.com/doc/guide/sensors In this token a Sensor is a Device and has:
More...
#include <sensor_base.h>
|
| std::vector< real_t > | values_ |
| | The values last read by the sensor.
|
| |
Class for modelling sensors. The interface follows closely the interface exposed by Webots see: https://cyberbotics.com/doc/guide/sensors In this token a Sensor is a Device and has:
- sampling period
- enabled/disabled
- Last value
- Sensor units Implementations can utilize noise and resolution.
◆ ~SensorBase()
| virtual bitrl::sensors::SensorBase::~SensorBase |
( |
| ) |
|
|
virtualdefault |
◆ SensorBase()
| bitrl::sensors::SensorBase::SensorBase |
( |
const std::string & |
sensor_type, |
|
|
const std::string & |
sensor_name = bitrl::consts::INVALID_STR |
|
) |
| |
|
inlineexplicitprotected |
- Parameters
-
| sensor_type | The type of the sensor |
◆ backend_type_str()
| std::string bitrl::sensors::SensorBase::backend_type_str |
( |
| ) |
const |
|
pure virtual |
◆ disable()
| void bitrl::sensors::SensorBase::disable |
( |
| ) |
|
|
inlinenoexcept |
◆ enable()
| void bitrl::sensors::SensorBase::enable |
( |
| ) |
|
|
inlinenoexcept |
Set the is_enabled_ flag to true.
◆ init()
| virtual void bitrl::sensors::SensorBase::init |
( |
| ) |
|
|
pure virtual |
Initialize the sensor. Set the is is_enabled_ flag to true. and performs any other initializations required by the sensor.
Implemented in bitrl::sensors::UltrasonicSensor.
◆ is_enabled()
| bool bitrl::sensors::SensorBase::is_enabled |
( |
| ) |
const |
|
inlinenoexcept |
Returns true if the sensor is enabled.
- Returns
◆ last_read_values()
| const std::vector< real_t > & bitrl::sensors::SensorBase::last_read_values |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Read reference to the last values read by the sensor
◆ read_values()
| virtual const std::vector< real_t > & bitrl::sensors::SensorBase::read_values |
( |
| ) |
|
|
pure virtual |
◆ sensor_name()
| std::string bitrl::sensors::SensorBase::sensor_name |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- An instance of std::string with the name of the sensor
◆ sensor_type()
| std::string bitrl::sensors::SensorBase::sensor_type |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- An instance of std::string with the type of the sensor
◆ sensor_units()
| std::string bitrl::sensors::SensorBase::sensor_units |
( |
| ) |
const |
|
pure virtual |
◆ set_sensor_name()
| void bitrl::sensors::SensorBase::set_sensor_name |
( |
const std::string & |
sensor_name | ) |
|
|
inlinenoexcept |
Set the sensor name.
- Parameters
-
| sensor_name | The sensor name to set |
◆ values_
| std::vector<real_t> bitrl::sensors::SensorBase::values_ |
|
protected |
The values last read by the sensor.
The documentation for this class was generated from the following files: