2019-11-18 18:11:26 +01:00
|
|
|
#pragma once
|
2020-02-29 22:10:53 +01:00
|
|
|
#include "behaviour_control/data_source.h"
|
2021-05-07 21:39:03 +02:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
|
|
#define MOUTH_MIN_ANGLE 340
|
|
|
|
#define MOUTH_MAX_ANGLE 20
|
2021-05-28 20:53:35 +02:00
|
|
|
#define MOUTH_DISTANCE 100
|
2021-05-07 21:39:03 +02:00
|
|
|
#define MOUTH_MAX_DISTANCE 140
|
2019-11-18 14:42:43 +01:00
|
|
|
|
|
|
|
class DataSourceBall : public DataSource{
|
|
|
|
|
|
|
|
public:
|
2019-11-18 15:07:46 +01:00
|
|
|
DataSourceBall(HardwareSerial* ser, int baud);
|
2021-05-29 15:19:41 +02:00
|
|
|
void readSensor() override;
|
2019-11-18 14:42:43 +01:00
|
|
|
void postProcess() override;
|
|
|
|
void test() override;
|
2021-05-07 21:39:03 +02:00
|
|
|
bool isInMouth();
|
|
|
|
bool isInMouthMaxDistance();
|
2021-05-11 15:21:22 +02:00
|
|
|
bool isInFront();
|
2019-11-25 17:30:47 +01:00
|
|
|
|
2021-03-29 15:44:19 +02:00
|
|
|
int angle, distance, angleFix;
|
2019-11-18 14:42:43 +01:00
|
|
|
bool ballSeen;
|
2021-05-29 15:19:41 +02:00
|
|
|
|
|
|
|
String ballString;
|
2019-11-27 17:17:18 +01:00
|
|
|
};
|