SPQR-Team-2019-REVAMPED/include/sensors/data_source_camera_conicmir...

36 lines
1.3 KiB
C
Raw Normal View History

2019-11-18 18:11:26 +01:00
#pragma once
#include <Arduino.h>
#include "behaviour_control/data_source.h"
#include "behaviour_control/complementary_filter.h"
2019-11-18 17:15:32 +01:00
2022-07-05 12:01:19 +02:00
#define FILTER_DEFAULT_COEFF 0.85
#define FILTER_YANGLE_COEFF FILTER_DEFAULT_COEFF
#define FILTER_BANGLE_COEFF FILTER_DEFAULT_COEFF
#define FILTER_YANGLE_FIX_COEFF FILTER_DEFAULT_COEFF
#define FILTER_BANGLE_FIX_COEFF FILTER_DEFAULT_COEFF
#define FILTER_YDIST_COEFF FILTER_DEFAULT_COEFF
#define FILTER_BDIST_COEFF FILTER_DEFAULT_COEFF
class DataSourceCameraConic : public DataSource{
2019-11-18 17:15:32 +01:00
public:
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-03-09 17:10:22 +01:00
void computeCoordsAngles();
// int getValueAtk(bool);
// int getValueDef(bool);
2020-01-20 18:43:51 +01:00
int count = 0, unkn_counter = 0;
bool data_received = false, start = false, end = false, dash = false;
char current_char = 'a', start_char = 'a', end_char = 'a'; //initialize to unused values
2020-01-20 18:43:51 +01:00
2021-05-07 21:39:03 +02:00
int goalOrientation, old_goalOrientation, pAtk, pDef;
String s1 = "", s2 = "";
int yangle = 0, bangle = 0, yangle_fix = 0, bangle_fix = 0, ydist = 0, bdist = 0;
ComplementaryFilter *filt_yangle, *filt_bangle, *filt_yangle_fix, *filt_bangle_fix, *filt_ydist, *filt_bdist;
2019-11-18 17:15:32 +01:00
};