systems: introduce empty systems for testing purposes

docs
EmaMaker 2020-12-23 21:16:50 +01:00
parent f99d467c36
commit b4bc48b9ed
6 changed files with 50 additions and 4 deletions

View File

@ -19,7 +19,7 @@
#define GOALIE_ATKDIR_PLUSANG2_COR 70 #define GOALIE_ATKDIR_PLUSANG2_COR 70
#define GOALIE_ATKDIR_PLUSANG3_COR 70 #define GOALIE_ATKDIR_PLUSANG3_COR 70
class Striker : public Game, public PositionSysZone{ class Striker : public Game{
public: public:
Striker(); Striker();

View File

@ -29,8 +29,8 @@ class PositionSysCamera : public PositionSystem{
public: public:
PositionSysCamera(); PositionSysCamera();
void goCenter(); void goCenter() override;
void centerGoal(); void centerGoal() override;
void setMoveSetpoints(int x, int y); void setMoveSetpoints(int x, int y);
void addMoveOnAxis(int x, int y); void addMoveOnAxis(int x, int y);
void update() override; void update() override;

View File

@ -11,4 +11,20 @@ class PositionSystem{
public: public:
virtual void update() = 0; virtual void update() = 0;
virtual void test() = 0; virtual void test() = 0;
virtual void goCenter() = 0;
virtual void centerGoal() = 0;
};
class LineSystemEmpty : public LineSystem{
public:
void update() override;
void test() override;
};
class PositionSystemEmpty : public PositionSystem{
public:
void update() override;
void test() override;
void goCenter() override;
void centerGoal() override;
}; };

View File

@ -23,7 +23,7 @@ void Striker::init(){
void Striker::realPlay(){ void Striker::realPlay(){
if(CURRENT_DATA_READ.ballSeen) this->striker(); if(CURRENT_DATA_READ.ballSeen) this->striker();
else ((PositionSysCamera*)ps)->goCenter(); else ps->goCenter();
} }
void Striker::striker() { void Striker::striker() {

View File

@ -0,0 +1,11 @@
#include "systems/systems.h"
#include "vars.h"
#include "sensors/sensors.h"
#include <Arduino.h>
void LineSystemEmpty::update(){
tookLine = false;
}
void LineSystemEmpty::test(){
DEBUG.println("Empty LineSystem ready!");
}

View File

@ -0,0 +1,19 @@
#include "systems/systems.h"
#include "vars.h"
#include "sensors/sensors.h"
#include <Arduino.h>
void PositionSystemEmpty::update(){
}
void PositionSystemEmpty::test(){
DEBUG.println("Empty PositionSystemEmpty ready!");
}
void PositionSystemEmpty::goCenter(){
drive->prepareDrive(0,0,0);
}
void PositionSystemEmpty::centerGoal(){
drive->prepareDrive(0,0,0);
}