2019-12-05 11:53:01 +01:00
|
|
|
#pragma once
|
2019-12-26 17:44:58 +01:00
|
|
|
|
2019-12-05 11:53:01 +01:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
2020-02-29 22:10:53 +01:00
|
|
|
#include "behaviour_control/ds_ctrl.h"
|
2020-11-04 17:46:14 +01:00
|
|
|
#include "systems/systems.h"
|
2020-02-29 22:10:53 +01:00
|
|
|
|
|
|
|
#include "vars.h"
|
|
|
|
|
2021-01-31 18:41:27 +01:00
|
|
|
#define S1I A7
|
|
|
|
#define S1O A6
|
|
|
|
#define S2I A2
|
|
|
|
#define S2O A3
|
|
|
|
#define S3I A1
|
|
|
|
#define S3O A0
|
|
|
|
#define S4I A9
|
|
|
|
#define S4O A8
|
|
|
|
|
2021-05-10 18:28:41 +02:00
|
|
|
#define LINE_THRESH_CAM 325
|
2021-05-10 20:34:20 +02:00
|
|
|
#define EXIT_TIME 300
|
2019-12-05 11:53:01 +01:00
|
|
|
|
2020-03-02 18:48:29 +01:00
|
|
|
class LineSysCamera : public LineSystem{
|
2019-12-05 11:53:01 +01:00
|
|
|
|
|
|
|
public:
|
2020-03-02 18:48:29 +01:00
|
|
|
LineSysCamera();
|
|
|
|
LineSysCamera(vector<DataSource*> in_, vector<DataSource*> out);
|
2019-12-05 11:53:01 +01:00
|
|
|
|
2019-12-26 17:44:58 +01:00
|
|
|
void update() override;
|
|
|
|
void test() override;
|
2019-12-05 11:53:01 +01:00
|
|
|
void outOfBounds();
|
2020-03-02 18:48:29 +01:00
|
|
|
void checkLineSensors();
|
2019-12-05 11:53:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
vector<DataSource*> in, out;
|
|
|
|
DataSource* ds;
|
|
|
|
bool fboundsX, fboundsY, fboundsOX, fboundsOY, slow;
|
2020-03-02 18:48:29 +01:00
|
|
|
int inV, outV, linesensOldX, linesensOldY, value, linetriggerI[4], linetriggerO[4], linepins[4], i;
|
2021-01-31 18:41:27 +01:00
|
|
|
unsigned long exitTimer;
|
2020-01-15 13:55:51 +01:00
|
|
|
int outDir, outVel;
|
|
|
|
byte linesens;
|
2019-12-05 11:53:01 +01:00
|
|
|
};
|