ema taking over

code_midgen
u-siri-ous 2020-02-17 18:52:54 +01:00
parent 372e6ac02c
commit 6aa404465e
4 changed files with 7 additions and 4 deletions

View File

@ -56,7 +56,7 @@
#define SOUTH_EAST 9 #define SOUTH_EAST 9
#define CAMERA_CENTER_X 3 #define CAMERA_CENTER_X 3
#define CAMERA_CENTER_Y 1 #define CAMERA_CENTER_Y 10
class PositionSysZone : public PositionSystem{ class PositionSysZone : public PositionSystem{
public: public:

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#define DEBUG Serial3 #define DEBUG Serial
#define LED_R 20 #define LED_R 20
#define LED_Y 17 #define LED_Y 17

View File

@ -23,6 +23,9 @@ void loop() {
goalie->play(role==1); goalie->play(role==1);
keeper->play(role==0); keeper->play(role==0);
camera->test();
// Last thing to do: movement and update status vector // Last thing to do: movement and update status vector
drive->drivePrepared(); drive->drivePrepared();

View File

@ -373,8 +373,8 @@ void PositionSysZone::testLogicZone(){
void PositionSysZone::goCenter() { void PositionSysZone::goCenter() {
if((camera->true_yb + camera->true_yy) >= -CAMERA_CENTER_Y) drive->prepareDrive(180, 75, 0); if((camera->true_yb + camera->true_yy) >= 0) drive->prepareDrive(180, 75, 0);
else if ((camera->true_yb + camera->true_yy) <= CAMERA_CENTER_Y) drive->prepareDrive(0, 75, 0); else if ((camera->true_yb + camera->true_yy) <= -CAMERA_CENTER_Y) drive->prepareDrive(0, 75, 0);
else drive->prepareDrive(0, 0, 0); else drive->prepareDrive(0, 0, 0);
/* if(camera->true_xb < -CAMERA_CENTER_X || camera->true_xy < -CAMERA_CENTER_X) drive->prepareDrive(90, 75, 0); /* if(camera->true_xb < -CAMERA_CENTER_X || camera->true_xy < -CAMERA_CENTER_X) drive->prepareDrive(90, 75, 0);
else if(camera->true_xb > CAMERA_CENTER_X || camera->true_xy > CAMERA_CENTER_X) drive->prepareDrive(270, 75, 0); else if(camera->true_xb > CAMERA_CENTER_X || camera->true_xy > CAMERA_CENTER_X) drive->prepareDrive(270, 75, 0);