From e26b7e825c50a072468a97af96b8ea1a163a00d0 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 11 Feb 2015 20:49:56 -0500 Subject: [PATCH] Updated binElevator --- Subsystems/BinElevator.cpp | 8 +------- Subsystems/BinElevator.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Subsystems/BinElevator.cpp b/Subsystems/BinElevator.cpp index 119bfb8..daff79b 100644 --- a/Subsystems/BinElevator.cpp +++ b/Subsystems/BinElevator.cpp @@ -3,25 +3,19 @@ BinElevator::BinElevator(){ motor=new CANTalon(BINELEVATOR_CAN); elevatorEncoder=new Encoder(BINELEVATOR_ENCODERA,BINELEVATOR_ENCODERB,false); - offset=0; - height=0; elevatorBottom=new DigitalInput(BINELEVATOR_BOTTOM_DIO); elevatorTop=new DigitalInput(BINELEVATOR_TOP_DIO); - //SetAbsoluteTolerance(0.004); } void BinElevator::InitDefaultCommand(){ } void BinElevator::Run(double power){ motor->Set(power); } -void BinElevator::SetOffset(double ht){ - offset=ht; -} void BinElevator::ResetEncoder(){ elevatorEncoder->Reset(); } double BinElevator::GetHeight(){ - return elevatorEncoder->Get()+offset; + return elevatorEncoder->Get(); } bool BinElevator::GetElevatorBottom(){ return elevatorBottom->Get(); diff --git a/Subsystems/BinElevator.h b/Subsystems/BinElevator.h index 5e9e72d..8814152 100644 --- a/Subsystems/BinElevator.h +++ b/Subsystems/BinElevator.h @@ -8,13 +8,11 @@ class BinElevator{ CANTalon *motor; Encoder *elevatorEncoder; static constexpr double kP_real=4, kI_real=.0f, kP_simulation=18, kI_simulation=.2; - double offset, height; DigitalInput *elevatorBottom, *elevatorTop; public: BinElevator(); void InitDefaultCommand(); void Run(double); - void SetOffset(double); void ResetEncoder(); double GetHeight(); bool GetElevatorTop();