TeensyNanoExoCode
Loading...
Searching...
No Matches
AnkleAngles.h
Go to the documentation of this file.
1#ifndef ANKLE_ANGLE_H
2#define ANKLE_ANGLE_H
3
4#if defined(ARDUINO_TEENSY36) || defined(ARDUINO_TEENSY41)
5
6#include <Arduino.h>
7#include "Board.h"
8
9//TODO: Add angle calibration
10
15class AnkleAngles
16{
17 public:
18 AnkleAngles() {}
19 // AnkleAngles(AnkleAngles& other) = delete;
20 // void operator=(const AnkleAngles&) = delete;
21 // static AnkleAngles* GetInstance();
29 bool init(bool is_left);
36 float get(bool return_normalized = false);
37
38 private:
39 float _update_population_statistics(const float new_value);
40 float _max_average = 0.01;
41 float _min_average = 0.99;
42 float _mean = 0;
43 const float _ema_alpha = 0.0001;
44 const float _max_min_delta = 0.00001;
45
46 bool _left = false;
51 bool _is_initialized = false;
56 const int _right_pin = logic_micro_pins::right_ankle_angle_pin;
61 const int _left_pin = logic_micro_pins::left_ankle_angle_pin;
62};
63
64
65#endif
66#endif
void init()
Definition RealTimeI2C.cpp:91