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