From c45ab0e9a2b58e0d01997f187dfc3ea496bb7582 Mon Sep 17 00:00:00 2001 From: Adam Long Date: Sun, 18 Jan 2015 09:54:36 +0000 Subject: [PATCH] Fixed the axis locking --- src/HHRobot.cpp | 20 +++++++------------- src/hhlib | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/HHRobot.cpp b/src/HHRobot.cpp index 9466634..51a7456 100644 --- a/src/HHRobot.cpp +++ b/src/HHRobot.cpp @@ -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){ diff --git a/src/hhlib b/src/hhlib index b8306e8..181fb15 160000 --- a/src/hhlib +++ b/src/hhlib @@ -1 +1 @@ -Subproject commit b8306e85030cbd5fea1e15b60b608efc219477b1 +Subproject commit 181fb1556d4cc96daa430bfce0fb6ce26c7c90c9