From c77ee7a548e26de638cbf2434a2d38fe2fdc25c8 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 11 Feb 2015 18:34:38 -0500 Subject: [PATCH] Added camera, fixed binelevator (untested) --- DentRobot.cpp | 3 +++ RobotMap.h | 8 ++++++-- Subsystems/BinElevator.cpp | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/DentRobot.cpp b/DentRobot.cpp index 4588bf6..d43ffb8 100644 --- a/DentRobot.cpp +++ b/DentRobot.cpp @@ -13,6 +13,9 @@ DentRobot::DentRobot(){ elevator=new Elevator(); binElevator=new BinElevator(); aut=new Autonomous(); + CameraServer::GetInstance()->SetQuality(50); + //the camera name (ex "cam0") can be found through the roborio web interface + CameraServer::GetInstance()->StartAutomaticCapture("cam0"); printf("Initialized"); } void DentRobot::RobotInit(){ diff --git a/RobotMap.h b/RobotMap.h index d0cc6e4..8a7a765 100644 --- a/RobotMap.h +++ b/RobotMap.h @@ -8,10 +8,14 @@ #define ELEVATOR_BOTTOM_DIO 0 #define ELEVATOR_COLELCT_TOTE_DIO 1 #define ELEVATOR_READY_TOTE_DIO 2 -#define ELEVATOR_COLELCT_CAN_DIO 3 -#define ELEVATOR_READY_CAN_DIO 4 #define ELEVATOR_TOP_DIO 5 +// BinElevator +#define BINELEVATOR_CAN 11 +#define BINELEVATOR_BOTTOM_DIO 6 +#define BINELEVATOR_COLELCT_BIN_DIO 7 +#define BINELEVATOR_TOP_DIO 8 + // Drivetrain #define DRIVE_FRONT_LEFT_CAN 2 #define DRIVE_BACK_LEFT_CAN 3 diff --git a/Subsystems/BinElevator.cpp b/Subsystems/BinElevator.cpp index 2ada4b9..1692361 100644 --- a/Subsystems/BinElevator.cpp +++ b/Subsystems/BinElevator.cpp @@ -1,12 +1,12 @@ #include "BinElevator.h" #include "../RobotMap.h" BinElevator::BinElevator(){ - motor=new CANTalon(ELEVATOR_CAN); + motor=new CANTalon(BINELEVATOR_CAN); elevatorEncoder=new Encoder(0,1,false); offset=0; height=0; - elevatorBottom=new DigitalInput(ELEVATOR_BOTTOM_DIO); - elevatorTop=new DigitalInput(ELEVATOR_TOP_DIO); + elevatorBottom=new DigitalInput(BINELEVATOR_BOTTOM_DIO); + elevatorTop=new DigitalInput(BINELEVATOR_TOP_DIO); //SetAbsoluteTolerance(0.004); } void BinElevator::InitDefaultCommand(){