mirror of
https://github.com/team2059/Dent
synced 2025-01-07 22:14:14 -05:00
Fixed the axis locking
This commit is contained in:
parent
e3b80c6513
commit
c45ab0e9a2
@ -9,27 +9,21 @@ HHRobot::HHRobot():
|
||||
}
|
||||
void HHRobot::Init(){
|
||||
printf("Initing\n");
|
||||
AirCompressor->Start();
|
||||
}
|
||||
//Main function used to handle periodic tasks on the robot
|
||||
void HHRobot::Handler(){
|
||||
//Code to lock the axis when driving
|
||||
double x,y,z;
|
||||
if (DriveStick->GetJoystickButton(1)){
|
||||
y = 0;
|
||||
z = 0;
|
||||
}else{
|
||||
y = DriveStick->GetJoystickAxis("y");
|
||||
z = DriveStick->GetJoystickAxis("z");
|
||||
}
|
||||
if (DriveStick->GetJoystickButton(2)){
|
||||
x = 0;
|
||||
z = 0;
|
||||
}else{
|
||||
x = DriveStick->GetJoystickAxis("x");
|
||||
z = DriveStick->GetJoystickAxis("z");
|
||||
}else{
|
||||
x = 0;
|
||||
}
|
||||
//X axis, Y axis, Z axis, acceleration, threshold, gyro
|
||||
RobotDrive->handler(x,y,z,0.5,1,0);
|
||||
y = DriveStick->GetJoystickAxis("y");
|
||||
z = DriveStick->GetJoystickAxis("z");
|
||||
//X axis, Y axis, Z axis, sensitivity, mode threshold, gyro
|
||||
RobotDrive->handler(x,y,z,0.95,DriveStick->GetThrottle(),0);
|
||||
|
||||
//Disables the compressor if the battery voltage is detected to be less than 10 volts
|
||||
if (PowerDistPanel->GetVoltage()<=10){
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b8306e85030cbd5fea1e15b60b608efc219477b1
|
||||
Subproject commit 181fb1556d4cc96daa430bfce0fb6ce26c7c90c9
|
Loading…
x
Reference in New Issue
Block a user