|
bitsim
Model, simulate, estimate and control robots in C++
|
An inertial measurement unit: a three axis accelerometer and a three axis gyroscope, along the axes of the body it is on. More...
#include <imu_sensor.h>


Public Member Functions | |
| IMUSensor (std::shared_ptr< backends::IMUBackendBase > backend, const std::string &name=consts::INVALID_STR) | |
| void | init () override |
| Enable the sensor, reading zeros until the first read. | |
| const std::vector< real_t > & | read_values () override |
| Read the backend, if the sensor is enabled. | |
| std::string | backend_type_str () const override |
| std::string | sensor_units () const override |
| std::shared_ptr< backends::SensorBackendBase > | backend_ptr () const override |
| std::shared_ptr< backends::IMUBackendBase > | imu_backend () const noexcept |
| std::array< real_t, 3 > | acceleration () const |
| std::array< real_t, 3 > | angular_velocity () 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< IMUSensor > | create (const std::string &backend_type, const std::string &name) |
| A sensor with a new backend of the given type, see backends::IMUBackendBase::create. | |
Static Public Attributes | |
| static const std::string | SENSOR_TYPE = "IMUSensor" |
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. | |
An inertial measurement unit: a three axis accelerometer and a three axis gyroscope, along the axes of the body it is on.
read_values() gives six values: the specific force [m/s^2], then the angular velocity [rad/s]; see backends::IMUBackendBase. acceleration() and angular_velocity() pick them out of the last read. backends::CHRONO_IMUBackend simulates the IMU, and backends::MQTT_IMUBackend reads a real one on a board.
|
explicit |
| std::array< real_t, 3 > bitsim::sensors::IMUSensor::acceleration | ( | ) | const |
| std::array< real_t, 3 > bitsim::sensors::IMUSensor::angular_velocity | ( | ) | const |
|
inlineoverridevirtual |
Reimplemented from bitsim::sensors::SensorBase.
|
inlineoverridevirtual |
Implements bitsim::sensors::SensorBase.
|
static |
A sensor with a new backend of the given type, see backends::IMUBackendBase::create.
|
inlinenoexcept |
|
overridevirtual |
Enable the sensor, reading zeros until the first read.
Implements bitsim::sensors::SensorBase.
|
overridevirtual |
Read the backend, if the sensor is enabled.
Implements bitsim::sensors::SensorBase.
|
inlineoverridevirtual |
Implements bitsim::sensors::SensorBase.
|
static |