RSeries astromech firmware
Orientation Class Reference

#include <Orientation.h>

Detailed Description

Encapsulates an Adafruit BNO055 IMU.

Encapsulates a Adafruit BNO055 IMU and provides convenience functions to read the heading. It will also automatically publish SMQ events for any change in heading.

+ Inheritance diagram for Orientation:
+ Collaboration diagram for Orientation:

Public Member Functions

 Orientation (uint8_t id=0)
 Default Constructor. More...
 
virtual void setup ()
 Perform any initialzation not possible in the constructor. More...
 
float getYaw ()
 Returns the last recorded yaw. More...
 
bool getYawChanged (float &yaw)
 Returns true if yaw has changed since last calling this function. More...
 
float getRoll ()
 Returns the last recorded roll. More...
 
bool getRollChanged (float &roll)
 Returns true if roll has changed since last calling this function. More...
 
float getPitch ()
 Returns the last recorded pitch. More...
 
bool getPitchChanged (float &pitch)
 Returns true if pitch has changed since last calling this function. More...
 
virtual void animate ()
 Reads the IMU and publishes any change in heading. More...
 
- Public Member Functions inherited from SetupEvent
 SetupEvent ()
 Default Constructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SetupEvent
static void ready ()
 Calls setup() for each created AnimatedEvent subclass. More...
 

Constructor & Destructor Documentation

◆ Orientation()

Orientation::Orientation ( uint8_t  id = 0)
inline

Default Constructor.

Member Function Documentation

◆ animate()

virtual void Orientation::animate ( )
inlinevirtual

Reads the IMU and publishes any change in heading.

Implements AnimatedEvent.

◆ getPitch()

float Orientation::getPitch ( )
inline

Returns the last recorded pitch.

◆ getPitchChanged()

bool Orientation::getPitchChanged ( float &  pitch)
inline

Returns true if pitch has changed since last calling this function.

◆ getRoll()

float Orientation::getRoll ( )
inline

Returns the last recorded roll.

◆ getRollChanged()

bool Orientation::getRollChanged ( float &  roll)
inline

Returns true if roll has changed since last calling this function.

◆ getYaw()

float Orientation::getYaw ( )
inline

Returns the last recorded yaw.

◆ getYawChanged()

bool Orientation::getYawChanged ( float &  yaw)
inline

Returns true if yaw has changed since last calling this function.

◆ setup()

virtual void Orientation::setup ( )
inlinevirtual

Perform any initialzation not possible in the constructor.

Implements SetupEvent.


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