|
bitsim
Model, simulate, estimate and control robots in C++
|
Class for modelling ultrasonic sensors. More...
#include <ultrasonic_sensor.h>


Public Member Functions | |
| UltrasonicSensor (std::shared_ptr< bitsim::sensors::backends::RangeSensorBackendBase > backend, const std::string name=bitsim::consts::INVALID_STR) | |
| Constructor. | |
| virtual void | init () |
| Initialize the sensor. Set the is is_enabled_ flag to true. and performs any other initializations required by the sensor. | |
| virtual const std::vector< real_t > & | read_values () |
| Reads the sensor values and updates the values held internally. | |
| virtual std::string | backend_type_str () const |
| virtual std::string | sensor_units () const |
| virtual std::shared_ptr< backends::SensorBackendBase > | backend_ptr () const override |
| std::shared_ptr< backends::RangeSensorBackendBase > | range_backend () const noexcept |
| real_t | distance () const |
| Public Member Functions inherited from bitsim::sensors::SensorBase | |
| virtual | ~SensorBase ()=default |
| Destructor. | |
| bool | is_enabled () const noexcept |
| Returns true if the sensor is enabled. | |
| void | enable () noexcept |
| Set the is_enabled_ flag to true. | |
| void | disable () noexcept |
| Disable the sensor. | |
| const std::vector< real_t > & | last_read_values () const noexcept |
| std::string | sensor_name () const noexcept |
| void | set_sensor_name (const std::string &sensor_name) noexcept |
| Set the sensor name. | |
| std::string | sensor_type () const noexcept |
Static Public Member Functions | |
| static std::shared_ptr< UltrasonicSensor > | create (const std::string &backend_type, const std::string &name) |
Static Public Attributes | |
| static const std::string | SENSOR_TYPE = "UltrasonicSensor" |
| The type of the sensor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from bitsim::sensors::SensorBase | |
| SensorBase (const std::string &sensor_type, const std::string &sensor_name=bitsim::consts::INVALID_STR) | |
| Protected Attributes inherited from bitsim::sensors::SensorBase | |
| std::vector< real_t > | values_ |
| The values last read by the sensor. | |
| std::shared_ptr< backends::SensorBackendBase > | backend_ptr_ |
| Pointer to backend tha actually handles the sensor. | |
Class for modelling ultrasonic sensors.
|
inlineexplicit |
Constructor.
| backend | The backend that measures the range |
| name | The name of the sensor |
|
inlineoverridevirtual |
Reimplemented from bitsim::sensors::SensorBase.
|
inlinevirtual |
Implements bitsim::sensors::SensorBase.
|
static |
| backend_type | |
| name |
|
inline |
|
virtual |
Initialize the sensor. Set the is is_enabled_ flag to true. and performs any other initializations required by the sensor.
Implements bitsim::sensors::SensorBase.
|
inlinenoexcept |
|
virtual |
Reads the sensor values and updates the values held internally.
Implements bitsim::sensors::SensorBase.
|
inlinevirtual |
Implements bitsim::sensors::SensorBase.
|
static |
The type of the sensor.