From 4a6b8c74fa29d94b70bf620a1d1019ada0a818b4 Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Wed, 10 Feb 2016 20:43:09 -0500 Subject: [PATCH 01/35] Lots of includes and a LogData() embryo --- src/Robot.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Robot.cpp b/src/Robot.cpp index 4913f17..2766c38 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -47,6 +47,12 @@ private: const std::string autoNameCustom = "My Auto"; std::string autoSelected; + void LogData() + { + static PowerDistributionPanel pdp; + static DriverStation* ds = DriverStation::GetInstance(); + } + void RobotInit() { chooser = new SendableChooser(); From 8039c16b708ae7bcad7b329b0a5496e262b74ff2 Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Wed, 10 Feb 2016 20:43:45 -0500 Subject: [PATCH 02/35] Lots of includes (for real this time) and a LogData() embryo --- src/Robot.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Robot.cpp b/src/Robot.cpp index 2766c38..c4aff98 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -1,5 +1,13 @@ #include "WPILib.h" #include "Shooter.h" +#include +#include +#include +#include +#include +#include +#include +#include #ifndef BUTTON_LAYOUT #define BUTTON_LAYOUT From 91124a0ff09ac89ecd583d9e2ab716aea3bb607e Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Wed, 10 Feb 2016 21:19:18 -0500 Subject: [PATCH 03/35] more of LogData(). still not done, but I'm tired. --- src/Robot.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Robot.cpp b/src/Robot.cpp index c4aff98..d6cf381 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -59,6 +59,15 @@ private: { static PowerDistributionPanel pdp; static DriverStation* ds = DriverStation::GetInstance(); + static DriverStation* ds = DriverStation::GetInstance(); + static std::vector motors; + + static std::ofstream logA, logB, logC; + timeval tm; + + SmartDashboard::PutBoolean("log A", logA.is_open()); + SmartDashboard::PutBoolean("log B", logB.is_open()); + SmartDashboard::PutBoolean("log C", logC.is_open()); } void RobotInit() From 1938d4b935fcba83cc79ed026637906a08a303df Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Mon, 15 Feb 2016 20:54:20 -0500 Subject: [PATCH 04/35] tweaks - untested --- src/Robot.cpp | 8 ++++++-- src/Shooter.h | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 1af8deb..b12359c 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -163,7 +163,7 @@ private: /* * Run the Shooter only while the THUMB button is held down on the operator stick. * the 'pickupRunning' boolean is there to prevent the shooter from calling PickUp - * every itteration of the TeleopPeriodic method (once every 10ms!) + * every iteration of the TeleopPeriodic method (once every 10ms!) * The pickup is disabled when the thumb button is released, but the code still * has 'pickupRunning' as true. */ @@ -177,10 +177,14 @@ private: shooter.PickUp(false); pickupRunning = false; } + else if(launch_spinny.Get() != 1) + { + launch_spinny.Set(1); + } /* * The 'inverting' variable is used to make sure that the drive train isn't getting - * inverted every itteration of the TeleopPeriodic method while the button is held down. + * inverted every iteration of the TeleopPeriodic method while the button is held down. * This is important because the TeleopPeriodic method executes something like once every 10ms. * Thus, this if-else if pair make the button a toggle. */ diff --git a/src/Shooter.h b/src/Shooter.h index c8980f5..9c8af1e 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -84,13 +84,10 @@ public: void Shoot() { - // TODO: Shooter Logic should go as follows: - - /* - Assuming a ball is held in the shooter. When the trigger is pulled, - the launch-spinny should be STOPPED. Start a Timer object counting - When... too hard to write.. I emailed you a flow chart. - */ + if (shotClock.Get() > (SPINUP_TIME + 0.1)) + { + state = RESETTING; + } switch (state) { case READY: @@ -152,7 +149,13 @@ public: { pickup->Set((float) (state * PICKUP_POWER)); launcher->Set((float) (state * PICKUP_POWER * -1)); - //launch_spinny->Set(-1.0*PICKUP_POWER); + if (state) + { + launch_spinny->Set(-1.0); + } else + { + launch_spinny->Set(1); + } //std::cout << "picking up!\n"; } From 9ac893271f93f9e22db4daeac43756aed33531c6 Mon Sep 17 00:00:00 2001 From: Jason Cox Date: Wed, 17 Feb 2016 15:22:25 -0500 Subject: [PATCH 05/35] Added check on limit switches to prevent uneccessary motor power setting on the RAMP --- src/Shooter.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Shooter.h b/src/Shooter.h index 9c8af1e..f948abe 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -64,12 +64,14 @@ public: void LowerRamp() { - launch_spinny->Set(-1); + if(launch_spinny->GetReverseLimitOK()) + launch_spinny->Set(-1); } void RaiseRamp() { - launch_spinny->Set(1); + if(launch_spinny->GetForwardLimitOK()) + launch_spinny->Set(1); } void StopRamp() @@ -109,7 +111,7 @@ public: shotClock.Start(); } else { - std::cout << "*Goku noises*\n"; + //std::cout << "*Goku noises*\n"; } break; } From 139ae70b1bf625f6549dee09fe41383bdc9f110e Mon Sep 17 00:00:00 2001 From: Jason Cox Date: Wed, 17 Feb 2016 15:28:33 -0500 Subject: [PATCH 06/35] auto raising ramp test --- src/Robot.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index b12359c..3e4dc1b 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -119,14 +119,7 @@ private: //bool rampDoing = false; // This is shit code for testing. Replace it with real code. - if(!ramping && operator_stick.GetRawButton(RAMP_RAISE)) - { - std::cout << "Raising Ramp."; - //launch_spinny.Set(1); - shooter.RaiseRamp(); - ramping =true; - } - else if(!ramping && operator_stick.GetRawButton(RAMP_LOWER)) + if(operator_stick.GetRawButton(RAMP_LOWER)) { std::cout << "Lowering Ramp."; //launch_spinny.Set(-1); @@ -140,10 +133,12 @@ private: }*/ else if(ramping && !operator_stick.GetRawButton(RAMP_LOWER) - && !operator_stick.GetRawButton(RAMP_RAISE)) + && launch_spinny.GetForwardLimitOK()) + { + shooter.RaiseRamp(); + } + else { - std::cout << "Stopping Ramp."; - shooter.StopRamp(); ramping = false; } From 3584fc46340ac9aea85bd5d99d8fe7c6cc517668 Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 20 Feb 2016 13:58:35 -0500 Subject: [PATCH 07/35] untested one-touch shooting --- src/Robot.cpp | 2 +- src/Shooter.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 3e4dc1b..790269d 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -202,7 +202,7 @@ private: * Every time the method is called. This cannot be a loop in the Shoot method because * that would lock the robot every time the trigger is hit. */ - if(operator_stick.GetRawButton(TRIGGER)) + if(operator_stick.GetRawButton(TRIGGER) || (shooter.GetState() != 0)) { shooting = true; shooter.Shoot(); diff --git a/src/Shooter.h b/src/Shooter.h index f948abe..cffe153 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -175,6 +175,11 @@ public: launcher->Set(power); //std::cout << "setting shooter power" << std::endl; } + + int GetState() + { + return state; + } private: //RobotDrive *shooterDrive; From fea200cca5bf2b1e2ccc3c212026f6d4b74a6eb4 Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 20 Feb 2016 14:05:01 -0500 Subject: [PATCH 08/35] SPELLING --- src/Robot.cpp | 19 +++++++++---------- src/Shooter.h | 30 +++++++++++++++--------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 790269d..cc6010f 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -20,7 +20,7 @@ class Robot: public IterativeRobot { Talon left_drive, right_drive; CANTalon shooter1, shooter2, - launch_spinny; + ramp; RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; @@ -30,10 +30,10 @@ public: right_drive(1), // Right DriveTrain Talons plug // left wheel 2 shooter1(11), // shooter drive 1 shooter2(10), // shooter drive 2 - launch_spinny(12), + ramp(12), drive(&left_drive, &right_drive), shooter( // initialize Shooter object. - &shooter1, &shooter2, &launch_spinny), + &shooter1, &shooter2, &ramp), driver_stick(0), // right stick (operator) operator_stick(1) // left stick (driver) { @@ -65,7 +65,7 @@ private: shooter2.Enable(); left_drive.SetInverted(true); right_drive.SetInverted(true); - //launch_spinny.SetInverted(true); + //ramp.SetInverted(true); inverting = false; pickupRunning = false; ramping = false; @@ -114,7 +114,7 @@ private: void TeleopPeriodic() { - //std::cout << "Ramp position: "<< launch_spinny.GetEncPosition() << std::endl; + //std::cout << "Ramp position: "<< ramp.GetEncPosition() << std::endl; drive.ArcadeDrive(&driver_stick, true); //bool rampDoing = false; @@ -122,7 +122,7 @@ private: if(operator_stick.GetRawButton(RAMP_LOWER)) { std::cout << "Lowering Ramp."; - //launch_spinny.Set(-1); + //ramp.Set(-1); shooter.LowerRamp(); ramping = true; } @@ -133,7 +133,7 @@ private: }*/ else if(ramping && !operator_stick.GetRawButton(RAMP_LOWER) - && launch_spinny.GetForwardLimitOK()) + && ramp.GetForwardLimitOK()) { shooter.RaiseRamp(); } @@ -172,9 +172,9 @@ private: shooter.PickUp(false); pickupRunning = false; } - else if(launch_spinny.Get() != 1) + else if(ramp.Get() != 1) { - launch_spinny.Set(1); + ramp.Set(1); } /* @@ -197,7 +197,6 @@ private: /* - * Unlike the previous actions, this method does need to be called every itteration of * TeleopPeriodic. This is because the logic running this operation needs to be checked * Every time the method is called. This cannot be a loop in the Shoot method because * that would lock the robot every time the trigger is hit. diff --git a/src/Shooter.h b/src/Shooter.h index cffe153..5c04da7 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -37,7 +37,7 @@ public: // shooterDrive = new RobotDrive(s1, s2); launcher = s1; pickup = s2; - launch_spinny = r; + ramp = r; ready = true; state = READY; } @@ -51,37 +51,37 @@ public: { delete launcher; delete pickup; - delete launch_spinny; + delete ramp; } void StopShooter() { ready = true; - launch_spinny->Set(0); + ramp->Set(0); launcher->Set(0); pickup->Set(0); } void LowerRamp() { - if(launch_spinny->GetReverseLimitOK()) - launch_spinny->Set(-1); + if(ramp->GetReverseLimitOK()) + ramp->Set(-1); } void RaiseRamp() { - if(launch_spinny->GetForwardLimitOK()) - launch_spinny->Set(1); + if(ramp->GetForwardLimitOK()) + ramp->Set(1); } void StopRamp() { - launch_spinny->Set(0); + ramp->Set(0); } void BoostRamp() { - launch_spinny->Set(1); + ramp->Set(1); } void Shoot() @@ -95,7 +95,7 @@ public: case READY: { state = SPINNINGUP; - launch_spinny->Set(-1); + ramp->Set(-1); launcher->Set(LAUNCH_POWER); pickup->Set(LAUNCH_POWER); shotClock.Reset(); @@ -117,7 +117,7 @@ public: } case LAUNCH: { - launch_spinny->Set(LAUNCH_POWER); + ramp->Set(LAUNCH_POWER); state = LAUNCHING; break; } @@ -132,7 +132,7 @@ public: } case RESETTING: { - launch_spinny->Set(0); + ramp->Set(0); launcher->Set(0); pickup->Set(0); state = READY; @@ -153,10 +153,10 @@ public: launcher->Set((float) (state * PICKUP_POWER * -1)); if (state) { - launch_spinny->Set(-1.0); + ramp->Set(-1.0); } else { - launch_spinny->Set(1); + ramp->Set(1); } //std::cout << "picking up!\n"; } @@ -185,7 +185,7 @@ private: //RobotDrive *shooterDrive; CANTalon *launcher; CANTalon *pickup; - CANTalon *launch_spinny; + CANTalon *ramp; ShooterState state; Timer shotClock; From 8327823bd12143689878bf052a81ab7d99938ae0 Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 20 Feb 2016 14:05:56 -0500 Subject: [PATCH 09/35] SPELLING --- src/Robot.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Robot.cpp b/src/Robot.cpp index cc6010f..98f4375 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -197,6 +197,7 @@ private: /* + * Unlike the previous actions, this method does need to be called every iteration of * TeleopPeriodic. This is because the logic running this operation needs to be checked * Every time the method is called. This cannot be a loop in the Shoot method because * that would lock the robot every time the trigger is hit. From 904a30ab8bf5a06331f8c27498a297b24baed2ca Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 20 Feb 2016 14:08:32 -0500 Subject: [PATCH 10/35] vomits ramp current onto console --- src/Robot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 98f4375..49aeff1 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -114,7 +114,7 @@ private: void TeleopPeriodic() { - //std::cout << "Ramp position: "<< ramp.GetEncPosition() << std::endl; + std::cout << "Ramp current: "<< ramp.GetOutputCurrent() << std::endl; drive.ArcadeDrive(&driver_stick, true); //bool rampDoing = false; From 8f8c64a4500d2a37ffdcbfb7caabd8998fbd572a Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 20 Feb 2016 14:51:59 -0500 Subject: [PATCH 11/35] TalonSRX, not Talon --- src/Robot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 49aeff1..7117b87 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -18,7 +18,7 @@ class Robot: public IterativeRobot { - Talon left_drive, right_drive; + TalonSRX left_drive, right_drive; CANTalon shooter1, shooter2, ramp; RobotDrive drive; From 70fd1304a2124917daad67c158a58f2be216cea6 Mon Sep 17 00:00:00 2001 From: john sandstedt Date: Sat, 20 Feb 2016 15:22:53 -0500 Subject: [PATCH 12/35] adam style csv logging code --- src/Robot.cpp | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/Robot.cpp b/src/Robot.cpp index d6cf381..a72b64b 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -19,6 +19,10 @@ #endif // BUTTON_LAYOUT +#ifndef LOG +#define LOG(X) logA << X; logB << X; logC << X //for writing data to the csv file +#endif + class Robot: public IterativeRobot { Talon left_drive, right_drive; @@ -113,6 +117,7 @@ private: void AutonomousPeriodic() { + LogCSVData(); if(autoSelected == autoNameCustom){ //Custom Auto goes here } else { @@ -129,6 +134,7 @@ private: void TeleopPeriodic() { + LogCSVData(); std::cout << "Ramp position: "<< ramp.GetEncPosition() << std::endl; drive.ArcadeDrive(&driver_stick, true); @@ -179,6 +185,88 @@ private: void TestPeriodic() { lw->Run(); + LogCSVData(); + } + void LogCSVData() + { + static PowerDistributionPanel pdp; // preparing to read from the pdp + static DriverStation* ds = DriverStation::GetInstance(); + static std::vector motors; + + static std::ofstream logA, logB, logC; + timeval tm; + + SmartDashboard::PutBoolean("log A", logA.is_open()); + SmartDashboard::PutBoolean("log B", logB.is_open()); + SmartDashboard::PutBoolean("log C", logC.is_open()); + + if (!logA.is_open() && !logB.is_open() && !logC.is_open()) + { + std::fstream logNumFile; + int logNum; + logNumFile.open("/home/lvuser/logNum"); + logNumFile >> logNum; + logNum++; + logNumFile.seekp(0); + logNumFile << logNum; + // writing to /home/lvuser/logs/[unixtime].log + logA.open("/media/sda1/logs/log" + std::to_string(logNum) + ".csv"); + std::cerr << (logA.is_open() ? "Opened" : "Failed to open") << "log A." << std::endl; + logB.open("/media/sdb1/logs/log" + std::to_string(logNum) + ".csv"); + std::cerr << (logB.is_open() ? "Opened" : "Failed to open") << "log B." << std::endl; + logC.open("/home/lvuser/logs/log" + std::to_string(logNum) + ".csv"); + std::cerr << (logC.is_open() ? "Opened" : "Failed to open") << "log C." << std::endl; + + LOG("Time\tpdpInput voltage\tpdpTemperature\tpdpTotal Current\t"); + for (int ii = 0; ii < 16; ii++) + { + LOG("pdpChannel " << ii << " current\t"); + } + + LOG("tlaunch_spinny Bus Voltage\ttlaunch_spinny Output Current\ttlaunch_spinny Output Voltage\ttlaunch_spinny Temperature"); + motors.push_back(&ramp); + LOG("\tShooter1 Bus Voltage\tShooter1 Output Current\tShooter1 Output Voltage\tShooter1 Temperature"); + motors.push_back(&shooter1); + LOG("\tShooter2 Bus Voltage\tShooter2 Output Current\tShooter2 Output Voltage\tShooter2 Temperature"); + motors.push_back(&shooter2); + + LOG("\tJoystick X\tJoystick Y\tJoystick Twist"); + LOG("\tAlliance\tLocation\tMatch Time\tFMS Attached\tBrowned Out"); + LOG("\tTestStage"); + LOG(std::endl); + } + gettimeofday(&tm, NULL); + LOG(time(0) << '.' << std::setfill('0') << std::setw(3) << tm.tv_usec/1000); + // Some general information + LOG("\t" << pdp.GetVoltage()); + LOG("\t" << pdp.GetTemperature()); + LOG("\t" << pdp.GetTotalCurrent()); + // current on each channel + for (int ii = 0; ii < 16; ii++) + { + LOG("\t" << pdp.GetCurrent(ii)); + } + + //Talon Data + for(int ii = 0; ii < motors.size(); ii++) + { + LOG("\t" << motors[ii]->GetBusVoltage()); + LOG("\t" << motors[ii]->GetOutputVoltage()); + LOG("\t" << motors[ii]->GetOutputCurrent()); + LOG("\t" << motors[ii]->GetTemperature()); + } + //control data + LOG("\t" << driver_stick.GetX()); + LOG("\t" << driver_stick.GetY()); + LOG("\t" << driver_stick.GetTwist()); + + //DriverStation Data + LOG("\t" << ds->GetAlliance()); + LOG("\t" << ds->GetLocation()); + LOG("\t" << ds->GetMatchTime()); + LOG("\t" << ds->IsFMSAttached()); + LOG("\t" << ds->IsSysBrownedOut()); + LOG(std::endl); } }; From 220862a63e3fec993449a70c41f2066cd77c5ec8 Mon Sep 17 00:00:00 2001 From: dkbug Date: Sat, 20 Feb 2016 15:45:47 -0500 Subject: [PATCH 13/35] added good ramp code --- src/Robot.cpp | 17 +++++++---------- src/Shooter.h | 4 ++-- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 7117b87..196bdc1 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -119,26 +119,23 @@ private: //bool rampDoing = false; // This is shit code for testing. Replace it with real code. - if(operator_stick.GetRawButton(RAMP_LOWER)) + if(!ramping && operator_stick.GetRawButton(RAMP_LOWER)) { std::cout << "Lowering Ramp."; //ramp.Set(-1); shooter.LowerRamp(); ramping = true; } - /*else if(!ramping && operator_stick.GetRawButton(TRIGGER)) - { - shooter.BoostRamp(); - ramping = true; - }*/ - else if(ramping - && !operator_stick.GetRawButton(RAMP_LOWER) - && ramp.GetForwardLimitOK()) + else if(!ramping + && !operator_stick.GetRawButton(RAMP_RAISE)) { shooter.RaiseRamp(); + ramping = true; } - else + else if(ramping && !operator_stick.GetRawButton(RAMP_RAISE) + && !operator_stick.GetRawButton(RAMP_LOWER)) { + shooter.StopRamp(); ramping = false; } diff --git a/src/Shooter.h b/src/Shooter.h index 562bf75..257d661 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -64,7 +64,7 @@ public: void LowerRamp() { - ramp->Set(-1); + ramp->Set(-0.5); if(ramp->Limits::kReverseLimit){ SmartDashboard::PutNumber("ramp", 2); //going to put a circlar dial to show where the ramp could be } else { @@ -74,7 +74,7 @@ public: void RaiseRamp() { - ramp->Set(1); + ramp->Set(0.5); if(ramp->Limits::kForwardLimit){ SmartDashboard::PutNumber("ramp", 0); //going to put a circlar dial to show where the ramp could be } else { From cca8a07f6859ca50ae02958cad74be259de23987 Mon Sep 17 00:00:00 2001 From: dkbug Date: Sat, 20 Feb 2016 16:02:05 -0500 Subject: [PATCH 14/35] button mis-choice. --- src/Robot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 196bdc1..28872a0 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -6,8 +6,8 @@ #define TRIGGER 1 // Trigger button number #define THUMB 2 // Thumb button number -#define RAMP_RAISE 3 // Button 3 for Raising Ramp -#define RAMP_LOWER 4 // Button 4 to lower ramp. +#define RAMP_RAISE 5 // Button 3 for Raising Ramp +#define RAMP_LOWER 3 // Button 4 to lower ramp. #define UNJAM 11 #define DEADZONE_RADIUS 0.01 // Deadzone Radius prevents tiny twitches in the joystick's value from From de785512d6e51f5aedded76339dd4b09c713b84f Mon Sep 17 00:00:00 2001 From: dkbug Date: Sat, 20 Feb 2016 16:07:26 -0500 Subject: [PATCH 15/35] fixed a stupid logic error if ramp is not raising, raise the ramp :P --- src/Robot.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 28872a0..34a3fc5 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -169,11 +169,6 @@ private: shooter.PickUp(false); pickupRunning = false; } - else if(ramp.Get() != 1) - { - ramp.Set(1); - } - /* * The 'inverting' variable is used to make sure that the drive train isn't getting * inverted every iteration of the TeleopPeriodic method while the button is held down. From 9d2e8f3675f8c5a78b8400f6ab363b6b026ad6f5 Mon Sep 17 00:00:00 2001 From: john sandstedt Date: Mon, 22 Feb 2016 19:04:27 -0500 Subject: [PATCH 16/35] logging code... fixed the error initializing the DriverStation Object potentially, and fixed a few of the syntax errors ' --- src/Robot.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index a72b64b..e847442 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -31,6 +31,7 @@ class Robot: public IterativeRobot RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; + DriverStation ds; float power; public: Robot(): @@ -45,6 +46,7 @@ public: driver_stick(0), // right stick (operator) operator_stick(1) // left stick (driver) { + ds.GetInstance(); } @@ -59,11 +61,10 @@ private: const std::string autoNameCustom = "My Auto"; std::string autoSelected; - void LogData() + /*void LogData() { static PowerDistributionPanel pdp; - static DriverStation* ds = DriverStation::GetInstance(); - static DriverStation* ds = DriverStation::GetInstance(); + static DriverStation ds = DriverStation::GetInstance(); static std::vector motors; static std::ofstream logA, logB, logC; @@ -72,7 +73,7 @@ private: SmartDashboard::PutBoolean("log A", logA.is_open()); SmartDashboard::PutBoolean("log B", logB.is_open()); SmartDashboard::PutBoolean("log C", logC.is_open()); - } + }*/ void RobotInit() { @@ -190,7 +191,6 @@ private: void LogCSVData() { static PowerDistributionPanel pdp; // preparing to read from the pdp - static DriverStation* ds = DriverStation::GetInstance(); static std::vector motors; static std::ofstream logA, logB, logC; @@ -261,11 +261,11 @@ private: LOG("\t" << driver_stick.GetTwist()); //DriverStation Data - LOG("\t" << ds->GetAlliance()); - LOG("\t" << ds->GetLocation()); - LOG("\t" << ds->GetMatchTime()); - LOG("\t" << ds->IsFMSAttached()); - LOG("\t" << ds->IsSysBrownedOut()); + LOG("\t" << ds.GetAlliance()); + LOG("\t" << ds.GetLocation()); + LOG("\t" << ds.GetMatchTime()); + LOG("\t" << ds.IsFMSAttached()); + LOG("\t" << ds.IsSysBrownedOut()); LOG(std::endl); } }; From 3475afb6649ac4ce02a56a13ebb6de673534284d Mon Sep 17 00:00:00 2001 From: john sandstedt Date: Mon, 22 Feb 2016 19:13:09 -0500 Subject: [PATCH 17/35] potato... also maybe fixed driverstation::GetInstance() again potentially --- src/Robot.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index e847442..5e9beaf 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -31,7 +31,7 @@ class Robot: public IterativeRobot RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; - DriverStation ds; + //DriverStation DriverStation::GetInstance(); float power; public: Robot(): @@ -46,7 +46,7 @@ public: driver_stick(0), // right stick (operator) operator_stick(1) // left stick (driver) { - ds.GetInstance(); + //DriverStation::GetInstance().GetInstance(); } @@ -64,7 +64,7 @@ private: /*void LogData() { static PowerDistributionPanel pdp; - static DriverStation ds = DriverStation::GetInstance(); + static DriverStation DriverStation::GetInstance() = DriverStation::GetInstance(); static std::vector motors; static std::ofstream logA, logB, logC; @@ -261,11 +261,11 @@ private: LOG("\t" << driver_stick.GetTwist()); //DriverStation Data - LOG("\t" << ds.GetAlliance()); - LOG("\t" << ds.GetLocation()); - LOG("\t" << ds.GetMatchTime()); - LOG("\t" << ds.IsFMSAttached()); - LOG("\t" << ds.IsSysBrownedOut()); + LOG("\t" << DriverStation::GetInstance().GetAlliance()); + LOG("\t" << DriverStation::GetInstance().GetLocation()); + LOG("\t" << DriverStation::GetInstance().GetMatchTime()); + LOG("\t" << DriverStation::GetInstance().IsFMSAttached()); + LOG("\t" << DriverStation::GetInstance().IsSysBrownedOut()); LOG(std::endl); } }; From 6384820aeff4971fbc72add83f2bfa62ab06d8c6 Mon Sep 17 00:00:00 2001 From: dkbug Date: Sat, 27 Feb 2016 13:25:33 -0500 Subject: [PATCH 18/35] no more settings --- .settings/org.eclipse.cdt.managedbuilder.core.prefs | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .settings/org.eclipse.cdt.managedbuilder.core.prefs diff --git a/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/.settings/org.eclipse.cdt.managedbuilder.core.prefs deleted file mode 100644 index a3c3365..0000000 --- a/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -eclipse.preferences.version=1 -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/CPATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/CPATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/CPLUS_INCLUDE_PATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/CPLUS_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/C_INCLUDE_PATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/C_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/append=true -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/appendContributed=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/LIBRARY_PATH/delimiter=; -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/LIBRARY_PATH/operation=remove -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/append=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.cross.exe.debug.1104744751/appendContributed=true From 7135c0b27dda3f69d1b7f2f82056064a43d9578f Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 27 Feb 2016 13:29:41 -0500 Subject: [PATCH 19/35] fixed typo --- src/Robot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 62b2b39..fa2058c 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -279,7 +279,7 @@ private: { shooting = false; shooter.StopShooter(); - }*/ + } if(!arming && driver_stick.GetRawButton(RAMP_RAISE)) { From 5db889090c0d298622bcc4085efe199bf05b8eda Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 27 Feb 2016 14:30:47 -0500 Subject: [PATCH 20/35] TYPOS --- src/Robot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index fa2058c..95a9c3c 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -204,7 +204,7 @@ private: { shooter.BoostRamp(); ramping = true; - } + }*/ else if(ramping && !operator_stick.GetRawButton(RAMP_RAISE) && !operator_stick.GetRawButton(RAMP_LOWER)) { From 234753f0509a1c3b69b4d50ce9019849a9d4c77b Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 01:25:21 -0500 Subject: [PATCH 21/35] Remove old files, add some to .gitignore, move Makefile --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4584c5a --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +LIBS=wpi +override CFLAGS +=-l$(LIBS) -std=c++14 +TEAM=1786 +SSH_OPTIONS=-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no +SSH_SSHPASS=$(shell command -v sshpass >/dev/null 2>&1 && echo -n "sshpass -p ''") + +all: deploy + +build: FRCUserProgram + +FRCUserProgram: robot.cpp + @echo "Building FRCUserProgram" + arm-frc-linux-gnueabi-g++ robot.cpp -o FRCUserProgram $(CFLAGS) + +clean: + rm FRCUserProgram + +deploy: build + @echo "Copying FRCUserProgram" + @ssh $(SSH_OPTIONS) lvuser@10.17.86.20 'rm -f /home/lvuser/FRCUserProgram' + @scp $(SSH_OPTIONS) -o "LogLevel QUIET" FRCUserProgram lvuser@10.17.86.20:/home/lvuser/FRCUserProgram + @echo "Restarting FRCUserProgram" + @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' + +restart: FRCUserProgram + @echo "Restarting FRCUserProgram" + @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' + +stop: + @echo "Restarting FRCUserProgram" + @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t'y + From fbf547f536abff1a98cbccf2a222c62897595d52 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 01:26:54 -0500 Subject: [PATCH 22/35] Simplify Makefile and correct for new file name --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4584c5a..99c08a2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ LIBS=wpi -override CFLAGS +=-l$(LIBS) -std=c++14 +CXX=arm-frc-linux-gnueabi-g++ +override CPPFLAGS +=-std=c++14 +LDFLAGS=-l$(LIBS) TEAM=1786 SSH_OPTIONS=-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no SSH_SSHPASS=$(shell command -v sshpass >/dev/null 2>&1 && echo -n "sshpass -p ''") @@ -8,9 +10,9 @@ all: deploy build: FRCUserProgram -FRCUserProgram: robot.cpp +FRCUserProgram: src/Robot.cpp @echo "Building FRCUserProgram" - arm-frc-linux-gnueabi-g++ robot.cpp -o FRCUserProgram $(CFLAGS) + $(CXX) $(CPPFLAGS) $< -o $@ $(LDFLAGS) clean: rm FRCUserProgram From 7422635b49eb89b09e4027bd6698f6817e8859e0 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 01:29:29 -0500 Subject: [PATCH 23/35] Remove unused code and generic comment --- src/Robot.cpp | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 95a9c3c..709722a 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -43,8 +43,6 @@ class Robot: public IterativeRobot RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; - //DriverStation DriverStation::GetInstance(); - //float power; public: Robot(): left_drive(0), // Left DriveTrain Talons plug into PWM channel 1 with a Y-splitter @@ -79,20 +77,6 @@ private: const std::string autoNameCustom = "My Auto"; std::string autoSelected; - /*void LogData() - { - static PowerDistributionPanel pdp; - static DriverStation DriverStation::GetInstance() = DriverStation::GetInstance(); - static std::vector motors; - - static std::ofstream logA, logB, logC; - timeval tm; - - SmartDashboard::PutBoolean("log A", logA.is_open()); - SmartDashboard::PutBoolean("log B", logB.is_open()); - SmartDashboard::PutBoolean("log C", logC.is_open()); - }*/ - void RobotInit() { chooser = new SendableChooser(); @@ -115,16 +99,6 @@ private: } - - /** - * This autonomous (along with the chooser code above) shows how to select between different autonomous modes - * using the dashboard. The sendable chooser code works with the Java SmartDashboard. If you prefer the LabVIEW - * Dashboard, remove all of the chooser code and uncomment the GetString line to get the auto name from the text box - * below the Gyro - * - * You can add additional auto modes by adding additional comparisons to the if-else structure below with additional strings. - * If using the SendableChooser make sure to add them to the chooser code above as well. - */ void AutonomousInit() { autoSelected = *((std::string*)chooser->GetSelected()); @@ -402,27 +376,6 @@ private: LOG(std::endl); } - void SimpleDrive() - { - float x = -driver_stick.GetX(); - float y = -driver_stick.GetY(); - float left = 0; - float right = 0; - - if (x > 0) - { - right = y; - left = (1- x*TURN_FACTOR)*y ; - } - else - { - left = y; - right = (1+x*TURN_FACTOR)*y; - } - - drive.TankDrive(left, right); - } - void UpdateDrive() { float x = -driver_stick.GetX(); From 56f043bcd0eec52fe5e4f59f55320d5131d0a942 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 01:52:40 -0500 Subject: [PATCH 24/35] Fix public and private placement Also fix using LogCSVData and UpdateDrive before they are declared --- src/Robot.cpp | 250 +++++++++++++++++++++++++------------------------- 1 file changed, 126 insertions(+), 124 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 709722a..6ea8ff4 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -36,6 +36,7 @@ class Robot: public IterativeRobot { +private: TalonSRX left_drive, right_drive; CANTalon shooter1, shooter2, ramp, @@ -43,6 +44,131 @@ class Robot: public IterativeRobot RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; + + // instance variables + bool pickupRunning; // don't want to spam the Talon with set messages. Toggle the pickup when a button is pressed or released. + bool inverting; + bool ramping; + bool shooting; + bool unjamming; + bool arming; + bool arcade; + float shooter_power; + + LiveWindow *lw = LiveWindow::GetInstance(); + SendableChooser *chooser; + const std::string autoNameDefault = "Default"; + const std::string autoNameCustom = "My Auto"; + std::string autoSelected; + + void LogCSVData() + { + static PowerDistributionPanel pdp; // preparing to read from the pdp + static std::vector motors; + + static std::ofstream logA, logB, logC; + timeval tm; + + SmartDashboard::PutBoolean("log A", logA.is_open()); + SmartDashboard::PutBoolean("log B", logB.is_open()); + SmartDashboard::PutBoolean("log C", logC.is_open()); + + if (!logA.is_open() && !logB.is_open() && !logC.is_open()) + { + std::fstream logNumFile; + int logNum; + logNumFile.open("/home/lvuser/logNum"); + logNumFile >> logNum; + logNum++; + logNumFile.seekp(0); + logNumFile << logNum; + // writing to /home/lvuser/logs/[unixtime].log + logA.open("/media/sda1/logs/log" + std::to_string(logNum) + ".csv"); + std::cerr << (logA.is_open() ? "Opened" : "Failed to open") << "log A." << std::endl; + logB.open("/media/sdb1/logs/log" + std::to_string(logNum) + ".csv"); + std::cerr << (logB.is_open() ? "Opened" : "Failed to open") << "log B." << std::endl; + logC.open("/home/lvuser/logs/log" + std::to_string(logNum) + ".csv"); + std::cerr << (logC.is_open() ? "Opened" : "Failed to open") << "log C." << std::endl; + + LOG("Time\tpdpInput voltage\tpdpTemperature\tpdpTotal Current\t"); + for (int ii = 0; ii < 16; ii++) + { + LOG("pdpChannel " << ii << " current\t"); + } + + LOG("tlaunch_spinny Bus Voltage\ttlaunch_spinny Output Current\ttlaunch_spinny Output Voltage\ttlaunch_spinny Temperature"); + motors.push_back(&ramp); + LOG("\tShooter1 Bus Voltage\tShooter1 Output Current\tShooter1 Output Voltage\tShooter1 Temperature"); + motors.push_back(&shooter1); + LOG("\tShooter2 Bus Voltage\tShooter2 Output Current\tShooter2 Output Voltage\tShooter2 Temperature"); + motors.push_back(&shooter2); + + LOG("\tJoystick X\tJoystick Y\tJoystick Twist"); + LOG("\tAlliance\tLocation\tMatch Time\tFMS Attached\tBrowned Out"); + LOG("\tTestStage"); + LOG(std::endl); + } + gettimeofday(&tm, NULL); + LOG(time(0) << '.' << std::setfill('0') << std::setw(3) << tm.tv_usec/1000); + // Some general information + LOG("\t" << pdp.GetVoltage()); + LOG("\t" << pdp.GetTemperature()); + LOG("\t" << pdp.GetTotalCurrent()); + // current on each channel + for (int ii = 0; ii < 16; ii++) + { + LOG("\t" << pdp.GetCurrent(ii)); + } + + //Talon Data + for(int ii = 0; ii < motors.size(); ii++) + { + LOG("\t" << motors[ii]->GetBusVoltage()); + LOG("\t" << motors[ii]->GetOutputVoltage()); + LOG("\t" << motors[ii]->GetOutputCurrent()); + LOG("\t" << motors[ii]->GetTemperature()); + } + //control data + LOG("\t" << driver_stick.GetX()); + LOG("\t" << driver_stick.GetY()); + LOG("\t" << driver_stick.GetTwist()); + + //DriverStation Data + LOG("\t" << DriverStation::GetInstance().GetAlliance()); + LOG("\t" << DriverStation::GetInstance().GetLocation()); + LOG("\t" << DriverStation::GetInstance().GetMatchTime()); + LOG("\t" << DriverStation::GetInstance().IsFMSAttached()); + LOG("\t" << DriverStation::GetInstance().IsSysBrownedOut()); + LOG(std::endl); + } + + /** + * Takes the gross raw throttle input from joystick and returns a + * value between 0.0-1.0 (no negative values) + */ + float SaneThrottle(float rawThrottle) + { + return ((1.0 - rawThrottle) / 2.0); + } + + void UpdateDrive() + { + float x = -driver_stick.GetX(); + float y = -driver_stick.GetY(); + if (x > 0) + { + float right = y * SaneThrottle(driver_stick.GetThrottle()); + float left = (1-x)*y * SaneThrottle(driver_stick.GetThrottle()); + drive.TankDrive(left, right); + } + else + { + float left = y * SaneThrottle(driver_stick.GetThrottle()); + float right = (1+x)*y * SaneThrottle(driver_stick.GetThrottle()); + drive.TankDrive(left, right); + } + } + public: Robot(): left_drive(0), // Left DriveTrain Talons plug into PWM channel 1 with a Y-splitter @@ -60,23 +186,6 @@ public: } -private: - // instance variables - bool pickupRunning; // don't want to spam the Talon with set messages. Toggle the pickup when a button is pressed or released. - bool inverting; - bool ramping; - bool shooting; - bool unjamming; - bool arming; - bool arcade; - float shooter_power; - - LiveWindow *lw = LiveWindow::GetInstance(); - SendableChooser *chooser; - const std::string autoNameDefault = "Default"; - const std::string autoNameCustom = "My Auto"; - std::string autoSelected; - void RobotInit() { chooser = new SendableChooser(); @@ -281,118 +390,11 @@ private: } } - /** - * Takes the gross raw throttle input from joystick and returns a - * value between 0.0-1.0 (no negative values) - */ - float SaneThrottle(float rawThrottle) - { - return ((1.0 - rawThrottle) / 2.0); - } - void TestPeriodic() { lw->Run(); LogCSVData(); } - void LogCSVData() - { - static PowerDistributionPanel pdp; // preparing to read from the pdp - static std::vector motors; - - static std::ofstream logA, logB, logC; - timeval tm; - - SmartDashboard::PutBoolean("log A", logA.is_open()); - SmartDashboard::PutBoolean("log B", logB.is_open()); - SmartDashboard::PutBoolean("log C", logC.is_open()); - - if (!logA.is_open() && !logB.is_open() && !logC.is_open()) - { - std::fstream logNumFile; - int logNum; - logNumFile.open("/home/lvuser/logNum"); - logNumFile >> logNum; - logNum++; - logNumFile.seekp(0); - logNumFile << logNum; - // writing to /home/lvuser/logs/[unixtime].log - logA.open("/media/sda1/logs/log" + std::to_string(logNum) + ".csv"); - std::cerr << (logA.is_open() ? "Opened" : "Failed to open") << "log A." << std::endl; - logB.open("/media/sdb1/logs/log" + std::to_string(logNum) + ".csv"); - std::cerr << (logB.is_open() ? "Opened" : "Failed to open") << "log B." << std::endl; - logC.open("/home/lvuser/logs/log" + std::to_string(logNum) + ".csv"); - std::cerr << (logC.is_open() ? "Opened" : "Failed to open") << "log C." << std::endl; - - LOG("Time\tpdpInput voltage\tpdpTemperature\tpdpTotal Current\t"); - for (int ii = 0; ii < 16; ii++) - { - LOG("pdpChannel " << ii << " current\t"); - } - - LOG("tlaunch_spinny Bus Voltage\ttlaunch_spinny Output Current\ttlaunch_spinny Output Voltage\ttlaunch_spinny Temperature"); - motors.push_back(&ramp); - LOG("\tShooter1 Bus Voltage\tShooter1 Output Current\tShooter1 Output Voltage\tShooter1 Temperature"); - motors.push_back(&shooter1); - LOG("\tShooter2 Bus Voltage\tShooter2 Output Current\tShooter2 Output Voltage\tShooter2 Temperature"); - motors.push_back(&shooter2); - - LOG("\tJoystick X\tJoystick Y\tJoystick Twist"); - LOG("\tAlliance\tLocation\tMatch Time\tFMS Attached\tBrowned Out"); - LOG("\tTestStage"); - LOG(std::endl); - } - gettimeofday(&tm, NULL); - LOG(time(0) << '.' << std::setfill('0') << std::setw(3) << tm.tv_usec/1000); - // Some general information - LOG("\t" << pdp.GetVoltage()); - LOG("\t" << pdp.GetTemperature()); - LOG("\t" << pdp.GetTotalCurrent()); - // current on each channel - for (int ii = 0; ii < 16; ii++) - { - LOG("\t" << pdp.GetCurrent(ii)); - } - - //Talon Data - for(int ii = 0; ii < motors.size(); ii++) - { - LOG("\t" << motors[ii]->GetBusVoltage()); - LOG("\t" << motors[ii]->GetOutputVoltage()); - LOG("\t" << motors[ii]->GetOutputCurrent()); - LOG("\t" << motors[ii]->GetTemperature()); - } - //control data - LOG("\t" << driver_stick.GetX()); - LOG("\t" << driver_stick.GetY()); - LOG("\t" << driver_stick.GetTwist()); - - //DriverStation Data - LOG("\t" << DriverStation::GetInstance().GetAlliance()); - LOG("\t" << DriverStation::GetInstance().GetLocation()); - LOG("\t" << DriverStation::GetInstance().GetMatchTime()); - LOG("\t" << DriverStation::GetInstance().IsFMSAttached()); - LOG("\t" << DriverStation::GetInstance().IsSysBrownedOut()); - LOG(std::endl); - } - - void UpdateDrive() - { - float x = -driver_stick.GetX(); - float y = -driver_stick.GetY(); - if (x > 0) - { - float right = y * SaneThrottle(driver_stick.GetThrottle()); - float left = (1-x)*y * SaneThrottle(driver_stick.GetThrottle()); - drive.TankDrive(left, right); - } - else - { - float left = y * SaneThrottle(driver_stick.GetThrottle()); - float right = (1+x)*y * SaneThrottle(driver_stick.GetThrottle()); - drive.TankDrive(left, right); - } - } }; START_ROBOT_CLASS(Robot) From a09be7343a573553704ebba374f39e9dedbf7edf Mon Sep 17 00:00:00 2001 From: Aidan Ferguson Date: Sat, 5 Mar 2016 10:31:25 -0500 Subject: [PATCH 25/35] changed ramp power --- src/Shooter.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Shooter.h b/src/Shooter.h index 5de8a86..8339baf 100644 --- a/src/Shooter.h +++ b/src/Shooter.h @@ -12,6 +12,7 @@ #define LAUNCH_POWER 1 #define SPINUP_TIME 1.5 // seconds. #define LAUNCH_TIME 0.5 +#define RAMP_POWER 0.3 class Shooter { @@ -64,7 +65,7 @@ public: void LowerRamp() { - ramp->Set(-0.5); + ramp->Set(-RAMP_POWER); if(ramp->Limits::kReverseLimit){ SmartDashboard::PutNumber("ramp", 2); //going to put a circlar dial to show where the ramp could be } else { @@ -74,7 +75,7 @@ public: void RaiseRamp() { - ramp->Set(0.5); + ramp->Set(RAMP_POWER); if(ramp->Limits::kForwardLimit){ SmartDashboard::PutNumber("ramp", 0); //going to put a circlar dial to show where the ramp could be } else { From 609f96e15d4ef2a4c4da777ab37e1b9407e0afc1 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 13:28:49 -0500 Subject: [PATCH 26/35] Update hostname in Makefile, make it slightly more verbose --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 99c08a2..36efedf 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,9 @@ CXX=arm-frc-linux-gnueabi-g++ override CPPFLAGS +=-std=c++14 LDFLAGS=-l$(LIBS) TEAM=1786 -SSH_OPTIONS=-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no +SSH_OPTIONS=-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no SSH_SSHPASS=$(shell command -v sshpass >/dev/null 2>&1 && echo -n "sshpass -p ''") +SSH_HOST=roborio-1786-frc.local all: deploy @@ -19,16 +20,16 @@ clean: deploy: build @echo "Copying FRCUserProgram" - @ssh $(SSH_OPTIONS) lvuser@10.17.86.20 'rm -f /home/lvuser/FRCUserProgram' - @scp $(SSH_OPTIONS) -o "LogLevel QUIET" FRCUserProgram lvuser@10.17.86.20:/home/lvuser/FRCUserProgram + ssh $(SSH_OPTIONS) lvuser@$(SSH_HOST) 'rm -f /home/lvuser/FRCUserProgram' + scp $(SSH_OPTIONS) -o "LogLevel QUIET" FRCUserProgram lvuser@$(SSH_HOST):/home/lvuser/FRCUserProgram @echo "Restarting FRCUserProgram" - @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' + $(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@$(SSH_HOST) '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' restart: FRCUserProgram - @echo "Restarting FRCUserProgram" - @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' + echo "Restarting FRCUserProgram" + $(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@$(SSH_HOST) '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r' stop: @echo "Restarting FRCUserProgram" - @$(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@10.17.86.20 '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t'y + $(SSH_SSHPASS) ssh $(SSH_OPTIONS) admin@$(SSH_HOST) '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t'y From af2ba558f13b18868e53c503ab2d342f654bfa41 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 13:44:17 -0500 Subject: [PATCH 27/35] Basic auto mode --- src/Robot.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/Robot.cpp b/src/Robot.cpp index 6ea8ff4..d66a28d 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -44,6 +44,7 @@ private: RobotDrive drive; Shooter shooter; Joystick driver_stick, operator_stick; + Timer auto_clock; // instance variables bool pickupRunning; // don't want to spam the Talon with set messages. Toggle the pickup when a button is pressed or released. @@ -55,6 +56,15 @@ private: bool arcade; float shooter_power; + enum auto_states + { + START, + DRIVING_FORWARD, + STOP + }; + + auto_states auto_status; + LiveWindow *lw = LiveWindow::GetInstance(); SendableChooser *chooser; const std::string autoNameDefault = "Default"; @@ -218,16 +228,45 @@ public: //Custom Auto goes here } else { //Default Auto goes here + auto_status = START; } } void AutonomousPeriodic() { + const float drivePower = 0.7; LogCSVData(); if(autoSelected == autoNameCustom){ //Custom Auto goes here } else { //Default Auto goes here + switch (auto_status) + { + case START: + { + auto_clock.Start(); + auto_status = DRIVING_FORWARD; + break; + } + case DRIVING_FORWARD: + { + if (auto_clock.Get() > 5.0 ) + { + drive.TankDrive(0.0, 0.0); + auto_status = STOP; + } + else + { + drive.TankDrive(drivePower, drivePower); + } + break; + } + case STOP: + { + std::cout << "All done!\n" ; + break; + } + } } } From 8ac21a905809612b66a1bba242825370d7ad7957 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 14:16:42 -0500 Subject: [PATCH 28/35] Add Limits to SmartDashboard --- src/Robot.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Robot.cpp b/src/Robot.cpp index d66a28d..6303a61 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -82,6 +82,10 @@ private: SmartDashboard::PutBoolean("log A", logA.is_open()); SmartDashboard::PutBoolean("log B", logB.is_open()); SmartDashboard::PutBoolean("log C", logC.is_open()); + SmartDashboard::PutBoolean("Ramp Limit F", ramp.GetForwardLimitOK()); + SmartDashboard::PutBoolean("Ramp Limit R", ramp.GetReverseLimitOK()); + SmartDashboard::PutBoolean("Arms Limit F", arms.GetForwardLimitOK()); + SmartDashboard::PutBoolean("Arms Limit R", arms.GetReverseLimitOK()); if (!logA.is_open() && !logB.is_open() && !logC.is_open()) { From 9c3a89684cc054aa20b5e5dd9f31afd527293aa5 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 14:28:32 -0500 Subject: [PATCH 29/35] Add real TestPeriodic --- src/Robot.cpp | 142 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 141 insertions(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 6303a61..bcd86dd 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -435,7 +435,147 @@ public: void TestPeriodic() { - lw->Run(); + const int driveTime = 5; //Drive for 5 seconds + const float drivePower = 0.5, armPower=.35, rampPower=.4; //Arbitrary powers to test at + static Timer t; + enum test_stages { + INIT, + ARMS_UP, + ARMS_DOWN, + RAMP_UP, + RAMP_DOWN, + DRIVE_FORWARD, + DRIVE_BACKWARD, + TURN_CW, + TURN_CCW, + END}; + + static enum test_stages test_stage, old_test_stage; + + if (old_test_stage != test_stage) + { + //Reset timer between stages + t.Stop(); + t.Reset(); + + //Wait for a button press between stages + if (operator_stick.GetRawButton(TRIGGER)) + old_test_stage = test_stage; + } + else + { + if(!t.Get()) t.Start(); + + switch (test_stage) + { + case INIT: + { + break; + } + + case ARMS_UP: + { + if (arms.GetForwardLimitOK()) + arms.Set(1); + else + { + arms.Set(0); + test_stage = ARMS_DOWN; + } + break; + } + + case ARMS_DOWN: + { + if (arms.GetReverseLimitOK()) + arms.Set(-1); + else + { + arms.Set(0); + test_stage = RAMP_UP; + } + break; + } + + case RAMP_UP: + { + if (arms.GetForwardLimitOK()) + ramp.Set(1); + else + { + ramp.Set(0); + test_stage = RAMP_DOWN; + } + break; + } + + case RAMP_DOWN: + { + if (arms.GetReverseLimitOK()) + ramp.Set(-1); + else + { + ramp.Set(0); + test_stage = DRIVE_FORWARD; + } + break; + } + + case DRIVE_FORWARD: + { + if (t.Get() < driveTime) + drive.TankDrive(drivePower, drivePower); + else + { + drive.TankDrive(0.0, 0.0); + test_stage = DRIVE_BACKWARD; + } + break; + } + + case DRIVE_BACKWARD: + { + if (t.Get() < driveTime) + drive.TankDrive(-drivePower, -drivePower); + else + { + drive.TankDrive(0.0, 0.0); + test_stage = TURN_CW; + } + break; + } + + case TURN_CW: + { + if (t.Get() < driveTime) + drive.TankDrive(drivePower, -drivePower); + else + { + drive.TankDrive(0.0, 0.0); + test_stage = TURN_CCW; + } + break; + } + + case TURN_CCW: + { + if (t.Get() < driveTime) + drive.TankDrive(-drivePower, drivePower); + else + { + drive.TankDrive(0.0, 0.0); + test_stage = END; + } + break; + } + + case END: + { + break; + } + } + } + LogCSVData(); } }; From 5d850477282f54ef30cc7d4937f30e7a93afc392 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 15:55:20 -0500 Subject: [PATCH 30/35] Change drivePower to 1, driveTime to 3 (seconds) --- src/Robot.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index bcd86dd..f867ef5 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -238,7 +238,8 @@ public: void AutonomousPeriodic() { - const float drivePower = 0.7; + const float drivePower = 1; + const float driveTime = 3; //Seconds to drive forward LogCSVData(); if(autoSelected == autoNameCustom){ //Custom Auto goes here @@ -254,7 +255,7 @@ public: } case DRIVING_FORWARD: { - if (auto_clock.Get() > 5.0 ) + if (auto_clock.Get() > driveTime) { drive.TankDrive(0.0, 0.0); auto_status = STOP; From 5cf6d6ed36c4c419afc4e309625e80a38e496e2c Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 5 Mar 2016 16:43:40 -0500 Subject: [PATCH 31/35] Switch arms movement from buttons to operator_stick Y axis --- src/Robot.cpp | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index f867ef5..e362cc1 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -19,6 +19,8 @@ #define RAMP_LOWER 3 // Button 4 to lower ramp. #define UNJAM 11 +#define ARMS_SCALE 0.75 + #define DEADZONE_RADIUS 0.05 // Deadzone Radius prevents tiny twitches in the joystick's value from // affecting the robot. Use this for cleaning up drive train and shooter. // Also used for detecting changes in an axis' value. @@ -389,38 +391,13 @@ public: { inverting = false; } - - - /* - * Unlike the previous actions, this method does need to be called every iteration of - * TeleopPeriodic. This is because the logic running this operation needs to be checked - * Every time the method is called. This cannot be a loop in the Shoot method because - * that would lock the robot every time the trigger is hit. - */ - if(operator_stick.GetRawButton(TRIGGER) || (shooter.GetState() != 0)) + + if(operator_stick.GetRawButton(4)) { - shooting = true; - shooter.Shoot(); + arms.Set(-operator_stick.GetY() * ARMS_SCALE); } - else if(shooting && !operator_stick.GetRawButton(TRIGGER)) + else { - shooting = false; - shooter.StopShooter(); - } - - if(!arming && driver_stick.GetRawButton(RAMP_RAISE)) - { - arming = true; - arms.Set(1); - } - else if(!arming && driver_stick.GetRawButton(RAMP_LOWER)) - { - arming = true; - arms.Set(-1); - } - else if(arming && !driver_stick.GetRawButton(RAMP_RAISE) && !driver_stick.GetRawButton(RAMP_LOWER)) - { - arming = false; arms.Set(0); } From 623a4022ae87126cdf8e80bd66b76f065a3da0aa Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 6 Mar 2016 10:01:32 -0500 Subject: [PATCH 32/35] Switch Limit checking code --- src/Robot.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index e362cc1..d1f891b 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -84,10 +84,11 @@ private: SmartDashboard::PutBoolean("log A", logA.is_open()); SmartDashboard::PutBoolean("log B", logB.is_open()); SmartDashboard::PutBoolean("log C", logC.is_open()); - SmartDashboard::PutBoolean("Ramp Limit F", ramp.GetForwardLimitOK()); - SmartDashboard::PutBoolean("Ramp Limit R", ramp.GetReverseLimitOK()); - SmartDashboard::PutBoolean("Arms Limit F", arms.GetForwardLimitOK()); - SmartDashboard::PutBoolean("Arms Limit R", arms.GetReverseLimitOK()); + + SmartDashboard::PutBoolean("Ramp Limit F", !ramp.IsFwdLimitSwitchClosed()); + SmartDashboard::PutBoolean("Ramp Limit R", !ramp.IsRevLimitSwitchClosed()); + SmartDashboard::PutBoolean("Arms Limit F", !arms.IsFwdLimitSwitchClosed()); + SmartDashboard::PutBoolean("Arms Limit R", !arms.IsRevLimitSwitchClosed()); if (!logA.is_open() && !logB.is_open() && !logC.is_open()) { From 09cbe471a9f4a7604e2f266b326c5b7e5cef1552 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 9 Mar 2016 19:11:28 -0500 Subject: [PATCH 33/35] Actually use the autonomous chooser --- src/Robot.cpp | 79 ++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index d1f891b..5b80f6a 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -69,8 +69,10 @@ private: LiveWindow *lw = LiveWindow::GetInstance(); SendableChooser *chooser; - const std::string autoNameDefault = "Default"; - const std::string autoNameCustom = "My Auto"; + const std::string autoNameDefault = "1.7 Seconds (Slightly Longer)"; + const std::string autoNameShort = "1.5 Seconds (Short, good on the moat)"; + const std::string autoNameOne = "1 Seconds"; + const std::string autoNameDisable = "Disable Autonomous (set time to 0)"; std::string autoSelected; void LogCSVData() @@ -206,8 +208,11 @@ public: void RobotInit() { chooser = new SendableChooser(); + chooser->AddDefault(autoNameDefault, (void*)&autoNameDefault); - chooser->AddObject(autoNameCustom, (void*)&autoNameCustom); + chooser->AddObject(autoNameShort, (void*)&autoNameShort); + chooser->AddObject(autoNameOne, (void*)&autoNameOne); + chooser->AddObject(autoNameDisable, (void*)&autoNameDisable); SmartDashboard::PutData("Auto Modes", chooser); shooter1.Enable(); shooter2.Enable(); @@ -231,50 +236,46 @@ public: //std::string autoSelected = SmartDashboard::GetString("Auto Selector", autoNameDefault); std::cout << "Auto selected: " << autoSelected << std::endl; - if(autoSelected == autoNameCustom){ - //Custom Auto goes here - } else { - //Default Auto goes here - auto_status = START; - } + auto_status = START; } void AutonomousPeriodic() { const float drivePower = 1; - const float driveTime = 3; //Seconds to drive forward + float driveTime = 1.7; LogCSVData(); - if(autoSelected == autoNameCustom){ - //Custom Auto goes here - } else { - //Default Auto goes here - switch (auto_status) + if (autoSelected == autoNameDisable) driveTime = 0; + else if (autoSelected == autoNameShort) driveTime = 1.5; + else if (autoSelected == autoNameOne) driveTime = 1; + else driveTime = 1.7; + + //Default Auto goes here + switch (auto_status) + { + case START: + { + auto_clock.Start(); + auto_status = DRIVING_FORWARD; + break; + } + case DRIVING_FORWARD: + { + if (auto_clock.Get() > driveTime) { - case START: - { - auto_clock.Start(); - auto_status = DRIVING_FORWARD; - break; - } - case DRIVING_FORWARD: - { - if (auto_clock.Get() > driveTime) - { - drive.TankDrive(0.0, 0.0); - auto_status = STOP; - } - else - { - drive.TankDrive(drivePower, drivePower); - } - break; - } - case STOP: - { - std::cout << "All done!\n" ; - break; - } + drive.TankDrive(0.0, 0.0); + auto_status = STOP; } + else + { + drive.TankDrive(drivePower, drivePower); + } + break; + } + case STOP: + { + std::cout << "All done!\n" ; + break; + } } } From 3d076984f506737be02cb4ca3100f52db32c5cbb Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 10 Mar 2016 08:58:55 -0500 Subject: [PATCH 34/35] Remove extra call to ArcadeDrive that snuck back in --- src/Robot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index 5b80f6a..a5a88c5 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -289,7 +289,7 @@ public: LogCSVData(); std::cout << "arm encoder position: " << arms.GetEncPosition() << std::endl; std::cout << "arm encoder velocity: " << arms.GetEncVel() << std::endl; - drive.ArcadeDrive(-driver_stick.GetY(), -driver_stick.GetX()*0.75); + if(driver_stick.GetRawButton(7)) { arcade = true; From d115ea3782fcd165789845d550350fcc4b4b3ec3 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 10 Mar 2016 09:04:45 -0500 Subject: [PATCH 35/35] Add gimble control code Untested, but did previously work --- src/Robot.cpp | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Robot.cpp b/src/Robot.cpp index a5a88c5..6da8c07 100644 --- a/src/Robot.cpp +++ b/src/Robot.cpp @@ -18,6 +18,13 @@ #define RAMP_RAISE 5 // Button 3 for Raising Ramp #define RAMP_LOWER 3 // Button 4 to lower ramp. #define UNJAM 11 +#define GIM_UP 7 +#define GIM_DOWN 9 +#define GIM_ZERO 10 +#define GIM_SHOOT 8 + +#define GIMB_DEFAULT 768 //Default position of the gimble (*1000) +#define GIMB_DELTA 2 //Amount to increment by #define ARMS_SCALE 0.75 @@ -47,6 +54,8 @@ private: Shooter shooter; Joystick driver_stick, operator_stick; Timer auto_clock; + Servo gimbs; + int gimba; // angle of the gimble as a value of from 0 to 1000 // instance variables bool pickupRunning; // don't want to spam the Talon with set messages. Toggle the pickup when a button is pressed or released. @@ -92,6 +101,8 @@ private: SmartDashboard::PutBoolean("Arms Limit F", !arms.IsFwdLimitSwitchClosed()); SmartDashboard::PutBoolean("Arms Limit R", !arms.IsRevLimitSwitchClosed()); + SmartDashboard::PutNumber("angle of camera", gimba); + if (!logA.is_open() && !logB.is_open() && !logC.is_open()) { std::fstream logNumFile; @@ -200,7 +211,9 @@ public: shooter( // initialize Shooter object. &shooter1, &shooter2, &ramp), driver_stick(0), // right stick (operator) - operator_stick(1) // left stick (driver) + operator_stick(1), // left stick (driver) + gimbs(3), + gimba(GIMB_DEFAULT) { } @@ -228,6 +241,9 @@ public: shooter_power = 0; arcade = false; + // Initialize the number so we can get it later + SmartDashboard::PutNumber("shooting angle", GIMB_DEFAULT); + } void AutonomousInit() @@ -277,6 +293,7 @@ public: break; } } + gimbs.Set(gimba/1000.0); } void TeleopInit() @@ -359,6 +376,23 @@ public: shooter.PickUp(false); unjamming = false; } + + /* + * This is for controlling the gimbal. + */ + if(operator_stick.GetRawButton(GIM_UP)) + { + gimba += GIMB_DELTA; + } + else if(operator_stick.GetRawButton(GIM_DOWN)){ + gimba -= GIMB_DELTA; + } + else if(operator_stick.GetRawButton(GIM_SHOOT)) + { + gimba = SmartDashboard::GetNumber("shooting angle", GIMB_DEFAULT); + } + gimbs.Set(gimba/1000.0); + /* * Run the Shooter only while the THUMB button is held down on the operator stick. * the 'pickupRunning' boolean is there to prevent the shooter from calling PickUp