mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Changed CAN Talons to Victors
This commit is contained in:
parent
d9aee4a6f1
commit
9d46c0da74
@ -12,16 +12,16 @@ void CheckDrive::Initialize(){
|
||||
}
|
||||
void CheckDrive::Execute(){
|
||||
switch(motor){
|
||||
case DRIVE_FRONT_LEFT_CAN:
|
||||
case DRIVE_FRONT_LEFT:
|
||||
DentRobot::drivetrain->TestMotor(DentRobot::drivetrain->FRONTLEFT, 1);
|
||||
break;
|
||||
case DRIVE_FRONT_RIGHT_CAN:
|
||||
case DRIVE_FRONT_RIGHT:
|
||||
DentRobot::drivetrain->TestMotor(DentRobot::drivetrain->FRONTRIGHT, 1);
|
||||
break;
|
||||
case DRIVE_BACK_LEFT_CAN:
|
||||
case DRIVE_BACK_LEFT:
|
||||
DentRobot::drivetrain->TestMotor(DentRobot::drivetrain->BACKLEFT, 1);
|
||||
break;
|
||||
case DRIVE_BACK_RIGHT_CAN:
|
||||
case DRIVE_BACK_RIGHT:
|
||||
DentRobot::drivetrain->TestMotor(DentRobot::drivetrain->BACKRIGHT, 1);
|
||||
break;
|
||||
default:
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "CheckRobot.h"
|
||||
#include "CheckDrive.h"
|
||||
CheckRobot::CheckRobot(){
|
||||
AddSequential(new CheckDrive(DRIVE_FRONT_LEFT_CAN));
|
||||
AddSequential(new CheckDrive(DRIVE_FRONT_RIGHT_CAN));
|
||||
AddSequential(new CheckDrive(DRIVE_BACK_LEFT_CAN));
|
||||
AddSequential(new CheckDrive(DRIVE_BACK_RIGHT_CAN));
|
||||
AddSequential(new CheckDrive(DRIVE_FRONT_LEFT));
|
||||
AddSequential(new CheckDrive(DRIVE_FRONT_RIGHT));
|
||||
AddSequential(new CheckDrive(DRIVE_BACK_LEFT));
|
||||
AddSequential(new CheckDrive(DRIVE_BACK_RIGHT));
|
||||
}
|
||||
// vim: ts=2:sw=2:et
|
||||
|
20
RobotMap.h
20
RobotMap.h
@ -6,7 +6,7 @@
|
||||
#define CODE_VERSION 1.0
|
||||
|
||||
// Elevator
|
||||
#define ELEVATOR_CAN 1
|
||||
#define ELEVATOR 1
|
||||
#define ELEVATOR_BOTTOM_DIO 9
|
||||
#define ELEVATOR_MIDDLE_DIO 8
|
||||
#define ELEVATOR_TOP_DIO 7
|
||||
@ -14,7 +14,7 @@
|
||||
#define ELEVATOR_ENCODERB 9
|
||||
|
||||
// BinElevator
|
||||
#define BINELEVATOR_CAN 10
|
||||
#define BINELEVATOR 0
|
||||
#define BINELEVATOR_BOTTOM_DIO 6
|
||||
#define BINELEVATOR_COLELCT_BIN_DIO 7
|
||||
#define BINELEVATOR_TOP_DIO 12
|
||||
@ -24,16 +24,16 @@
|
||||
#define BINELEVATOR_SOLDENOID_TWO 7
|
||||
|
||||
// Drivetrain
|
||||
#define DRIVE_FRONT_LEFT_CAN 8
|
||||
#define DRIVE_BACK_LEFT_CAN 3
|
||||
#define DRIVE_FRONT_RIGHT_CAN 4
|
||||
#define DRIVE_BACK_RIGHT_CAN 5
|
||||
#define DRIVE_FRONT_LEFT 8
|
||||
#define DRIVE_BACK_LEFT 3
|
||||
#define DRIVE_FRONT_RIGHT 4
|
||||
#define DRIVE_BACK_RIGHT 5
|
||||
|
||||
// Collector
|
||||
#define COLLECTOR_RAMP_CAN 7
|
||||
#define COLLECTOR_LEFT_CAN 2
|
||||
#define COLLECTOR_BOTTOM_CAN 11
|
||||
#define COLLECTOR_RIGHT_CAN 9
|
||||
#define COLLECTOR_RAMP 7
|
||||
#define COLLECTOR_LEFT 2
|
||||
#define COLLECTOR_BOTTOM 11
|
||||
#define COLLECTOR_RIGHT 9
|
||||
#define COLLECTOR_SONAR_ANALOG 3
|
||||
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "BinElevator.h"
|
||||
#include "../RobotMap.h"
|
||||
BinElevator::BinElevator(){
|
||||
motor=new CANTalon(BINELEVATOR_CAN);
|
||||
motor=new Victor(BINELEVATOR);
|
||||
elevatorEncoder=new Encoder(BINELEVATOR_ENCODERA, BINELEVATOR_ENCODERB, false);
|
||||
elevatorBottom=new DigitalInput(BINELEVATOR_BOTTOM_DIO);
|
||||
elevatorTop=new DigitalInput(BINELEVATOR_TOP_DIO);
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
class BinElevator{
|
||||
private:
|
||||
CANTalon *motor; //<! The bin elevator motor
|
||||
Victor *motor; //<! The bin elevator motor
|
||||
Encoder *elevatorEncoder; //<! The bin elevator encoder (unused)
|
||||
DigitalInput *elevatorBottom, //<! The bottom bin elevator sensor (unused)
|
||||
*elevatorTop; //<! The top bin elevator sensor (unuesd)
|
||||
|
@ -2,10 +2,10 @@
|
||||
#include "../RobotMap.h"
|
||||
|
||||
Collector::Collector(): Subsystem("Collector"){
|
||||
collectorMotorLeft=new CANTalon(COLLECTOR_LEFT_CAN);
|
||||
collectorMotorBottom=new CANTalon(COLLECTOR_BOTTOM_CAN);
|
||||
collectorMotorRamp=new CANTalon(COLLECTOR_RAMP_CAN);
|
||||
collectorMotorRight=new CANTalon(COLLECTOR_RIGHT_CAN);
|
||||
collectorMotorLeft=new Victor(COLLECTOR_LEFT);
|
||||
collectorMotorBottom=new Victor(COLLECTOR_BOTTOM);
|
||||
collectorMotorRamp=new Victor(COLLECTOR_RAMP);
|
||||
collectorMotorRight=new Victor(COLLECTOR_RIGHT);
|
||||
sonarAnalog=new AnalogInput(COLLECTOR_SONAR_ANALOG);
|
||||
}
|
||||
void Collector::InitDefaultCommand(){
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
class Collector: public Subsystem{
|
||||
private:
|
||||
CANTalon *collectorMotorLeft, //<! Left collector motor
|
||||
Victor *collectorMotorLeft, //<! Left collector motor
|
||||
*collectorMotorBottom, //<! Bottom collctor motor
|
||||
*collectorMotorRamp, //<! Ramp collctor motor
|
||||
*collectorMotorRight; //<! Right collector motor
|
||||
|
@ -3,10 +3,10 @@
|
||||
#include "../Commands/Drivetrain/Drive.h"
|
||||
|
||||
Drivetrain::Drivetrain(): Subsystem("Drivetrain"){
|
||||
rightFront = new CANTalon(DRIVE_FRONT_RIGHT_CAN);
|
||||
leftFront = new CANTalon(DRIVE_FRONT_LEFT_CAN);
|
||||
rightRear = new CANTalon(DRIVE_BACK_RIGHT_CAN);
|
||||
leftRear = new CANTalon(DRIVE_BACK_LEFT_CAN);
|
||||
rightFront = new Victor(DRIVE_FRONT_RIGHT);
|
||||
leftFront = new Victor(DRIVE_FRONT_LEFT);
|
||||
rightRear = new Victor(DRIVE_BACK_RIGHT);
|
||||
leftRear = new Victor(DRIVE_BACK_LEFT);
|
||||
}
|
||||
void Drivetrain::InitDefaultCommand(){
|
||||
SetDefaultCommand(new Drive());
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
class Drivetrain: public Subsystem{
|
||||
private:
|
||||
CANTalon *rightFront, //<! Front right motor
|
||||
Victor *rightFront, //<! Front right motor
|
||||
*leftFront, //<! Front left motor
|
||||
*rightRear, //<! Back right motor
|
||||
*leftRear; //<! Back left motor
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "Elevator.h"
|
||||
#include "../RobotMap.h"
|
||||
Elevator::Elevator(){
|
||||
motor=new CANTalon(ELEVATOR_CAN);
|
||||
motor=new Victor(ELEVATOR);
|
||||
elevatorEncoder=new Encoder(ELEVATOR_ENCODERA, ELEVATOR_ENCODERB, false);
|
||||
elevatorBottom=new DigitalInput(ELEVATOR_BOTTOM_DIO);
|
||||
elevatorMiddle=new DigitalInput(ELEVATOR_MIDDLE_DIO);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
class Elevator{
|
||||
private:
|
||||
CANTalon *motor; //<! The elevator motor
|
||||
Victor *motor; //<! The elevator motor
|
||||
Encoder *elevatorEncoder; //<! The elevator encoder (unused)
|
||||
DigitalInput *elevatorBottom, //<! The bottom elevator sensor
|
||||
*elevatorMiddle, //<! The middle elevator sensor
|
||||
|
Loading…
Reference in New Issue
Block a user