From 20a1ce968b76f05d5e6fd1109b87aa9b5b290482 Mon Sep 17 00:00:00 2001 From: Carl Colglazier Date: Tue, 17 Mar 2015 21:06:50 -0400 Subject: [PATCH] Fixes #2. Rename 'bins' to 'containers'. --- Commands/Autonomous/Autonomous.cpp | 24 ++++++++-------- Commands/BinElevator/BinCloseArms.cpp | 20 ------------- Commands/BinElevator/BinLower.cpp | 26 ----------------- Commands/BinElevator/BinOpenArms.cpp | 20 ------------- Commands/BinElevator/BinRaise.cpp | 26 ----------------- .../ContainerElevator/ContainerCloseArms.cpp | 20 +++++++++++++ .../ContainerCloseArms.h} | 14 +++++----- Commands/ContainerElevator/ContainerLower.cpp | 26 +++++++++++++++++ .../ContainerLower.h} | 16 +++++------ .../ContainerElevator/ContainerOpenArms.cpp | 20 +++++++++++++ .../ContainerOpenArms.h} | 16 +++++------ Commands/ContainerElevator/ContainerRaise.cpp | 26 +++++++++++++++++ .../ContainerRaise.h} | 16 +++++------ DentRobot.cpp | 10 +++---- DentRobot.h | 6 ++-- OI.cpp | 26 ++++++++--------- OI.h | 4 +-- README.md | 28 +++++++++---------- RobotMap.h | 18 ++++++------ Subsystems/BinElevator.cpp | 28 ------------------- Subsystems/ContainerElevator.cpp | 28 +++++++++++++++++++ .../{BinElevator.h => ContainerElevator.h} | 28 +++++++++---------- Subsystems/Elevator.h | 2 +- Subsystems/Pneumatics.cpp | 4 +-- Subsystems/Pneumatics.h | 2 +- mainpage.dox | 13 ++++----- 26 files changed, 233 insertions(+), 234 deletions(-) delete mode 100644 Commands/BinElevator/BinCloseArms.cpp delete mode 100644 Commands/BinElevator/BinLower.cpp delete mode 100644 Commands/BinElevator/BinOpenArms.cpp delete mode 100644 Commands/BinElevator/BinRaise.cpp create mode 100644 Commands/ContainerElevator/ContainerCloseArms.cpp rename Commands/{BinElevator/BinCloseArms.h => ContainerElevator/ContainerCloseArms.h} (65%) create mode 100644 Commands/ContainerElevator/ContainerLower.cpp rename Commands/{BinElevator/BinLower.h => ContainerElevator/ContainerLower.h} (60%) create mode 100644 Commands/ContainerElevator/ContainerOpenArms.cpp rename Commands/{BinElevator/BinOpenArms.h => ContainerElevator/ContainerOpenArms.h} (66%) create mode 100644 Commands/ContainerElevator/ContainerRaise.cpp rename Commands/{BinElevator/BinRaise.h => ContainerElevator/ContainerRaise.h} (60%) delete mode 100644 Subsystems/BinElevator.cpp create mode 100644 Subsystems/ContainerElevator.cpp rename Subsystems/{BinElevator.h => ContainerElevator.h} (52%) diff --git a/Commands/Autonomous/Autonomous.cpp b/Commands/Autonomous/Autonomous.cpp index 5a147c2..6f5281a 100644 --- a/Commands/Autonomous/Autonomous.cpp +++ b/Commands/Autonomous/Autonomous.cpp @@ -3,8 +3,8 @@ #include "../../DentRobot.h" #include "../Elevator/Raise.h" #include "../Elevator/Lower.h" -#include "../BinElevator/BinRaise.h" -#include "../BinElevator/BinLower.h" +#include "../ContainerElevator/ContainerRaise.h" +#include "../ContainerElevator/ContainerLower.h" #include "AutoDrive.h" #include "Turn.h" #include "../Collector/RollIn.h" @@ -25,21 +25,21 @@ Autonomous::Autonomous(int seq){ AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); break; case 2: - // Lower BinElevator, collect bin, turn, drive to AutoZone (TM) - AddSequential(new BinLower(0.5)); - AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Bin Distance"), 0, 0.75)); - AddSequential(new BinRaise(1.0)); + // Lower ContainerElevator, collect container, turn, drive to AutoZone (TM) + AddSequential(new ContainerLower(0.5)); + AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Container Distance"), 0, 0.75)); + AddSequential(new ContainerRaise(1.0)); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, -0.75)); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); break; case 3: - // Collect a tote with BinElevator, turn, drive to Auto Zone (TM) + // Collect a tote with ContainerElevator, turn, drive to Auto Zone (TM) Wait(SmartDashboard::GetNumber("Auto Wait Time")); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); - AddSequential(new BinRaise(1.2)); + AddSequential(new ContainerRaise(1.2)); AddSequential(new AutoDrive(SmartDashboard::GetNumber("Auto Zone Distance"), 0.0, -0.75)); - AddSequential(new BinLower(1.0)); + AddSequential(new ContainerLower(1.0)); AddSequential(new Turn(SmartDashboard::GetNumber("TurnAmount"))); break; case 4: @@ -66,15 +66,15 @@ Autonomous::Autonomous(int seq){ AddSequential(new ReleaseTote()); break; case 5: - // Same as auto 4, but navigate around bins + // Same as auto 4, but navigate around containers //TODO: Implement this break; case 6: - // Collect 1 bin and 1 tote + // Collect 1 container and 1 tote //TODO: Implement this break; case 7: - // Same as auto 4 with (Three|Two) totes checked, collect bin, drive to Auto Zone (TM), release totes + // Same as auto 4 with (Three|Two) totes checked, collect container, drive to Auto Zone (TM), release totes //TODO: Implement this break; default: diff --git a/Commands/BinElevator/BinCloseArms.cpp b/Commands/BinElevator/BinCloseArms.cpp deleted file mode 100644 index 45cd81b..0000000 --- a/Commands/BinElevator/BinCloseArms.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "BinCloseArms.h" -#include "../../DentRobot.h" -#include "../../OI.h" -BinCloseArms::BinCloseArms(double timeout): Command("BinCloseArms"){ - SetTimeout(timeout); -} -void BinCloseArms::Initialize(){ -} -void BinCloseArms::Execute(){ - DentRobot::pneumatics->SetOpen(false); -} -bool BinCloseArms::IsFinished(){ - return true; -} -void BinCloseArms::End(){ -} -void BinCloseArms::Interrupted(){ - End(); -} -// vim: ts=2:sw=2:et diff --git a/Commands/BinElevator/BinLower.cpp b/Commands/BinElevator/BinLower.cpp deleted file mode 100644 index e8373bd..0000000 --- a/Commands/BinElevator/BinLower.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "BinLower.h" -#include "../../DentRobot.h" -#include "../../OI.h" -BinLower::BinLower(float timeout): Command("BinLower"){ - SetTimeout(timeout); -} -void BinLower::Initialize(){ -} -void BinLower::Execute(){ - DentRobot::binElevator->Run(-1.0); -} -bool BinLower::IsFinished(){ - if(/*!DentRobot::binElevator->GetElevatorBottom()||*/IsTimedOut()){ - printf("Robot stoped BinLowering. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorBottom()); - return true; - }else{ - return false; - } -} -void BinLower::End(){ - DentRobot::binElevator->Run(0.0f); -} -void BinLower::Interrupted(){ - End(); -} -// vim: ts=2:sw=2:et diff --git a/Commands/BinElevator/BinOpenArms.cpp b/Commands/BinElevator/BinOpenArms.cpp deleted file mode 100644 index 91f9bb1..0000000 --- a/Commands/BinElevator/BinOpenArms.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "BinOpenArms.h" -#include "../../DentRobot.h" -#include "../../OI.h" -BinOpenArms::BinOpenArms(double timeout): Command("BinOpenArms"){ - SetTimeout(timeout); -} -void BinOpenArms::Initialize(){ -} -void BinOpenArms::Execute(){ - DentRobot::pneumatics->SetOpen(true); -} -bool BinOpenArms::IsFinished(){ - return true; -} -void BinOpenArms::End(){ -} -void BinOpenArms::Interrupted(){ - End(); -} -// vim: ts=2:sw=2:et diff --git a/Commands/BinElevator/BinRaise.cpp b/Commands/BinElevator/BinRaise.cpp deleted file mode 100644 index 0f89c78..0000000 --- a/Commands/BinElevator/BinRaise.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "BinRaise.h" -#include "../../DentRobot.h" -#include "../../OI.h" -BinRaise::BinRaise(double timeout): Command("BinRaise"){ - SetTimeout(timeout); -} -void BinRaise::Initialize(){ -} -void BinRaise::Execute(){ - DentRobot::binElevator->Run(1.0); -} -bool BinRaise::IsFinished(){ - if(/*!DentRobot::binElevator->GetElevatorTop()||*/IsTimedOut()){ - printf("Robot stoped raising. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorTop()); - return true; - }else{ - return false; - } -} -void BinRaise::End(){ - DentRobot::binElevator->Run(0.0f); -} -void BinRaise::Interrupted(){ - End(); -} -// vim: ts=2:sw=2:et diff --git a/Commands/ContainerElevator/ContainerCloseArms.cpp b/Commands/ContainerElevator/ContainerCloseArms.cpp new file mode 100644 index 0000000..1a7fb7e --- /dev/null +++ b/Commands/ContainerElevator/ContainerCloseArms.cpp @@ -0,0 +1,20 @@ +#include "ContainerCloseArms.h" +#include "../../DentRobot.h" +#include "../../OI.h" +ContainerCloseArms::ContainerCloseArms(double timeout): Command("ContainerCloseArms"){ + SetTimeout(timeout); +} +void ContainerCloseArms::Initialize(){ +} +void ContainerCloseArms::Execute(){ + DentRobot::pneumatics->SetOpen(false); +} +bool ContainerCloseArms::IsFinished(){ + return true; +} +void ContainerCloseArms::End(){ +} +void ContainerCloseArms::Interrupted(){ + End(); +} +// vim: ts=2:sw=2:et diff --git a/Commands/BinElevator/BinCloseArms.h b/Commands/ContainerElevator/ContainerCloseArms.h similarity index 65% rename from Commands/BinElevator/BinCloseArms.h rename to Commands/ContainerElevator/ContainerCloseArms.h index c00cdde..684de51 100644 --- a/Commands/BinElevator/BinCloseArms.h +++ b/Commands/ContainerElevator/ContainerCloseArms.h @@ -1,22 +1,22 @@ -#ifndef BINCLOSEARMS_H -#define BINCLOSEARMS_H +#ifndef CONTAINER_CLOSEARMS_H +#define CONTAINER_CLOSEARMS_H #include "Commands/Command.h" #include "WPILib.h" /** - * @brief Closes BinElevatorArms (NOT USED) + * @brief Closes ContainerElevatorArms (NOT USED) * - * Sets the solenoid to close the arms of the BinElevator + * Sets the solenoid to close the arms of the ContainerElevator */ -class BinCloseArms: public Command{ +class ContainerCloseArms: public Command{ public: /** - * @brief Constructs BinCloseArms + * @brief Constructs ContainerCloseArms * * @param timeout The timeout */ - BinCloseArms(double timeout = 0.5); + ContainerCloseArms(double timeout = 0.5); /** * @brief Initializes the class */ diff --git a/Commands/ContainerElevator/ContainerLower.cpp b/Commands/ContainerElevator/ContainerLower.cpp new file mode 100644 index 0000000..437200e --- /dev/null +++ b/Commands/ContainerElevator/ContainerLower.cpp @@ -0,0 +1,26 @@ +#include "ContainerLower.h" +#include "../../DentRobot.h" +#include "../../OI.h" +ContainerLower::ContainerLower(float timeout): Command("ContainerLower"){ + SetTimeout(timeout); +} +void ContainerLower::Initialize(){ +} +void ContainerLower::Execute(){ + DentRobot::containerElevator->Run(-1.0); +} +bool ContainerLower::IsFinished(){ + if(/*!DentRobot::containerElevator->GetElevatorBottom()||*/IsTimedOut()){ + printf("Robot stoped ContainerLowering. Sensor based? %d\n", !DentRobot::containerElevator->GetElevatorBottom()); + return true; + }else{ + return false; + } +} +void ContainerLower::End(){ + DentRobot::containerElevator->Run(0.0f); +} +void ContainerLower::Interrupted(){ + End(); +} +// vim: ts=2:sw=2:et diff --git a/Commands/BinElevator/BinLower.h b/Commands/ContainerElevator/ContainerLower.h similarity index 60% rename from Commands/BinElevator/BinLower.h rename to Commands/ContainerElevator/ContainerLower.h index f9a6068..6f1cd12 100644 --- a/Commands/BinElevator/BinLower.h +++ b/Commands/ContainerElevator/ContainerLower.h @@ -1,27 +1,27 @@ -#ifndef BINLOWER_H -#define BINLOWER_H +#ifndef CONTAINER_LOWER_H +#define CONTAINER_LOWER_H #include "Commands/Command.h" #include "WPILib.h" /** - * @brief Lowers the bin elevator until a timeout is reached + * @brief Lowers the container elevator until a timeout is reached */ -class BinLower: public Command{ +class ContainerLower: public Command{ private: public: /** - * @brief Constructs BinLower + * @brief Constructs ContainerLower * * @param timeout The timeout */ - BinLower(float timeout); + ContainerLower(float timeout); /** * @brief Initializes the class */ void Initialize(); /** - * @brief Lowers the bin elevator at -1.0 power + * @brief Lowers the container elevator at -1.0 power */ void Execute(); /** @@ -31,7 +31,7 @@ class BinLower: public Command{ */ bool IsFinished(); /** - * @brief Sets the bin elevator to stop + * @brief Sets the container elevator to stop */ void End(); /** diff --git a/Commands/ContainerElevator/ContainerOpenArms.cpp b/Commands/ContainerElevator/ContainerOpenArms.cpp new file mode 100644 index 0000000..208754e --- /dev/null +++ b/Commands/ContainerElevator/ContainerOpenArms.cpp @@ -0,0 +1,20 @@ +#include "ContainerOpenArms.h" +#include "../../DentRobot.h" +#include "../../OI.h" +ContainerOpenArms::ContainerOpenArms(double timeout): Command("ContainerOpenArms"){ + SetTimeout(timeout); +} +void ContainerOpenArms::Initialize(){ +} +void ContainerOpenArms::Execute(){ + DentRobot::pneumatics->SetOpen(true); +} +bool ContainerOpenArms::IsFinished(){ + return true; +} +void ContainerOpenArms::End(){ +} +void ContainerOpenArms::Interrupted(){ + End(); +} +// vim: ts=2:sw=2:et diff --git a/Commands/BinElevator/BinOpenArms.h b/Commands/ContainerElevator/ContainerOpenArms.h similarity index 66% rename from Commands/BinElevator/BinOpenArms.h rename to Commands/ContainerElevator/ContainerOpenArms.h index 22e5d49..366f32e 100644 --- a/Commands/BinElevator/BinOpenArms.h +++ b/Commands/ContainerElevator/ContainerOpenArms.h @@ -1,24 +1,24 @@ -#ifndef BINOPENARMS_H -#define BINOPENARMS_H +#ifndef CONTAINER_OPENARMS_H +#define CONTAINER_OPENARMS_H #include "Commands/Command.h" #include "WPILib.h" /** - * @brief Opens bin arms (unused) + * @brief Opens container arms (unused) */ -class BinOpenArms: public Command{ +class ContainerOpenArms: public Command{ public: /** - * @brief Constructs BinOpenArms + * @brief Constructs ContainerOpenArms * * @param timeout The timeout */ - BinOpenArms(double timeout); + ContainerOpenArms(double timeout); /** - * @brief Constructs BinOpenArms + * @brief Constructs ContainerOpenArms */ - BinOpenArms(); + ContainerOpenArms(); /** * @brief Initializes the class */ diff --git a/Commands/ContainerElevator/ContainerRaise.cpp b/Commands/ContainerElevator/ContainerRaise.cpp new file mode 100644 index 0000000..cfbf64c --- /dev/null +++ b/Commands/ContainerElevator/ContainerRaise.cpp @@ -0,0 +1,26 @@ +#include "ContainerRaise.h" +#include "../../DentRobot.h" +#include "../../OI.h" +ContainerRaise::ContainerRaise(double timeout): Command("ContainerRaise"){ + SetTimeout(timeout); +} +void ContainerRaise::Initialize(){ +} +void ContainerRaise::Execute(){ + DentRobot::containerElevator->Run(1.0); +} +bool ContainerRaise::IsFinished(){ + if(/*!DentRobot::containerElevator->GetElevatorTop()||*/IsTimedOut()){ + printf("Robot stoped raising. Sensor based? %d\n", !DentRobot::containerElevator->GetElevatorTop()); + return true; + }else{ + return false; + } +} +void ContainerRaise::End(){ + DentRobot::containerElevator->Run(0.0f); +} +void ContainerRaise::Interrupted(){ + End(); +} +// vim: ts=2:sw=2:et diff --git a/Commands/BinElevator/BinRaise.h b/Commands/ContainerElevator/ContainerRaise.h similarity index 60% rename from Commands/BinElevator/BinRaise.h rename to Commands/ContainerElevator/ContainerRaise.h index 7e31f85..8e44b5a 100644 --- a/Commands/BinElevator/BinRaise.h +++ b/Commands/ContainerElevator/ContainerRaise.h @@ -1,27 +1,27 @@ -#ifndef BINRAISE_H -#define BINRAISE_H +#ifndef CONTAINER_RAISE_H +#define CONTAINER_RAISE_H #include "Commands/Command.h" #include "WPILib.h" /** - * @brief Raises the bin elevator until a timeout is reached + * @brief Raises the container elevator until a timeout is reached */ -class BinRaise: public Command{ +class ContainerRaise: public Command{ private: public: /** - * @brief Constructs BinRaise + * @brief Constructs ContainerRaise * * @param timeout Timeout in seconds */ - BinRaise(double timeout); + ContainerRaise(double timeout); /** * @brief Initializes the class */ void Initialize(); /** - * @brief Raises the bin elevator at 1.0 power + * @brief Raises the container elevator at 1.0 power */ void Execute(); /** @@ -31,7 +31,7 @@ class BinRaise: public Command{ */ bool IsFinished(); /** - * @brief Sets the bin elevator to stop + * @brief Sets the container elevator to stop */ void End(); /** diff --git a/DentRobot.cpp b/DentRobot.cpp index bb790e8..ed95960 100644 --- a/DentRobot.cpp +++ b/DentRobot.cpp @@ -6,7 +6,7 @@ OI* DentRobot::oi=NULL; Collector* DentRobot::collector=NULL; Drivetrain* DentRobot::drivetrain=NULL; Elevator* DentRobot::elevator=NULL; -BinElevator* DentRobot::binElevator=NULL; +ContainerElevator* DentRobot::containerElevator=NULL; CommandGroup* DentRobot::aut=NULL; Pneumatics* DentRobot::pneumatics=NULL; DentRobot::DentRobot(){ @@ -14,7 +14,7 @@ DentRobot::DentRobot(){ collector=new Collector(); drivetrain=new Drivetrain(); elevator=new Elevator(); - binElevator=new BinElevator(); + containerElevator=new ContainerElevator(); pneumatics=new Pneumatics(); //CameraServer::GetInstance()->SetQuality(25); //CameraServer::GetInstance()->StartAutomaticCapture("cam0"); @@ -33,11 +33,11 @@ void DentRobot::RobotInit(){ SmartDashboard::PutNumber("Auto Zone Distance", 2.1); // Distance (in time) to auto tote (used in sequence 3) SmartDashboard::PutNumber("Auto Tote Distance", 0.5); - SmartDashboard::PutNumber("Auto Bin Distance", 0.25); + SmartDashboard::PutNumber("Auto Container Distance", 0.25); SmartDashboard::PutNumber("TurnAmount", 1.8); // Elevators - SmartDashboard::PutBoolean("Bin Elevator Bottom", false); - SmartDashboard::PutBoolean("Bin Elevator Top", false); + SmartDashboard::PutBoolean("Container Elevator Bottom", false); + SmartDashboard::PutBoolean("Container Elevator Top", false); SmartDashboard::PutBoolean("Elevator Bottom", false); SmartDashboard::PutBoolean("Elevator Top", false); //Drive speed diff --git a/DentRobot.h b/DentRobot.h index 94bd52c..ebb7248 100644 --- a/DentRobot.h +++ b/DentRobot.h @@ -3,7 +3,7 @@ #include "WPILib.h" #include "OI.h" #include "Subsystems/Elevator.h" -#include "Subsystems/BinElevator.h" +#include "Subsystems/ContainerElevator.h" #include "Subsystems/Drivetrain.h" #include "Subsystems/Collector.h" #include "Subsystems/Pneumatics.h" @@ -41,9 +41,9 @@ class DentRobot: public IterativeRobot{ */ static Elevator* elevator; /** - * @brief The back one-motor Elevator for lifting totes or bins + * @brief The back one-motor Elevator for lifting totes or containers */ - static BinElevator* binElevator; + static ContainerElevator* containerElevator; /** * @brief The Pneumatics system (unused) */ diff --git a/OI.cpp b/OI.cpp index 41b5973..caa3461 100644 --- a/OI.cpp +++ b/OI.cpp @@ -3,10 +3,10 @@ #include "Commands/Elevator/Raise.h" #include "Commands/Collector/RollIn.h" #include "Commands/Collector/RollOut.h" -#include "Commands/BinElevator/BinLower.h" -#include "Commands/BinElevator/BinRaise.h" -#include "Commands/BinElevator/BinCloseArms.h" -#include "Commands/BinElevator/BinOpenArms.h" +#include "Commands/ContainerElevator/ContainerLower.h" +#include "Commands/ContainerElevator/ContainerRaise.h" +#include "Commands/ContainerElevator/ContainerCloseArms.h" +#include "Commands/ContainerElevator/ContainerOpenArms.h" #include "Commands/Autonomous/CollectTote.h" #include "Commands/Autonomous/ReleaseTote.h" #include "Commands/Test/CheckRobot.h" @@ -28,19 +28,19 @@ OI::OI(){ right4->CancelWhenPressed(raise); right6->WhenPressed(raise); right6->CancelWhenPressed(lower); - // BinElevator + // ContainerElevator JoystickButton *right3=new JoystickButton(rightStick, 3); JoystickButton *right5=new JoystickButton(rightStick, 5); //JoystickButton *right7=new JoystickButton(rightStick, 7); //JoystickButton *right8=new JoystickButton(rightStick, 8); - //right7->WhenPressed(new BinOpenArms()); - //right8->WhenPressed(new BinCloseArms()); - binRaise=new BinRaise(3.0); - binLower=new BinLower(2.0); - right3->WhileHeld(binLower); - right3->CancelWhenPressed(binRaise); - right5->WhileHeld(binRaise); - right5->CancelWhenPressed(binLower); + //right7->WhenPressed(new ContainerOpenArms()); + //right8->WhenPressed(new ContainerCloseArms()); + containerRaise=new ContainerRaise(3.0); + containerLower=new ContainerLower(2.0); + right3->WhileHeld(containerLower); + right3->CancelWhenPressed(containerRaise); + right5->WhileHeld(containerRaise); + right5->CancelWhenPressed(containerLower); // Cancel JoystickButton *right12=new JoystickButton(rightStick, 12); right12->CancelWhenPressed(raise); diff --git a/OI.h b/OI.h index 13fb16a..b9f6777 100644 --- a/OI.h +++ b/OI.h @@ -17,8 +17,8 @@ class OI{ OI(); Command *raise, //!< Raise command *lower, //!< Lower command - *binLower, //!< BinLower command - *binRaise; //!< BinRaise command + *containerLower, //!< ContainerLower command + *containerRaise; //!< ContainerRaise command /** * @brief Returns the right joystick * diff --git a/README.md b/README.md index 99f5d22..8738cf9 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ + [Mecanum drivetrain](Subsystems/Drivetrain.cpp) + [Collector](Subsystems/Collector.cpp) to collect totes in main elevator + [Internal elevator](Subsystems/Elevator.cpp) for totes -+ [External elevator](Subsystems/BinElevator.cpp) for bins or totes -+ [Pneumatics](Subsystems/Pneumatics.cpp) for opening/closing bin elevator arms (unused) ++ [External elevator](Subsystems/ContainerElevator.cpp) for containers or totes ++ [Pneumatics](Subsystems/Pneumatics.cpp) for opening/closing container elevator arms (unused) #### Sensors + [Ultrasonic](Subsystems/Collector.cpp#L9) to check if a tote is in the robot (unused) @@ -40,12 +40,12 @@ + Button 7 - Check robot #### Right Joystick (USB 1) -+ Button 3 - Lowers bin elevator ++ Button 3 - Lowers container elevator + Button 4 - Lowers main elevator -+ Button 5 - Raises bin elevator ++ Button 5 - Raises container elevator + Button 6 - Raises main elevator -+ Button 7 - Opens bin arms (unused) -+ Button 8 - Closes bin arms (unused) ++ Button 7 - Opens container arms (unused) ++ Button 8 - Closes container arms (unused) + Button 12 - Cancel raising and lowering for both elevators ### Dashboard @@ -56,10 +56,10 @@ + Three totes - Collect a third tote if using Auto Sequence 4 or 5 (default: false) + Auto Zone Distance - Amount of time in seconds to drive to the auto zone (default: 2.1) + Auto Tote Distance - Amount of time in seconds to drive to a second or third tote if using Auto Sequence 4, 5, or 7 (default: 0.5) -+ Auto Bin Distance - Amount of time in seconds to drive to a bin if using Auto Sequence 6 or 7 (default: 0.5) ++ Auto Container Distance - Amount of time in seconds to drive to a container if using Auto Sequence 6 or 7 (default: 0.5) + TurnAmount - Amount of time in seconds to turn the robot (default: 1.8) -+ Bin Elevator Bottom - Status of the bottom bin elevator sensor (unused) -+ Bin Elevator Top - Status of the top bin elevator sensor (unused) ++ Container Elevator Bottom - Status of the bottom container elevator sensor (unused) ++ Container Elevator Top - Status of the top container elevator sensor (unused) + Elevator Bottom - Status of the bottom elevator sensor + Elevator Top - Status of the top elevator sensor + DriveSpeedReductionThresh - Maximum y value of the joystick when driving @@ -67,9 +67,9 @@ #### Autonomous 1. Drive to auto zone, turn -2. Lower BinElevator, collect bin, turn, drive to AutoZone, turn -3. Raise BinElevator, turn, drive to AutoZone, turn +2. Lower ContainerElevator, collect container, turn, drive to AutoZone, turn +3. Raise ContainerElevator, turn, drive to AutoZone, turn 4. Collect 1, 2, or 3 totes, turn, drive to AutoZone, turn -5. Same as auto 4, but navigate around bins (not implemented) -6. Collect 1 bin then 1 tote (not implemented) -7. Collect 3 totes, collect bin, drive to AutoZone (not implemented) +5. Same as auto 4, but navigate around containers (not implemented) +6. Collect 1 container then 1 tote (not implemented) +7. Collect 3 totes, collect container, drive to AutoZone (not implemented) diff --git a/RobotMap.h b/RobotMap.h index 73986d6..d3be822 100644 --- a/RobotMap.h +++ b/RobotMap.h @@ -13,15 +13,15 @@ #define ELEVATOR_ENCODERA 4 #define ELEVATOR_ENCODERB 9 -// BinElevator -#define BINELEVATOR_CAN 10 -#define BINELEVATOR_BOTTOM_DIO 6 -#define BINELEVATOR_COLELCT_BIN_DIO 7 -#define BINELEVATOR_TOP_DIO 12 -#define BINELEVATOR_ENCODERA 10 -#define BINELEVATOR_ENCODERB 11 -#define BINELEVATOR_SOLDENOID_ONE 6 -#define BINELEVATOR_SOLDENOID_TWO 7 +// ContainerElevator +#define CONTAINER_ELEVATOR_CAN 10 +#define CONTAINER_ELEVATOR_BOTTOM_DIO 6 +#define CONTAINER_ELEVATOR_COLELCT_CONTAINER__DIO 7 +#define CONTAINER_ELEVATOR_TOP_DIO 12 +#define CONTAINER_ELEVATOR_ENCODERA 10 +#define CONTAINER_ELEVATOR_ENCODERB 11 +#define CONTAINER_ELEVATOR_SOLDENOID_ONE 6 +#define CONTAINER_ELEVATOR_SOLDENOID_TWO 7 // Drivetrain #define DRIVE_FRONT_LEFT_CAN 8 diff --git a/Subsystems/BinElevator.cpp b/Subsystems/BinElevator.cpp deleted file mode 100644 index ffc79ee..0000000 --- a/Subsystems/BinElevator.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "BinElevator.h" -#include "../RobotMap.h" -BinElevator::BinElevator(){ - motor=new CANTalon(BINELEVATOR_CAN); - elevatorEncoder=new Encoder(BINELEVATOR_ENCODERA, BINELEVATOR_ENCODERB, false); - elevatorBottom=new DigitalInput(BINELEVATOR_BOTTOM_DIO); - elevatorTop=new DigitalInput(BINELEVATOR_TOP_DIO); -} -void BinElevator::InitDefaultCommand(){ -} -void BinElevator::Run(double power){ - motor->Set(power); -} -void BinElevator::ResetEncoder(){ - elevatorEncoder->Reset(); -} -double BinElevator::GetHeight(){ - return elevatorEncoder->Get(); -} -bool BinElevator::GetElevatorBottom(){ - SmartDashboard::PutBoolean("Bin Elevator Bottom", elevatorBottom->Get()); - return elevatorBottom->Get(); -} -bool BinElevator::GetElevatorTop(){ - SmartDashboard::PutBoolean("Bin Elevator Top", elevatorTop->Get()); - return elevatorTop->Get(); -} -// vim: ts=2:sw=2:et diff --git a/Subsystems/ContainerElevator.cpp b/Subsystems/ContainerElevator.cpp new file mode 100644 index 0000000..1994b61 --- /dev/null +++ b/Subsystems/ContainerElevator.cpp @@ -0,0 +1,28 @@ +#include "ContainerElevator.h" +#include "../RobotMap.h" +ContainerElevator::ContainerElevator(){ + motor=new CANTalon(CONTAINER_ELEVATOR_CAN); + elevatorEncoder=new Encoder(CONTAINER_ELEVATOR_ENCODERA, CONTAINER_ELEVATOR_ENCODERB, false); + elevatorBottom=new DigitalInput(CONTAINER_ELEVATOR_BOTTOM_DIO); + elevatorTop=new DigitalInput(CONTAINER_ELEVATOR_TOP_DIO); +} +void ContainerElevator::InitDefaultCommand(){ +} +void ContainerElevator::Run(double power){ + motor->Set(power); +} +void ContainerElevator::ResetEncoder(){ + elevatorEncoder->Reset(); +} +double ContainerElevator::GetHeight(){ + return elevatorEncoder->Get(); +} +bool ContainerElevator::GetElevatorBottom(){ + SmartDashboard::PutBoolean("Container Elevator Bottom", elevatorBottom->Get()); + return elevatorBottom->Get(); +} +bool ContainerElevator::GetElevatorTop(){ + SmartDashboard::PutBoolean("Container Elevator Top", elevatorTop->Get()); + return elevatorTop->Get(); +} +// vim: ts=2:sw=2:et diff --git a/Subsystems/BinElevator.h b/Subsystems/ContainerElevator.h similarity index 52% rename from Subsystems/BinElevator.h rename to Subsystems/ContainerElevator.h index 5e6f27f..743f145 100644 --- a/Subsystems/BinElevator.h +++ b/Subsystems/ContainerElevator.h @@ -1,30 +1,30 @@ -#ifndef BINELEVATOR_H -#define BINELEVATOR_H +#ifndef CONTAINER_ELEVATOR_H +#define CONTAINER_ELEVATOR_H #include "WPILib.h" #include "Commands/PIDSubsystem.h" /** - * @brief Controls the bin elevator + * @brief Controls the container elevator */ -class BinElevator{ +class ContainerElevator{ private: - CANTalon *motor; //