Added basic calibration framework: pending servo integration and tying of encoders.
This commit is contained in:
25
include/calibration.hpp
Normal file
25
include/calibration.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef CALIBRATION_H
|
||||
#define CALIBRATION_H
|
||||
#include <atomic>
|
||||
#include "encoder.hpp"
|
||||
|
||||
class Calibration {
|
||||
public:
|
||||
void init();
|
||||
void beginDownwardCalib() {startTicks = topEnc.getCount();}
|
||||
bool completeCalib();
|
||||
int32_t convertToTicks(int8_t steps10);
|
||||
bool getCalibrated() {return calibrated;}
|
||||
void clearCalibrated();
|
||||
Calibration(Encoder& enc):topEnc(enc) {};
|
||||
|
||||
private:
|
||||
std::atomic<bool> calibrated;
|
||||
std::atomic<int32_t> UpMinusDownTicks;
|
||||
int32_t startTicks;
|
||||
Encoder& topEnc;
|
||||
};
|
||||
|
||||
extern Calibration calib;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user