diff --git a/.cproject b/.cproject deleted file mode 100644 index 3f3aa96..0000000 --- a/.cproject +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index bdb0cab..0000000 --- a/.gitattributes +++ /dev/null @@ -1,17 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9b22ff0..0000000 --- a/.gitignore +++ /dev/null @@ -1,48 +0,0 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -/Debug/ diff --git a/.project b/.project deleted file mode 100644 index d1e8bf8..0000000 --- a/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - Momentum - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - edu.wpi.first.wpilib.plugins.core.nature.FRCProjectNature - - diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 60e5963..d9ebeb6 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/Debug/FRCUserProgram b/Debug/FRCUserProgram index 99ceb8e..bbc9d40 100644 Binary files a/Debug/FRCUserProgram and b/Debug/FRCUserProgram differ diff --git a/Debug/src/CommandBase.o b/Debug/src/CommandBase.o deleted file mode 100644 index cd1672d..0000000 Binary files a/Debug/src/CommandBase.o and /dev/null differ diff --git a/Debug/src/Commands/ExampleCommand.o b/Debug/src/Commands/ExampleCommand.o index 7f3967e..25042da 100644 Binary files a/Debug/src/Commands/ExampleCommand.o and b/Debug/src/Commands/ExampleCommand.o differ diff --git a/Debug/src/OI.o b/Debug/src/OI.o deleted file mode 100644 index 3c7888b..0000000 Binary files a/Debug/src/OI.o and /dev/null differ diff --git a/Debug/src/Robot.o b/Debug/src/Robot.o deleted file mode 100644 index 797d0f7..0000000 Binary files a/Debug/src/Robot.o and /dev/null differ diff --git a/Notes/Talon and Solenoid Definitions.txt b/Notes/Talon and Solenoid Definitions.txt index a15fd86..d859f43 100644 --- a/Notes/Talon and Solenoid Definitions.txt +++ b/Notes/Talon and Solenoid Definitions.txt @@ -1,19 +1,19 @@ -Talon and Solenoid Definiitons: - - -Talons: -1 - Front Base Right -2 - Front Base Left -3 - Rear Base Right -4 - Rear Base Left -5 - Flywheel Right -6 - Flywheel Left -7 - Filter Right -8 - Filter Left -9 - Collector -10 - Spare - -Solenoids: -0 and 1 - Base Solenoid (shift) -2 and 3 - Collector/Ratchet Solenoid -4 and 5 - Esophagus +alon and Solenoid Definiitons: + + +Talons: +1 - Front Base Right +2 - Front Base Left +3 - Rear Base Right +4 - Rear Base Left +5 - Flywheel Right +6 - Flywheel Left +7 - Filter Right +8 - Filter Left +9 - Collector +10 - Spare + +Solenoids: +0 and 1 - Base Solenoid (shift) +2 and 3 - Collector/Ratchet Solenoid +4 and 5 - Esophagus diff --git a/build.properties b/build.properties deleted file mode 100644 index f51b8ca..0000000 --- a/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Build information -out=FRCUserProgram -src.dir=src -build.dir=build -out.exe=Debug/${out} - -# Simulation -simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world - -# Use the current C++ library by default -cpp-version=current diff --git a/build.xml b/build.xml deleted file mode 100644 index 42dd355..0000000 --- a/build.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/RobotMap.h b/src/RobotMap.h deleted file mode 100644 index 78270f3..0000000 --- a/src/RobotMap.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ROBOTMAP_H -#define ROBOTMAP_H - -/** - * The RobotMap is a mapping from the ports sensors and actuators are wired into - * to a variable name. This provides flexibility changing wiring, makes checking - * the wiring easier and significantly reduces the number of magic numbers - * floating around. - */ - -// For example to map the left and right motors, you could define the -// following variables to use with your drivetrain subsystem. -// constexpr int LEFTMOTOR = 1; -// constexpr int RIGHTMOTOR = 2; - -// If you are using multiple modules, make sure to define both the port -// number and the module. For example you with a rangefinder: -// constexpr int RANGE_FINDER_PORT = 1; -// constexpr int RANGE_FINDER_MODULE = 1; - -#endif // ROBOTMAP_H diff --git a/src/Robotmap.h b/src/Robotmap.h new file mode 100644 index 0000000..d9f728d --- /dev/null +++ b/src/Robotmap.h @@ -0,0 +1,108 @@ +/* + * Robotmap.h + * + * Created on: Feb 25, 2017 + * Author: eeuser + */ + +#ifndef SRC_ROBOTMAP_H_ +#define SRC_ROBOTMAP_H_ + +#include "Commands/Subsystem.h" +#include "WPILib.h" +#include "CANTalon.h" +#include "c:\Users\eeuser\wpilib\cpp\current\include\Ultrasonic.h" +//#include "C:\Users\eeuser\wpilib\cpp\current\include\SmartDashboard\SmartDashboard.h" + +class Robotmap { + +private: + + //Subsystem Talons and Solenoids + //Collector + CANTalon* collectorCIM; + + //Drive Base Talons and Solenoids + CANTalon* LeftRearBaseMotor; //Talon 1 in CAN Bus + CANTalon* LeftFrontBaseMotor; //Talon 2 in CAN Bus + CANTalon* RightRearBaseMotor; //Talon 3 in CAN Bus + CANTalon* RightFrontBaseMotor; //Talon 4 in CAN Bus + + //Flywheel Talons + CANTalon* flywheelRight; + CANTalon* flywheelLeft; + CANTalon* filterFront; + CANTalon* filterRear; + + //Solenoids + //Drive Base Solenoids + DoubleSolenoid* shiftSolenoid; + DoubleSolenoid* liftSolenoid; + + //Esophagus Solenoid + DoubleSolenoid* esophagusSolenoid; + + //Joysticks + Joystick* l_stick; //Logitech Joystick + Joystick* r_stick; //Logitech Joystick + Joystick* x_stick; //X-Box Joystick + + //Sensors + //NavX MXP + AHRS* ahrs; + + //Ultrasonic + Ultrasonic* BaseUltrasonic; + + PowerDistributionPanel* myPDP; + //Live Window + //LiveWindow* lw = LiveWindow::GetInstance(); + + //USB Camera + static CameraServer* GetInstance(); + + //update every 0.005 seconds/5 milliseconds. + double kUpdatePeriod = 0.005; + + const float KRamp = 0.6; + +public: + Robotmap(); + + //Talons + const int RightFrontBaseTalon = 1; + const int RightRearBaseTalon = 3; + const int LeftFrontBaseTalon = 2; + const int LeftRearBaseTalon = 4; + const int flywheelLeftTalon = 8; + const int flywheelRightTalon = 7; + const int filterFrontTalon = 5; + const int filterRearTalon = 6; + const int CollectorTalon = 9; + + //Solenoids + const int shiftSolenoidForward = 0; + const int shiftSolenoidReverse = 1; + const int liftSolenoidForward = 2; + const int liftSolenoidReverse = 3; + const int esophagusSolenoidForward = 4; + const int esophagusSolenoidReverse = 5; + + //Joysticks + const int JoystickPort1 = 1; + const int JoystickPort0 = 0; + const int JoystickPort2 = 2; + + //Ultrasonic + const int BaseUltrasonicTransmitter = 1; + const int BaseUltrasonicReciever = 1; + + //Gyro + const float ahrsPort = SPI::Port::kMXP; + + //PDP + const int PDPPort = 0; +}; + + +#endif /* SRC_ROBOTMAP_H_ */ diff --git a/src/Subsystems/Robotmap.h b/src/Subsystems/Robotmap.h new file mode 100644 index 0000000..9983d9f --- /dev/null +++ b/src/Subsystems/Robotmap.h @@ -0,0 +1,97 @@ +#ifndef SRC_SUBSYSTEMS_DRIVEBASE_H_ +#define SRC_SUBSYSTEMS_DRIVEBASE_H_ + +#include "Commands/Subsystem.h" +#include "WPILib.h" +#include "CANTalon.h" +#include "c:\Users\eeuser\wpilib\cpp\current\include\Ultrasonic.h" +#include "C:\Users\eeuser\wpilib\cpp\current\include\SmartDashboard\SmartDashboard.h" + +private: + + //Subsystem Talons and Solenoids + //Collector + CANTalon* collectorCIM; + + //Drive Base Talons and Solenoids + CANTalon* LeftRearBaseMotor; //Talon 1 in CAN Bus + CANTalon* LeftFrontBaseMotor; //Talon 2 in CAN Bus + CANTalon* RightRearBaseMotor; //Talon 3 in CAN Bus + CANTalon* RightFrontBaseMotor; //Talon 4 in CAN Bus + + //Flywheel Talons + CANTalon* flywheelRight; + CANTalon* flywheelLeft; + CANTalon* filterFront; + CANTalon* filterRear; + + //Solenoids + //Drive Base Solenoids + DoubleSolenoid* shiftSolenoid; + DoubleSolenoid* liftSolenoid; + + //Esophagus Solenoid + DoubleSolenoid* esophagusSolenoid; + + //Joysticks + Joystick* l_stick; //Logitech Joystick + Joystick* r_stick; //Logitech Joystick + Joystick* x_stick; //X-Box Joystick + + //Sensors + //NavX MXP + AHRS* ahrs; + + //Ultrasonic + Ultrasonic* BaseUltrasonic; + + PowerDistributionPanel* myPDP; + //Live Window + //LiveWindow* lw = LiveWindow::GetInstance(); + + //USB Camera + static CameraServer* GetInstance(); + + //update every 0.005 seconds/5 milliseconds. + double kUpdatePeriod = 0.005; + + const float KRamp = 0.6; + +public: + + //Talons + const int RightFrontBaseTalon = 1; + const int RightRearBaseTalon = 3; + const int LeftFrontBaseTalon = 2; + const int LeftRearBaseTalon = 4; + const int flywheelLeftTalon = 8; + const int flywheelRightTalon = 7; + const int filterFrontTalon = 5; + const int filterRearTalon = 6; + const int CollectorTalon = 9; + + //Solenoids + const int shiftSolenoidForward = 0; + const int shiftSolenoidReverse = 1; + const int liftSolenoidForward = 2; + const int liftSolenoidReverse = 3; + const int esophagusSolenoidForward = 4; + const int esophagusSolenoidReverse = 5; + + //Joysticks + const int JoystickPort1 = 1; + const int JoystickPort0 = 0; + const int JoystickPort2 = 2; + + //Ultrasonic + const int BaseUltrasonicTransmitter = 1; + const int BaseUltrasonicReciever = 1; + + //Gyro + const float ahrsPort = SPI::Port::kMXP; + + //PDP + const int PDPPort = 0; + + +#endif /* SRC_SUBSYSTEMS_BASE_H_ */