An array of infrared reflectance elements that looks at the floor, to tell its colour: light paper or a dark line.
More...
#include <infrared_sensor.h>
|
| static const std::string | SENSOR_TYPE = "InfraredSensor" |
| | The type of the sensor.
|
An array of infrared reflectance elements that looks at the floor, to tell its colour: light paper or a dark line.
read_values() gives the reflectance under each element, from 0 for black to 1 for white. An element whose reflectance is below threshold() is over something dark; see is_dark(). Where the values come from is up to the backend: backends::CHRONO_InfraredBackend simulates the elements, and backends::MQTT_InfraredBackend reads real ones on a board.
◆ InfraredSensor()
◆ backend_ptr()
◆ backend_type_str()
| std::string bitsim::sensors::InfraredSensor::backend_type_str |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ create()
| std::shared_ptr< InfraredSensor > bitsim::sensors::InfraredSensor::create |
( |
const std::string & | backend_type, |
|
|
const std::string & | name ) |
|
static |
◆ infrared_backend()
- Returns
- The backend, with the positions of the elements
◆ init()
| void bitsim::sensors::InfraredSensor::init |
( |
| ) |
|
|
overridevirtual |
◆ is_dark()
| bool bitsim::sensors::InfraredSensor::is_dark |
( |
uint_t | i | ) |
const |
- Returns
- True if element i was over something dark at the last read
◆ line_position()
| std::optional< std::array< real_t, 2 > > bitsim::sensors::InfraredSensor::line_position |
( |
| ) |
const |
- Returns
- Where the line is under the elements, in the body's frame [m]: the mean of the positions of the elements that see it, x and y; nothing if none does
◆ n_elements()
| uint_t bitsim::sensors::InfraredSensor::n_elements |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- The number of elements
◆ pattern()
| std::string bitsim::sensors::InfraredSensor::pattern |
( |
| ) |
const |
- Returns
- Which elements are over something dark, left to right: "#" for dark and "." for light, such as ".#." with the line under the middle element
◆ read_values()
| const std::vector< real_t > & bitsim::sensors::InfraredSensor::read_values |
( |
| ) |
|
|
overridevirtual |
◆ sensor_units()
| std::string bitsim::sensors::InfraredSensor::sensor_units |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ set_threshold()
| void bitsim::sensors::InfraredSensor::set_threshold |
( |
real_t | threshold | ) |
|
◆ threshold()
| real_t bitsim::sensors::InfraredSensor::threshold |
( |
| ) |
const |
|
inlinenoexcept |
Reflectances below this are dark.
◆ SENSOR_TYPE
| const std::string bitsim::sensors::InfraredSensor::SENSOR_TYPE = "InfraredSensor" |
|
static |
The documentation for this class was generated from the following files: