From 05d755f87bede64a1b7997df389ac7b5caf53db5 Mon Sep 17 00:00:00 2001 From: Adam Long Date: Sat, 28 Feb 2015 07:22:43 +0000 Subject: [PATCH] added half speed and increased collector speed --- Commands/Collector/RollIn.cpp | 2 +- DentRobot.cpp | 2 ++ Subsystems/Drivetrain.cpp | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Commands/Collector/RollIn.cpp b/Commands/Collector/RollIn.cpp index 1388c69..4d3e7c3 100644 --- a/Commands/Collector/RollIn.cpp +++ b/Commands/Collector/RollIn.cpp @@ -11,7 +11,7 @@ void RollIn::Execute(){ if(cvt>=1.0){ DentRobot::collector->MoveRollers(1.0); }else{ - DentRobot::collector->MoveRollers(cvt); + DentRobot::collector->MoveRollers(cvt*1.5); } } bool RollIn::IsFinished(){ diff --git a/DentRobot.cpp b/DentRobot.cpp index e7d15bc..7f2174a 100644 --- a/DentRobot.cpp +++ b/DentRobot.cpp @@ -42,6 +42,8 @@ void DentRobot::RobotInit(){ SmartDashboard::PutBoolean("Bin Elevator Top", false); SmartDashboard::PutBoolean("Elevator Bottom", false); SmartDashboard::PutBoolean("Elevator Top", false); + //Drive speed + SmartDashboard::PutNumber("DriveSpeedReductionThresh",2); } void DentRobot::DisabledPeriodic(){ Scheduler::GetInstance()->Run(); diff --git a/Subsystems/Drivetrain.cpp b/Subsystems/Drivetrain.cpp index 0e4970f..c8528ee 100644 --- a/Subsystems/Drivetrain.cpp +++ b/Subsystems/Drivetrain.cpp @@ -15,6 +15,9 @@ void Drivetrain::DriveMecanum(float x, float y, float z, float sensitivity, floa double correctY = (sensitivity*(pow(y,3))+(1-sensitivity)*y); double correctX = -(sensitivity*(pow(x,3))+(1-sensitivity)*x); double correctZ = -z *.5; + if (DentRobot::oi->GetRightStick()->GetRawButton(9)){ + correctY /= SmartDashboard::GetNumber("DriveSpeedReductionThresh"); + } rightFront->Set((-correctX + correctY - correctZ)); leftFront->Set((correctX + correctY + correctZ)*-1); rightRear->Set((correctX + correctY - correctZ));