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
|
|
|
|
2022-07-07 21:52:52 +02:00
|
|
|
#include "vars.h"
|
2020-02-29 22:10:53 +01:00
|
|
|
|
2022-05-16 20:16:01 +02:00
|
|
|
#define S1I A14
|
|
|
|
#define S1O A15
|
|
|
|
#define S2I A16
|
|
|
|
#define S2O A17
|
|
|
|
#define S3I A20
|
|
|
|
#define S3O A0
|
|
|
|
#define S4I A1
|
|
|
|
#define S4O A2
|
2021-01-31 18:41:27 +01:00
|
|
|
|
2022-06-09 10:03:48 +02:00
|
|
|
#define LINE_THRESH_CAM 100
|
|
|
|
#define EXIT_TIME 100
|
2019-12-05 11:53:01 +01:00
|
|
|
|
2022-07-07 21:52:52 +02:00
|
|
|
class LineSysCamera : public LineSystem
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
LineSysCamera();
|
|
|
|
LineSysCamera(vector<DataSource *> in_, vector<DataSource *> out);
|
|
|
|
|
|
|
|
void update() override;
|
|
|
|
void test() override;
|
|
|
|
void outOfBounds();
|
|
|
|
void checkLineSensors();
|
|
|
|
bool angleCritic(int angle);
|
|
|
|
|
|
|
|
private:
|
|
|
|
vector<DataSource *> in, out;
|
|
|
|
DataSource *ds;
|
|
|
|
bool fboundsX, fboundsY, fboundsOX, fboundsOY, slow;
|
|
|
|
int inV, outV, linesensOldX, linesensOldY, value, linetriggerI[4], linetriggerO[4], linepins[4], i;
|
|
|
|
unsigned long exitTimer;
|
|
|
|
int outDir, outVel;
|
|
|
|
byte linesens;
|
2019-12-05 11:53:01 +01:00
|
|
|
};
|