|
bitsim
Model, simulate, estimate and control robots in C++
|
Class for modelling sensors. A sensor is a device and has: More...
#include <sensor_base.h>

Public Member Functions | |
| virtual | ~SensorBase ()=default |
| Destructor. | |
| virtual void | init ()=0 |
| 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 ()=0 |
| virtual std::string | backend_type_str () const =0 |
| virtual std::string | sensor_units () const =0 |
| 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 |
| virtual std::shared_ptr< backends::SensorBackendBase > | backend_ptr () const |
Protected Member Functions | |
| SensorBase (const std::string &sensor_type, const std::string &sensor_name=bitsim::consts::INVALID_STR) | |
Protected Attributes | |
| 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 sensors. A sensor is a device and has:
|
virtualdefault |
Destructor.
|
inlineexplicitprotected |
| sensor_type | The type of the sensor |
| sensor_name | The name of the sensor |
|
inlinevirtual |
Reimplemented in bitsim::sensors::IMUSensor, bitsim::sensors::InfraredSensor, bitsim::sensors::UltrasonicSensor, ekf_sensor_fusion::IMUSensor, ekf_sensor_fusion::InfraredSensor, ekf_sensor_fusion::UltrasonicSensor, imu_heading::IMUSensor, imu_heading::InfraredSensor, imu_heading::UltrasonicSensor, line_following_infrared_sonar::InfraredSensor, line_following_infrared_sonar::UltrasonicSensor, wheel_odometry::IMUSensor, wheel_odometry::InfraredSensor, and wheel_odometry::UltrasonicSensor.
|
pure virtual |
Implemented in bitsim::sensors::IMUSensor, bitsim::sensors::InfraredSensor, bitsim::sensors::UltrasonicSensor, ekf_sensor_fusion::IMUSensor, ekf_sensor_fusion::InfraredSensor, ekf_sensor_fusion::UltrasonicSensor, imu_heading::IMUSensor, imu_heading::InfraredSensor, imu_heading::UltrasonicSensor, line_following_infrared_sonar::InfraredSensor, line_following_infrared_sonar::UltrasonicSensor, wheel_odometry::IMUSensor, wheel_odometry::InfraredSensor, and wheel_odometry::UltrasonicSensor.
|
inlinenoexcept |
Disable the sensor.
|
inlinenoexcept |
Set the is_enabled_ flag to true.
|
pure virtual |
Initialize the sensor. Set the is is_enabled_ flag to true. and performs any other initializations required by the sensor.
Implemented in bitsim::sensors::IMUSensor, bitsim::sensors::InfraredSensor, bitsim::sensors::UltrasonicSensor, ekf_sensor_fusion::IMUSensor, ekf_sensor_fusion::InfraredSensor, ekf_sensor_fusion::UltrasonicSensor, imu_heading::IMUSensor, imu_heading::InfraredSensor, imu_heading::UltrasonicSensor, line_following_infrared_sonar::InfraredSensor, line_following_infrared_sonar::UltrasonicSensor, wheel_odometry::IMUSensor, wheel_odometry::InfraredSensor, and wheel_odometry::UltrasonicSensor.
|
inlinenoexcept |
Returns true if the sensor is enabled.
|
inlinenoexcept |
|
pure virtual |
Implemented in bitsim::sensors::IMUSensor, bitsim::sensors::InfraredSensor, bitsim::sensors::UltrasonicSensor, ekf_sensor_fusion::IMUSensor, ekf_sensor_fusion::InfraredSensor, ekf_sensor_fusion::UltrasonicSensor, imu_heading::IMUSensor, imu_heading::InfraredSensor, imu_heading::UltrasonicSensor, line_following_infrared_sonar::InfraredSensor, line_following_infrared_sonar::UltrasonicSensor, wheel_odometry::IMUSensor, wheel_odometry::InfraredSensor, and wheel_odometry::UltrasonicSensor.
|
inlinenoexcept |
|
inlinenoexcept |
|
pure virtual |
Implemented in bitsim::sensors::IMUSensor, bitsim::sensors::InfraredSensor, bitsim::sensors::UltrasonicSensor, ekf_sensor_fusion::IMUSensor, ekf_sensor_fusion::InfraredSensor, ekf_sensor_fusion::UltrasonicSensor, imu_heading::IMUSensor, imu_heading::InfraredSensor, imu_heading::UltrasonicSensor, line_following_infrared_sonar::InfraredSensor, line_following_infrared_sonar::UltrasonicSensor, wheel_odometry::IMUSensor, wheel_odometry::InfraredSensor, and wheel_odometry::UltrasonicSensor.
|
inlinenoexcept |
Set the sensor name.
| sensor_name | The sensor name to set |
|
protected |
Pointer to backend tha actually handles the sensor.
|
protected |
The values last read by the sensor.