TinyTrainable
 
Loading...
Searching...
No Matches
InputGesture Class Reference

InputGesture inherits from Input. More...

#include <InputGesture.h>

Inheritance diagram for InputGesture:
Input

Public Member Functions

 InputGesture ()
 constructor
 
virtual void setupInstrument (bool serialDebugging) override
 
virtual void setupGestureModel (String gestures[3], const unsigned char *model=nullptr) override
 
virtual void gesturePrintHeader () override
 
virtual void gestureReadData () override
 
virtual void gestureSetAcceleration (float newVal) override
 
virtual void gestureSetNumberSamples (int newVal) override
 
virtual void identify () override
 
- Public Member Functions inherited from Input
virtual ~Input ()
 destructor
 
virtual void setupInstrument (bool serialDebugging)
 
virtual void identify ()
 
virtual void trainKNN (int k, int examplesPerClass, String objects[3])
 
virtual void setupGestureModel (String gestures[3], const unsigned char *model=nullptr)
 
virtual void gesturePrintHeader ()
 
virtual void gestureReadData ()
 
virtual void gestureSetAcceleration (float newVal)
 
virtual void gestureSetNumberSamples (int newVal)
 
virtual void setupSpeechModel (String sounds[3], const unsigned char *model=nullptr)
 

Private Member Functions

void setupGestureSensor ()
 function for setup of sensor LSM9DS1
 

Private Attributes

float _accelerationThreshold = 2.5
 threshold of significance measured in G's
 
int _numSamples = 119
 number of samples per motion
 
int _samplesRead = _numSamples
 
float _aX
 
float _aY
 
float _aZ
 
float _gX
 
float _gY
 
float _gZ
 
const int NUM_GESTURES = 3
 
String _gestures [3]
 
tflite::MicroErrorReporter tflErrorReporter
 
tflite::AllOpsResolver tflOpsResolver
 
const tflite::Model * tflModel = nullptr
 
tflite::MicroInterpreter * tflInterpreter = nullptr
 
TfLiteTensor * tflInputTensor = nullptr
 
TfLiteTensor * tflOutputTensor = nullptr
 
byte tensorArena [tensorArenaSize]
 
float aX
 acceleration in x, y, z
 
float aY
 
float aZ
 
float gX
 gravity in x, y, z
 
float gY
 
float gZ
 
const String _gestureHeader = "aX,aY,aZ,gX,gY,gZ"
 header for gesture database
 
const int _floatDecimals = 3
 number of decimals for floating point numbers
 

Static Private Attributes

static constexpr int tensorArenaSize = 8 * 1024
 

Additional Inherited Members

- Public Attributes inherited from Input
TinyTrainabletiny = nullptr
 pointer to a TinyTrainable instance
 

Detailed Description

InputGesture inherits from Input.

Arduino

TinyTrainable

Input

for input sensor

for machine learning

Constructor & Destructor Documentation

◆ InputGesture()

InputGesture::InputGesture ( )

constructor

Member Function Documentation

◆ gesturePrintHeader()

void InputGesture::gesturePrintHeader ( )
overridevirtual

Reimplemented from Input.

◆ gestureReadData()

void InputGesture::gestureReadData ( )
overridevirtual

Reimplemented from Input.

◆ gestureSetAcceleration()

void InputGesture::gestureSetAcceleration ( float  newVal)
overridevirtual

Reimplemented from Input.

◆ gestureSetNumberSamples()

void InputGesture::gestureSetNumberSamples ( int  newVal)
overridevirtual

Reimplemented from Input.

◆ identify()

void InputGesture::identify ( )
overridevirtual

Reimplemented from Input.

◆ setupGestureModel()

void InputGesture::setupGestureModel ( String  gestures[3],
const unsigned char *  model = nullptr 
)
overridevirtual

Reimplemented from Input.

◆ setupGestureSensor()

void InputGesture::setupGestureSensor ( )
private

function for setup of sensor LSM9DS1

◆ setupInstrument()

void InputGesture::setupInstrument ( bool  serialDebugging)
overridevirtual

Reimplemented from Input.

Member Data Documentation

◆ _accelerationThreshold

float InputGesture::_accelerationThreshold = 2.5
private

threshold of significance measured in G's

◆ _aX

float InputGesture::_aX
private

◆ _aY

float InputGesture::_aY
private

◆ _aZ

float InputGesture::_aZ
private

◆ _floatDecimals

const int InputGesture::_floatDecimals = 3
private

number of decimals for floating point numbers

◆ _gestureHeader

const String InputGesture::_gestureHeader = "aX,aY,aZ,gX,gY,gZ"
private

header for gesture database

◆ _gestures

String InputGesture::_gestures[3]
private

◆ _gX

float InputGesture::_gX
private

◆ _gY

float InputGesture::_gY
private

◆ _gZ

float InputGesture::_gZ
private

◆ _numSamples

int InputGesture::_numSamples = 119
private

number of samples per motion

◆ _samplesRead

int InputGesture::_samplesRead = _numSamples
private

◆ aX

float InputGesture::aX
private

acceleration in x, y, z

◆ aY

float InputGesture::aY
private

◆ aZ

float InputGesture::aZ
private

◆ gX

float InputGesture::gX
private

gravity in x, y, z

◆ gY

float InputGesture::gY
private

◆ gZ

float InputGesture::gZ
private

◆ NUM_GESTURES

const int InputGesture::NUM_GESTURES = 3
private

◆ tensorArena

byte InputGesture::tensorArena[tensorArenaSize]
private

◆ tensorArenaSize

constexpr int InputGesture::tensorArenaSize = 8 * 1024
staticconstexprprivate

◆ tflErrorReporter

tflite::MicroErrorReporter InputGesture::tflErrorReporter
private

◆ tflInputTensor

TfLiteTensor* InputGesture::tflInputTensor = nullptr
private

◆ tflInterpreter

tflite::MicroInterpreter* InputGesture::tflInterpreter = nullptr
private

◆ tflModel

const tflite::Model* InputGesture::tflModel = nullptr
private

◆ tflOpsResolver

tflite::AllOpsResolver InputGesture::tflOpsResolver
private

◆ tflOutputTensor

TfLiteTensor* InputGesture::tflOutputTensor = nullptr
private

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