2019-11-18 18:11:26 +01:00
|
|
|
#pragma once
|
2020-02-18 09:37:36 +01:00
|
|
|
|
2020-02-29 22:10:53 +01:00
|
|
|
#include "behaviour_control/data_source.h"
|
2020-02-18 09:37:36 +01:00
|
|
|
|
2020-01-20 18:57:14 +01:00
|
|
|
#define startp 105
|
|
|
|
#define endp 115
|
2020-02-21 13:37:32 +01:00
|
|
|
#define unkn 116
|
2020-01-27 17:05:39 +01:00
|
|
|
//Coords are mapped from 0 up to this value
|
|
|
|
#define MAP_MAX 100
|
|
|
|
#define HALF_MAP_MAX 50
|
2019-11-18 17:15:32 +01:00
|
|
|
|
2020-01-29 18:56:49 +01:00
|
|
|
class DataSourceCameraConic : public DataSource{
|
2019-11-18 17:15:32 +01:00
|
|
|
|
|
|
|
public:
|
2020-01-29 18:56:49 +01:00
|
|
|
DataSourceCameraConic(HardwareSerial* ser, int baud);
|
2019-11-18 17:15:32 +01:00
|
|
|
void test() override;
|
2019-11-18 18:11:26 +01:00
|
|
|
void readSensor() override;
|
2020-02-18 09:37:36 +01:00
|
|
|
// int getValueAtk(bool);
|
|
|
|
// int getValueDef(bool);
|
2020-01-20 18:43:51 +01:00
|
|
|
|
2020-01-26 20:13:31 +01:00
|
|
|
int yAngle, bAngle, yAngleFix, bAngleFix, yDist, bDist;
|
|
|
|
|
2020-01-20 18:43:51 +01:00
|
|
|
int count = 0, unkn_counter;
|
2020-03-02 18:48:29 +01:00
|
|
|
int xb, yb, xy, yy, true_xb, true_xy, true_yb, true_yy, calc_xb, calc_yb, calc_xy, calc_yy, true_xb_fixed,
|
|
|
|
true_xy_fixed, true_yb_fixed, true_yy_fixed;
|
2020-01-20 18:43:51 +01:00
|
|
|
bool data_received = false, start = false, end = false;
|
|
|
|
|
2020-01-27 17:05:39 +01:00
|
|
|
int goalOrientation, pAtk, pDef;
|
2020-01-22 16:55:55 +01:00
|
|
|
int value;
|
2019-11-18 17:15:32 +01:00
|
|
|
};
|