Voss Connection Detection  1
Detect a connector click using realtime code on Bela hardware
Gyro Class Reference

Readout of IMU sensor data. More...

#include <gyro.h>

Public Member Functions

 Gyro (BelaContext *ctx)
 Initialze Gyro class. More...
 
bool error () const
 Returns whether an error occured during the last readout of the IMU sensor. More...
 
void resetError ()
 Reset a previous found error in the sensor. More...
 
std::array< float, 6 > get_raw () const
 Get the current values of the gyroscope, the first three are the angular velocities, scaled between -1.0 and 1.0, and the second three are the accelerations. More...
 
std::array< float, 2 > get_abs () const
 Get the absolute values of the acceleration and rotation speed. Scaled such that the value is always between 0 and 1. More...
 

Friends

void raw_gyro_auxtask_callback (void *gyro_ptr)
 

Detailed Description

Readout of IMU sensor data.

Definition at line 9 of file gyro.h.

Constructor & Destructor Documentation

◆ Gyro()

Gyro::Gyro ( BelaContext *  ctx)

Initialze Gyro class.

Parameters
ctxBelaContext

Definition at line 10 of file gyro.cpp.

Member Function Documentation

◆ error()

bool Gyro::error ( ) const

Returns whether an error occured during the last readout of the IMU sensor.

Returns
true on error, else false.

Returns whether an error occured.

Returns
true on error, else false

Definition at line 49 of file gyro.cpp.

◆ get_abs()

std::array< float, 2 > Gyro::get_abs ( ) const

Get the absolute values of the acceleration and rotation speed. Scaled such that the value is always between 0 and 1.

Returns
The array of values from the IMU

Definition at line 33 of file gyro.cpp.

◆ get_raw()

std::array< float, 6 > Gyro::get_raw ( ) const

Get the current values of the gyroscope, the first three are the angular velocities, scaled between -1.0 and 1.0, and the second three are the accelerations.

Returns
The array of values from the gyroscope

Definition at line 21 of file gyro.cpp.

◆ resetError()

void Gyro::resetError ( )

Reset a previous found error in the sensor.

Definition at line 52 of file gyro.cpp.

Friends And Related Function Documentation

◆ raw_gyro_auxtask_callback

void raw_gyro_auxtask_callback ( void *  gyro_ptr)
friend

Definition at line 5 of file gyro.cpp.


The documentation for this class was generated from the following files: