From 266b38afce882620e0b282dad6f345315b3008cf Mon Sep 17 00:00:00 2001 From: Brendan Date: Tue, 18 Aug 2015 22:15:11 -0600 Subject: [PATCH] should fix controllability from driver station of enabling/disabling buddy box --- src/Robot.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 55b24a5..386e381 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -66,6 +66,9 @@ public: SlaveInterLink = new InterLinkElite( Slave_InterLink_ID ); ds = DriverStation::GetInstance(); lw = LiveWindow::GetInstance(); + + SmartDashboard::PutBoolean( "Buddy Box Enabled", false ); + SmartDashboard::PutBoolean( "Slave Controls Speed", false ); } ////////////////////// @@ -89,10 +92,10 @@ public: { double throttle; - bool BuddyBoxEnabled = SmartDashboard::GetBoolean( "Buddy Box Enabled" , false); + bool BuddyBoxEnabled = SmartDashboard::GetBoolean( "Buddy Box Enabled" ); bool SlaveInControl = MasterInterLink->GetCh5(); SmartDashboard::PutBoolean( "Slave In Control", SlaveInControl ); - bool SlaveControlsSpeed = SmartDashboard::GetBoolean( "Slave Controls Speed", false ); + bool SlaveControlsSpeed = SmartDashboard::GetBoolean( "Slave Controls Speed" ); if( BuddyBoxEnabled && SlaveInControl ) ActiveInterLink = SlaveInterLink; else ActiveInterLink = MasterInterLink; @@ -105,9 +108,9 @@ public: double elev = ActiveInterLink->getElev(); double rudd = ActiveInterLink->getRudd(); SmartDashboard::PutNumber( "Rudder", rudd ); - SmartDashboard::PutNumber( "Throttle", ch6 ); + SmartDashboard::PutNumber( "Throttle", throttle ); - throScale = ch6 + 1; + throScale = throttle + 1; double driveAngle = atan2( -aile*aileScale, elev*elevScale ); SmartDashboard::PutNumber( "Drive Angle", driveAngle );