Voss Connection Detection  1
Detect a connector click using realtime code on Bela hardware
gyro.h
Go to the documentation of this file.
1 #pragma once
2 #include <array>
3 #include <Bela.h>
4 
5 class ICM20948; // Forward declaration, no definition required here.
9 class Gyro {
13  unsigned int _gTaskSleepTime = 1000; // microseconds
14  ICM20948* _gyro;
15  AuxiliaryTask _task;
16 
21  void loop();
22 
23  public:
24 
30  Gyro(BelaContext* ctx);
42  bool error() const;
43 
47  void resetError();
48 
56  std::array<float, 6> get_raw() const;
57 
63  std::array<float, 2> get_abs() const;
64 
65 
66  friend void raw_gyro_auxtask_callback(void* gyro_ptr);
67 
68 };
Gyro::error
bool error() const
Returns whether an error occured during the last readout of the IMU sensor.
Definition: gyro.cpp:49
Gyro::get_abs
std::array< float, 2 > get_abs() const
Get the absolute values of the acceleration and rotation speed. Scaled such that the value is always ...
Definition: gyro.cpp:33
Gyro::get_raw
std::array< float, 6 > get_raw() const
Get the current values of the gyroscope, the first three are the angular velocities,...
Definition: gyro.cpp:21
Gyro
Readout of IMU sensor data.
Definition: gyro.h:9
Gyro::raw_gyro_auxtask_callback
friend void raw_gyro_auxtask_callback(void *gyro_ptr)
Definition: gyro.cpp:5
Gyro::resetError
void resetError()
Reset a previous found error in the sensor.
Definition: gyro.cpp:52
Gyro::Gyro
Gyro(BelaContext *ctx)
Initialze Gyro class.
Definition: gyro.cpp:10
ICM20948
Definition: ICM20948.h:31