mirror of
https://github.com/team2059/Zaphod
synced 2025-01-07 22:14:14 -05:00
Fixed half speed in auto and in teleop (Untested)
This commit is contained in:
parent
087604037e
commit
3668bf318d
12
MyRobot.cpp
12
MyRobot.cpp
@ -146,12 +146,12 @@ public:
|
|||||||
}else if(y!=0.0f&&y<-1.0f){
|
}else if(y!=0.0f&&y<-1.0f){
|
||||||
y=-1.0f;
|
y=-1.0f;
|
||||||
}
|
}
|
||||||
|
if(SmartDashboard::GetBoolean("HalfPower")){
|
||||||
|
x/=2;
|
||||||
|
y/=2;
|
||||||
|
}
|
||||||
int leftPower=((y+x)/2+1)*127+1;
|
int leftPower=((y+x)/2+1)*127+1;
|
||||||
int rightPower=((y-x)/2+1)*127+1;
|
int rightPower=((y-x)/2+1)*127+1;
|
||||||
if(SmartDashboard::GetBoolean("HalfPower")){
|
|
||||||
leftPower/=2;
|
|
||||||
rightPower/=2;
|
|
||||||
}
|
|
||||||
setMotorValue(1,1,leftPower);
|
setMotorValue(1,1,leftPower);
|
||||||
setMotorValue(2,1,leftPower);
|
setMotorValue(2,1,leftPower);
|
||||||
setMotorValue(3,1,leftPower);
|
setMotorValue(3,1,leftPower);
|
||||||
@ -266,7 +266,7 @@ public:
|
|||||||
//updateJoystick{{{
|
//updateJoystick{{{
|
||||||
int updateJoystick(*stick){
|
int updateJoystick(*stick){
|
||||||
for(i=1,i<=12,i++){
|
for(i=1,i<=12,i++){
|
||||||
state[i] = stick.GetRawButton(i);
|
state[i]=stick.GetRawButton(i);
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
@ -501,6 +501,7 @@ public:
|
|||||||
//}}}
|
//}}}
|
||||||
//}}}
|
//}}}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
SmartDashboard::PutNumber("Autonomous step", currentStep);
|
SmartDashboard::PutNumber("Autonomous step", currentStep);
|
||||||
updateDashboard();
|
updateDashboard();
|
||||||
//Compressor{{{
|
//Compressor{{{
|
||||||
@ -511,7 +512,6 @@ public:
|
|||||||
i++;
|
i++;
|
||||||
c++;
|
c++;
|
||||||
Wait(0.005f);
|
Wait(0.005f);
|
||||||
}
|
|
||||||
compressing=false;
|
compressing=false;
|
||||||
compressor.Stop();
|
compressor.Stop();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user