sbubabub
commit
5a0701f09e
|
@ -28,6 +28,10 @@ DriveController::DriveController(Motor* m1_, Motor* m2_, Motor* m3_, Motor* m4_)
|
||||||
errorP = 0;
|
errorP = 0;
|
||||||
errorI = 0;
|
errorI = 0;
|
||||||
errorD = 0;
|
errorD = 0;
|
||||||
|
|
||||||
|
errorePre = 0;
|
||||||
|
pidfactor = 0;
|
||||||
|
integral = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DriveController::prepareDrive(int dir, int speed, int tilt){
|
void DriveController::prepareDrive(int dir, int speed, int tilt){
|
||||||
|
|
|
@ -50,7 +50,7 @@ void DataSourceCtrlLines::read(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataSourceCtrlLines::postProcess(){
|
void DataSourceCtrlLines::postProcess(){
|
||||||
if ((inV > 0) || (outV > 0)) {
|
if ((inV > 0) || (outV > 0)) {
|
||||||
fboundsOX = true;
|
fboundsOX = true;
|
||||||
fboundsOY = true;
|
fboundsOY = true;
|
||||||
if(exitTimer > EXTIME) {
|
if(exitTimer > EXTIME) {
|
||||||
|
@ -64,7 +64,7 @@ void DataSourceCtrlLines::postProcess(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataSourceCtrlLines::outOfBounds(){
|
void DataSourceCtrlLines::outOfBounds(){
|
||||||
//handleExtern();
|
handleExtern();
|
||||||
handleIntern();
|
handleIntern();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,8 +144,8 @@ void DataSourceCtrlLines::handleIntern(){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(exitTimer < 45) outVel = 200;
|
if(exitTimer < 45) outVel = 350;
|
||||||
else outVel = 150;
|
else outVel = 330;
|
||||||
drive->prepareDrive(outDir, outVel, 0);
|
drive->prepareDrive(outDir, outVel, 0);
|
||||||
// keeper_backToGoalPost = true;
|
// keeper_backToGoalPost = true;
|
||||||
// keeper_tookTimer = true;
|
// keeper_tookTimer = true;
|
||||||
|
@ -154,7 +154,7 @@ void DataSourceCtrlLines::handleIntern(){
|
||||||
inVOldX = 0;
|
inVOldX = 0;
|
||||||
inVOldY = 0;
|
inVOldY = 0;
|
||||||
// lineSensByteBak = 30;
|
// lineSensByteBak = 30;
|
||||||
//drive->canUnlock = true;
|
drive->canUnlock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// lineSensByteBak = linesensbyteI;
|
// lineSensByteBak = linesensbyteI;
|
||||||
|
|
|
@ -73,7 +73,9 @@
|
||||||
drive->prepareDrive(atk_direction, atk_speed, 0);
|
drive->prepareDrive(atk_direction, atk_speed, 0);
|
||||||
}
|
}
|
||||||
else drive->prepareDrive(atk_direction, atk_speed, 0);
|
else drive->prepareDrive(atk_direction, atk_speed, 0);
|
||||||
/* digitalWrite(LED_G, HIGH);
|
|
||||||
|
|
||||||
|
/* siria digitalWrite(LED_G, HIGH);
|
||||||
if(ball->ballSeen){
|
if(ball->ballSeen){
|
||||||
if(ball->angle >= 0 && ball->angle < 45) drive->drive(ball->angle, 75, 0);
|
if(ball->angle >= 0 && ball->angle < 45) drive->drive(ball->angle, 75, 0);
|
||||||
else if(ball->angle >= 45 && ball->angle <= 60) drive->drive(ball->angle, 75, 0);
|
else if(ball->angle >= 45 && ball->angle <= 60) drive->drive(ball->angle, 75, 0);
|
||||||
|
|
|
@ -87,6 +87,7 @@ void setup() {
|
||||||
delay(2000);
|
delay(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
updateSensors();
|
updateSensors();
|
||||||
Trial trial;
|
Trial trial;
|
||||||
|
@ -94,6 +95,9 @@ void loop() {
|
||||||
//drive->prepareDrive(0,0,0);
|
//drive->prepareDrive(0,0,0);
|
||||||
//linesCtrl->update();
|
//linesCtrl->update();
|
||||||
|
|
||||||
|
|
||||||
|
//drive->prepareDrive(0,0,0);
|
||||||
|
linesCtrl->update();
|
||||||
drive->drivePrepared();
|
drive->drivePrepared();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue