amiro-os / devices / DiWheelDrive / linefollow2.hpp @ dd47d655
History | View | Annotate | Download (640 Bytes)
| 1 |
#ifndef AMIRO_LINEFOLLOWING_H
|
|---|---|
| 2 |
#define AMIRO_LINEFOLLOWING_H
|
| 3 |
|
| 4 |
#include <ch.hpp> |
| 5 |
|
| 6 |
#include <amiroosconf.h> |
| 7 |
|
| 8 |
namespace amiro {
|
| 9 |
|
| 10 |
class LineFollow |
| 11 |
{
|
| 12 |
public:
|
| 13 |
void printSensorData();
|
| 14 |
void stableFollow(int vcnl4020Proximity[4], int (&rpmFuzzyCtrl)[2], Global *global); |
| 15 |
float SetPoint = 0x4000; // (0x1800+0x2800) >> 8 |
| 16 |
float Kp = 0.001; |
| 17 |
float Ki = 0.00001; |
| 18 |
float Kd = 0.5 |
| 19 |
; |
| 20 |
int accSum = 0; |
| 21 |
float oldError = 0; |
| 22 |
int biggestDiff = 0; |
| 23 |
Global *global; |
| 24 |
LineFollow(Global *global); |
| 25 |
void calibrateZiegler(float KCrit, int rpmSpeed[2]); |
| 26 |
|
| 27 |
private:
|
| 28 |
int delta();
|
| 29 |
|
| 30 |
}; |
| 31 |
|
| 32 |
} // end of namespace amiro
|
| 33 |
|
| 34 |
#endif // AMIRO_LINEFOLLOWING_H |