项目:UberbotsJava
文件:UBMethods.java
public static void hdrive(RobotDrive drive,int pwm_hmotor,Joystick js,boolean squared) {
// hdrive_L = js.getY() * (js.getY()) + js.getZ();
// hdrive_R = js.getY() - js.getZ();
// hdrive_H = js.getX();
// hdrive_hmotor = new Jaguar(pwm_hmotor);
// drive.setLeftRightMotorOutputs((hdrive_L > 1) ? 1 : ((hdrive_L < -1) ? -1 : hdrive_L),// (hdrive_R > 1) ? 1 : ((hdrive_R < -1) ? -1 : hdrive_R));
// hdrive_hmotor.set((hdrive_H > 1) ? 1 : ((hdrive_H < -1) ? -1 : hdrive_H));
hdrive_X = js.getX();
hdrive_X *= (squared ? hdrive_X : 1);
hdrive_Y = js.getX();
hdrive_Y *= (squared ? hdrive_Y : 1);
hdrive_Z = js.getX();
hdrive_Z *= (squared ? hdrive_Z : 1);
hdrive_hmotor = new Jaguar(pwm_hmotor);
drive.setLeftRightMotorOutputs(
(hdrive_Y + hdrive_Z > 1) ? 1 : ((hdrive_Y + hdrive_Z < -1) ? -1 : hdrive_Y + hdrive_Z),(hdrive_Y - hdrive_Z > 1) ? 1 : ((hdrive_Y - hdrive_Z < -1) ? -1 : hdrive_Y - hdrive_Z));
hdrive_hmotor.set((hdrive_X > 1) ? 1 : ((hdrive_X < -1) ? -1 : hdrive_X));
}
项目:aeronautical-facilitation
文件:RobotDrive6.java
/**
* Constructor for RobotDrive with 4 motors specified with channel numbers.
* Set up parameters for a four wheel drive system where all four motor pwm
* channels are specified in the call. This call assumes Jaguars for
* controlling the motors.
*
* @param frontLeftMotor Front left motor channel number on the default
* digital module
* @param rearLeftMotor Rear Left motor channel number on the default
* digital module
* @param frontRightMotor Front right motor channel number on the default
* digital module
* @param rearRightMotor Rear Right motor channel number on the default
* digital module
* @param middleLeftMotor third left motor PWM channel number
* @param middleRightMotor third right motor PWM channel number
*/
public RobotDrive6(final int frontLeftMotor,final int rearLeftMotor,final int frontRightMotor,final int rearRightMotor,final int middleLeftMotor,final int middleRightMotor) {
m_sensitivity = kDefaultSensitivity;
m_maxOutput = kDefaultMaxOutput;
m_rearLeftMotor = new Jaguar(rearLeftMotor);
m_rearRightMotor = new Jaguar(rearRightMotor);
m_frontLeftMotor = new Jaguar(frontLeftMotor);
m_frontRightMotor = new Jaguar(frontRightMotor);
m_middleLeftMotor = new Jaguar(middleLeftMotor);
m_middleRightMotor = new Jaguar(middleRightMotor);
for (int i = 0; i < kMaxnumberOfMotors; i++) {
m_invertedMotors[i] = 1;
}
m_allocatedSpeedControllers = true;
setupMotorSafety();
drive(0,0);
}
项目:2014-Assist-Robot-Prime
文件:DrivePart.java
public DrivePart(BotRunner runner){
super(runner);
bot = runner;
shotRange = 90;
highRange = 60;
lowRange = 30;
autoTime = new Timer();
frontRight = new Jaguar(1);
frontLeft = new Jaguar(2);
backRight = new Jaguar(3);
backLeft = new Jaguar(4);
roboDrive = new RobotDrive(frontLeft,backLeft,frontRight,backRight);
roboDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight,true);
roboDrive.setInvertedMotor(RobotDrive.MotorType.kFrontLeft,true);
}
/**
* Constructor for RobotDrive with 4 motors specified with channel numbers.
* Set up parameters for a four wheel drive system where all four motor pwm
* channels are specified in the call. This call assumes Jaguars for
* controlling the motors.
*
* @param frontLeftMotor Front left motor channel number on the default
* digital module
* @param rearLeftMotor Rear Left motor channel number on the default
* digital module
* @param frontRightMotor Front right motor channel number on the default
* digital module
* @param rearRightMotor Rear Right motor channel number on the default
* digital module
*/
public RobotDriveSteering(final int frontLeftMotor,final int rearRightMotor) {
m_sensitivity = kDefaultSensitivity;
m_maxOutput = kDefaultMaxOutput;
m_rearLeftMotor = new Jaguar(rearLeftMotor);
m_rearRightMotor = new Jaguar(rearRightMotor);
m_frontLeftMotor = new Jaguar(frontLeftMotor);
m_frontRightMotor = new Jaguar(frontRightMotor);
for (int i = 0; i < kMaxnumberOfMotors; i++) {
m_invertedMotors[i] = 1;
}
m_allocatedSpeedControllers = true;
setupMotorSafety();
drive(0,0);
}
项目:2015-frc-robot
文件:RobotOutput.java
/**
* Instantiates a new robot output.
*/
private RobotOutput() {
this.forces = ChiliFunctions.fillArrayWithZeros(this.forces);
front_left = new Talon(ChiliConstants.front_left_motor);
rear_left = new Talon(ChiliConstants.rear_left_motor);
front_right = new Talon(ChiliConstants.front_right_motor);
rear_right = new Talon(ChiliConstants.rear_right_motor);
left_lifter = new Jaguar(ChiliConstants.left_lifter_motor);
right_lifter = new Jaguar(ChiliConstants.right_lifter_motor);
//Sensor object for some cheating.
//Objecto de sensor. "Trampa" para obtener ciertos valores.
sensor = SensorInput.getInstance();
/*front_left.setSafetyEnabled(true);
rear_left.setSafetyEnabled(true);
front_right.setSafetyEnabled(true);
rear_right.setSafetyEnabled(true);
left_lifter.setSafetyEnabled(true);
right_lifter.setSafetyEnabled(true);*/
}
项目:RobotBlueTwilight2013
文件:BTMotor.java
public BTMotor(int port,boolean isCan)
{
isCANBus = isCan;
if (isCANBus)
{
//int maxTries = 0;
//while(CANMotor == null && maxTries < 10)
//{
try{
CANMotor = new CANJaguar(port);
}
catch(Exception CANTimeoutException){
Log.log("Error initialising CANJaguar");
}
//}
//if (maxTries >= 10)
//Log.log("CANJaguar(" + port + ") Failed to initialize.");
}
else
{
PWMMotor = new Jaguar(port);
}
}
项目:RobotBlueTwilight2013
文件:BTMotor.java
public void instanciate(int port,boolean isCan,boolean isVoltage)
{
isCANBus = isCan;
portNum = port;
voltage = isVoltage;
if (isCANBus) {
try{
CANMotor = new CANJaguar(port);
if (isVoltage)
{
setVoltageControlMode();
}
successJag = true;
}
catch(Exception CANTimeoutException){
System.out.println("Error initialising CANJaguar at port: " +port);
}
}
else
{
PWMMotor = new Jaguar(port);
}
}
项目:snobot-2017
文件:Snobot.java
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotinit()
{
// PWM's
mTestMotor1 = new Talon(0);
mTestMotor2 = new Jaguar(1);
mServo = new Servo(2);
// Digital IO
mDigitalOutput = new DigitalOutput(0);
mRightEncoder = new Encoder(4,5);
mLeftEncoder = new Encoder(1,2);
mUltrasonic = new Ultrasonic(7,6);
// Analog IO
mAnalogGryo = new AnalogGyro(0);
mPotentiometer = new AnalogPotentiometer(1);
// Solenoid
mSolenoid = new Solenoid(0);
// Relay
mRelay = new Relay(0);
// Joysticks
mJoystick1 = new Joystick(0);
mJoystick2 = new XBoxController(1);
// SPI
mSpiGryo = new ADXRS450_Gyro();
// Utilities
mTimer = new Timer();
mPDP = new PowerdistributionPanel();
Preferences.getInstance().putDouble("Motor One Speed",.5);
}
项目:FRC2549-2016
文件:MotorDescriptor.java
public SpeedController getController(){
if (allocated) return null;
this.allocated = true;
switch (this.speedControllerType){
case kJaguar:
return new Jaguar(this.PWMChannel);
case kTalon:
return new Talon(this.PWMChannel);
default:
return null;
}
}
项目:FRC1076-2015-Competition_Robot
文件:Manipulator.java
Manipulator() {
LiftMotor = new Jaguar(ELEVATOR_MOTOR_PORT) {
public void set(double speed) {
super.set(-speed);
}
};
encoder = new Encoder(ENCODER_CHANNEL_A,ENCODER_CHANNEL_B);
}
项目:turtleshell
文件:Robot.java
public Robot() {
stick = new Joystick(0);
try {
/* Construct Digital I/O Objects */
pwm_out_9 = new Victor( getChannelFromPin( PinType.PWM,9 ));
pwm_out_8 = new Jaguar( getChannelFromPin( PinType.PWM,8 ));
dig_in_7 = new DigitalInput( getChannelFromPin( PinType.DigitalIO,7 ));
dig_in_6 = new DigitalInput( getChannelFromPin( PinType.DigitalIO,6 ));
dig_out_5 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO,5 ));
dig_out_4 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO,4 ));
enc_3and2 = new Encoder( getChannelFromPin( PinType.DigitalIO,3 ),getChannelFromPin( PinType.DigitalIO,2 ));
enc_1and0 = new Encoder( getChannelFromPin( PinType.DigitalIO,1 ),0 ));
/* Construct Analog I/O Objects */
/* NOTE: Due to a board layout issue on the navX MXP board revision */
/* 3.3,there is noticeable crosstalk between AN IN pins 3,2 and 1. */
/* For that reason,use of pin 3 and pin 2 is NOT RECOMMENDED. */
an_in_1 = new AnalogInput( getChannelFromPin( PinType.AnalogIn,1 ));
an_trig_0 = new AnalogTrigger( getChannelFromPin( PinType.AnalogIn,0 ));
an_trig_0_counter = new Counter( an_trig_0 );
an_out_1 = new Analogoutput( getChannelFromPin( PinType.Analogout,1 ));
an_out_0 = new Analogoutput( getChannelFromPin( PinType.Analogout,0 ));
/* Configure I/O Objects */
pwm_out_9.setSafetyEnabled(false); /* disable Motor Safety for Demo */
pwm_out_8.setSafetyEnabled(false); /* disable Motor Safety for Demo */
/* Configure Analog Trigger */
an_trig_0.setAveraged(true);
an_trig_0.setLimitsVoltage(MIN_AN_TRIGGER_VOLTAGE,MAX_AN_TRIGGER_VOLTAGE);
} catch (RuntimeException ex ) {
DriverStation.reportError( "Error instantiating MXP pin on navX MXP: "
+ ex.getMessage(),true);
}
}
项目:2015RobotCode
文件:Robot.java
public Robot() {
myRobot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR,RobotMap.REAR_LEFT_MOTOR,RobotMap.FRONT_RIGHT_MOTOR,RobotMap.REAR_RIGHT_MOTOR);
myRobot.setExpiration(0.1);
stick = new Joystick(RobotMap.JOYSTICK_PORT1);
compressor = new Compressor();
solenoid = new DoubleSolenoid(RobotMap.soLENOID_PCM_PORT1,RobotMap.soLENOID_PCM_PORT2);
jaguar = new Jaguar(RobotMap.LIFT_MOTOR);
}
public void init(Environment env) {
inputMethod = env.getinput();
speedController = new MultiMotor(new SpeedController[]{new Jaguar(RobotMap.SHOOTER_MOTOR_1),new Jaguar(RobotMap.SHOOTER_MOTOR_2)});
speedController.set(0);
solenoid = new Solenoid(RobotMap.SHOOTER_SOLENOID);
}
项目:2014RobotCode
文件:Drive.java
public Drive() {
super();
jFL = new Jaguar(RobotMap.MECANUM_FRONT_LEFT);
jBL = new Jaguar(RobotMap.MECANUM_BACK_LEFT);
jFR = new Jaguar(RobotMap.MECANUM_FRONT_RIGHT);
jBR = new Jaguar(RobotMap.MECANUM_BACK_RIGHT);
drive = new RobotDrive(jFL,jBL,jFR,jBR);
}
/**
* Constructor for RobotDrive with 2 motors specified with channel numbers.
* Set up parameters for a two wheel drive system where the left and right
* motor pwm channels are specified in the call. This call assumes Jaguars
* for controlling the motors.
*
* @param leftMotorChannel The PWM channel number on the default digital
* module that drives the left motor.
* @param rightMotorChannel The PWM channel number on the default digital
* module that drives the right motor.
*/
public RobotDriveSteering(final int leftMotorChannel,final int rightMotorChannel) {
m_sensitivity = kDefaultSensitivity;
m_maxOutput = kDefaultMaxOutput;
m_frontLeftMotor = null;
m_rearLeftMotor = new Jaguar(leftMotorChannel);
m_frontRightMotor = null;
m_rearRightMotor = new Jaguar(rightMotorChannel);
for (int i = 0; i < kMaxnumberOfMotors; i++) {
m_invertedMotors[i] = 1;
}
m_allocatedSpeedControllers = true;
setupMotorSafety();
drive(0,0);
}
项目:Testbot14-15
文件:BTJaguar.java
public BTJaguar(int port,BTDebugger debug)
{
jag = new Jaguar(port);
val = 0;
motorG = new BTStatGroup("MotorGroup "+port);
debugSpeed = motorG.newNumStat("DEBUG: BTJaguar: Port: "+port+" ",Constants.DEBUGMODE);
}
项目:TitanRobot2014
文件:SpeedControllerFactory.java
public TitanSpeedController create(int pChannel,Class<?> pClass,Switch pForwardLimitSwitch,Switch pReverseLimitSwitch,boolean pInvertDirection) {
TitanSpeedController controller;
if (pClass.equals(Talon.class)) {
controller = new TitanSpeedController(new Talon(pChannel),pForwardLimitSwitch,pReverseLimitSwitch,pInvertDirection);
}
else if (pClass.equals(Victor.class)) {
controller = new TitanSpeedController(new Victor(pChannel),pInvertDirection);
}
else {
controller = new TitanSpeedController(new Jaguar(pChannel),pInvertDirection);
}
return controller;
}
项目:TitanRobot2014
文件:SpeedControllerFactory.java
public TitanSpeedController create(int pChannel,Class pClass,pInvertDirection);
}
return controller;
}
项目:FRC-2015-Robot-Java
文件:RobotHardwareWoodbot.java
public void initialize()
{
rearLeftMotor = new Jaguar(0);
frontLeftMotor = new Jaguar(1);
liftMotor = new Jaguar(2);
liftMotor2 = new Jaguar(3);
liftEncoder = new Encoder(6,7,false,EncodingType.k4X);
drivetrain = new RobotDrive(rearLeftMotor,frontLeftMotor);
drivetrain.setInvertedMotor(MotorType.kFrontLeft,true);
drivetrain.setInvertedMotor(MotorType.kFrontRight,true);
halsensor = new DigitalInput(0);
horizontalCamera = new Servo(8);
verticalCamera = new Servo(9);
solenoid = new DoubleSolenoid(0,1);
gyro = new Gyro(1);
accelerometer = new BuiltInAccelerometer();
liftEncoder.reset();
RobotHardwareWoodbot hardware = (RobotHardwareWoodbot)Robot.bot;
LiveWindow.addActuator("Drive Train","Front Left Motor",(Jaguar)hardware.frontLeftMotor);
LiveWindow.addActuator("Drive Train","Back Left Motor",(Jaguar)hardware.rearLeftMotor);
//LiveWindow.addActuator("Drive Train","Front Right Motor",(Jaguar)hardware.frontRightMotor);
//LiveWindow.addActuator("Drive Train","Back Right Motor",(Jaguar)hardware.rearRightMotor);
}
项目:2014-Robot
文件:DriveTrain.java
public DriveTrain() {
// Set up the motors ...
this.leftMotor = new Jaguar(Robot.KickMotors.LEFT_PORT);
this.rightMotor = new Jaguar(Robot.KickMotors.RIGHT_PORT);
// And the drive controller ...
drive = new RobotDrive(leftMotor,rightMotor);
drive.setInvertedMotor(Robot.KickMotors.LEFT_POSITION,Robot.KickMotors.LEFT_REVERSED);
drive.setInvertedMotor(Robot.KickMotors.RIGHT_POSITION,Robot.KickMotors.RIGHT_REVERSED);
drive.setSafetyEnabled(false);
setMaxDriveSpeed(Robot.KickMotors.INITIAL_MAX_KICK_SPEED);
}
项目:MecanumTest
文件:Drive.java
public Drive () {
jaguar_lf = new Jaguar(JAGUAR_LF);
jaguar_rf = new Jaguar(JAGUAR_RF);
jaguar_lr = new Jaguar(JAGUAR_LR);
jaguar_rr = new Jaguar(JAGUAR_RR);
joystick = new Joystick (JOYSTICK_ID);
}
public climber(int leftM,int rightM,int leftSecondaryM,int rightSecondaryM,int leftS,int rightS,int gyro)
{
this.leftM = new Jaguar(leftM);
this.rightM = new Jaguar(rightM);
this.leftSecondaryM = new Victor(leftSecondaryM);
this.rightSecondaryM = new Victor(rightSecondaryM);
this.leftS = new Servo(leftS);
this.rightS = new Servo(rightS);
this.gyro = new Gyro(gyro);
this.gyro.setSensitivity(.007);
System.out.println("Sensitivity set");
this.gyro.reset();
Log.v(TAG,"climber subsystem instantiated.");
}
项目:ultimate-ascent
文件:DriveTrain.java
public DriveTrain(int left,int right,int gyro)
{
this.left = new Jaguar(left);
this.right = new Jaguar(right);
this.gyro = new Gyro(gyro);
Log.v(TAG,"Drive train subsystem instantiated.");
}
private climber()
{
climberController = new Jaguar(BadRobotMap.climberArticulator);
encoder = new Encoder(BadRobotMap.climberEncoderIn,BadRobotMap.climberEncoderOut,true);
encoder.start();
//controller = new EasyPID(.01,0.0,"climber Controller",encoder);
//controller.controller.enable();
//controller.setAbsolutetolerance(8);
//controller.enable();
}
项目:Zed-Java
文件:Drivetrain.java
private SpeedController createMultiplexedJaguar(int id,int idMini){
Jaguar[] jaguars = new Jaguar[2];
jaguars[0] = new Jaguar(id);
jaguars[1] = new Jaguar(idMini);
SpeedControllerMultiplexer scMultiplexer = new SpeedControllerMultiplexer(jaguars);
return scMultiplexer;
}
项目:GearsBot
文件:Elevator.java
public Elevator() {
super("Elevator",Kp,Ki,Kd);
motor = new Jaguar(RobotMap.elevatorMotor);
pot = new AnalogChannel(RobotMap.elevatorPot);
// Set default position and start PID
setSetpoint(STOW);
enable();
}
项目:2013robot
文件:MotorControl.java
void init() {
A = new Victor(RobotMap.Apin);
B = new Victor(RobotMap.Bpin);
C = new Victor(RobotMap.Cpin);
climb = new Victor(RobotMap.climbpin);
climbasst = new Jaguar(RobotMap.climbasstpin);
shootwheel = new Jaguar(RobotMap.wheelpin);
shoottilt = new Jaguar(RobotMap.tiltpin);
push = new Relay(RobotMap.pushpin);
push.setDirection(Relay.Direction.kBoth);
}
项目:2013-Ultimate-Ascent-Robot
文件:Drive.java
public Drive(UltimateAscentRobot robot){
super(robot);
leftMotor = new Jaguar(1); //PWM 1
rightMotor = new Jaguar(2); //PWM 2
drive = new RobotDrive(leftMotor,rightMotor);
//compressor = new Relay(1);
//compressor.setDirection(Relay.Direction.kForward);
}
项目:frc1675-2011
文件:MecanumDrive.java
public MecanumDrive(){
motor1 = new Jaguar(RobotMap.DSC_SLOT,RobotMap.DRIVE_MOTOR_1);
motor2 = new Jaguar(RobotMap.DSC_SLOT,RobotMap.DRIVE_MOTOR_2);
motor3 = new Jaguar(RobotMap.DSC_SLOT,RobotMap.DRIVE_MOTOR_3);
motor4 = new Jaguar(RobotMap.DSC_SLOT,RobotMap.DRIVE_MOTOR_4);
}
项目:Hyperion3360-2012
文件:Canon.java
public Canon(ReserveBallon reserve) {
mReserve = reserve;
mjControl = JoystickDevice.Getcopilot();
mjAngleDeTir = new Jaguar(PwmDevice.mCanonAngleDeTir);
mfAngleDeTir = new FiltrePasseBas(25);
mjOrientationDeTir = new Jaguar(PwmDevice.mCanonorientationDeTir);
mfOrientationDeTir = new FiltrePasseBas(25);
msTir = new Solenoid(SolenoidDevice.mCanonTir);
msTirRev = new Solenoid(SolenoidDevice.mCanonTirRev);
mdLimiteRotationGauche = new DigitalInput(DigitalDevice.mCanonLimiteRotationGauche);
mdLimiteRotationDroite = new DigitalInput(DigitalDevice.mCanonLimiteRotationDroite);
mjCanonHaut = new Jaguar(PwmDevice.mCanonMoteurHaut);
mfCanonHaut = new FiltrePasseBas(25);
macCanonHaut = new AnalogChannel(AnalogDevice.mCanonMoteurHaut);
mpidCanonHaut = new PIDController(Kp,Kd,macCanonHaut,mjCanonHaut);
mpidCanonHaut.setInputRange(0.0,4095.0);
mpidCanonHaut.setoutputRange(-1.0,1.0);
mjCanonBas = new Jaguar(PwmDevice.mCanonMoteurBas);
mfCanonBas = new FiltrePasseBas(25);
macCanonBas = new AnalogChannel(AnalogDevice.mCanonMoteurBas);
mpidCanonBas = new PIDController(Kp,macCanonBas,mjCanonBas);
mpidCanonBas.setInputRange(0.0,4095.0);
mpidCanonBas.setoutputRange(-1.0,1.0);
mRangeFinder = new RangeFinder(5);
maAngle = new ADXL345_I2C(1,ADXL345_I2C.DataFormat_Range.k8G);
maRef = new ADXL345_I2C(1,ADXL345_I2C.DataFormat_Range.k8G);
msTir.set(false);
msTirRev.set(true);
}
public SpeedControllerSubsystem(SpeedControllerSubsystemType type,final int channel) {
switch(type) {
case CAN_JAGUAR:
this._controller = new CANJaguar(channel);
break;
case CAN_TALON:
this._controller = new CANTalon(channel);
break;
case JAGUAR:
this._controller = new Jaguar(channel);
break;
case SD540:
this._controller = new SD540(channel);
break;
case SPARK:
this._controller = new Spark(channel);
break;
case TALON:
this._controller = new Talon(channel);
break;
case TALON_SRX:
this._controller = new TalonSRX(channel);
break;
case VICTOR:
this._controller = new Victor(channel);
break;
case VICTOR_SP:
this._controller = new VictorSP(channel);
break;
default:
break;
}
}
项目:2014RobotCode
文件:Grabber.java
public Grabber() {
super();
jGrab = new Jaguar(RobotMap.SPINNING_BALL_GRABBER_PORT);
jGrab.set(0.0);
}
项目:2014-Robot
文件:JaguarDriveTrain.java
protected Jaguar leftMotor() {
return (Jaguar)leftMotor;
}
项目:2014-Robot
文件:JaguarDriveTrain.java
protected Jaguar rightMotor() {
return (Jaguar)rightMotor;
}
项目:FRC-2015-Practice
文件:Shooting.java
public Shooting() {
arm = new Relay(1);
flyWheel = new Jaguar(10);
tripwire = new DigitalInput(2);
}
项目:FRC-2015-Practice
文件:Hydraulics.java
public void init() {
controller = new XBoxController(1);
motor1 = new Jaguar(6);
}
项目:rover
文件:RobotMap.java
public static void init() {
//initialize encoders
frontWheelEncoder = new Encoder(1,1,2,CounterBase.EncodingType.k2X);
frontWheelEncoder.setdistancePerpulse(WHEEL_ENCODER_disTANCE_PER_TICK);
frontWheelEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kRate); // have encoder measure rate,not distance
frontWheelEncoder.start();
LiveWindow.addSensor("Drivetrain","frontWheelEncoder",frontWheelEncoder);
leftWheelEncoder = new Encoder(1,3,4,CounterBase.EncodingType.k2X);
leftWheelEncoder.setdistancePerpulse(WHEEL_ENCODER_disTANCE_PER_TICK);
leftWheelEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kRate); // have encoder measure rate,not distance
leftWheelEncoder.start();
LiveWindow.addSensor("Drivetrain","leftWheelEncoder",leftWheelEncoder);
backWheelEncoder = new Encoder(1,5,6,CounterBase.EncodingType.k2X);
backWheelEncoder.setdistancePerpulse(WHEEL_ENCODER_disTANCE_PER_TICK);
backWheelEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kRate); // have encoder measure rate,not distance
backWheelEncoder.start();
LiveWindow.addSensor("Drivetrain","backWheelEncoder",backWheelEncoder);
rightWheelEncoder = new Encoder(1,8,CounterBase.EncodingType.k2X);
rightWheelEncoder.setdistancePerpulse(WHEEL_ENCODER_disTANCE_PER_TICK);
rightWheelEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kRate); // have encoder measure rate,not distance
rightWheelEncoder.start();
LiveWindow.addSensor("Drivetrain","rightWheelEncoder",rightWheelEncoder);
frontModuleEncoder = new Encoder(2,CounterBase.EncodingType.k2X);
frontModuleEncoder.setdistancePerpulse(MODULE_ENCODER_disTANCE_PER_TICK);
frontModuleEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kdistance); // have encoder measure rate,not distance
frontModuleEncoder.start();
LiveWindow.addSensor("Drivetrain","frontModuleEncoder",frontModuleEncoder);
leftModuleEncoder = new Encoder(2,CounterBase.EncodingType.k2X);
leftModuleEncoder.setdistancePerpulse(MODULE_ENCODER_disTANCE_PER_TICK);
leftModuleEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kdistance); // have encoder measure rate,not distance
leftModuleEncoder.start();
LiveWindow.addSensor("Drivetrain","leftModuleEncoder",leftModuleEncoder);
backModuleEncoder = new Encoder(2,CounterBase.EncodingType.k2X);
backModuleEncoder.setdistancePerpulse(MODULE_ENCODER_disTANCE_PER_TICK);
backModuleEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kdistance); // have encoder measure rate,not distance
backModuleEncoder.start();
LiveWindow.addSensor("Drivetrain","backModuleEncoder",backModuleEncoder);
rightModuleEncoder = new Encoder(2,CounterBase.EncodingType.k2X);
rightModuleEncoder.setdistancePerpulse(MODULE_ENCODER_disTANCE_PER_TICK);
rightModuleEncoder.setPIDSourceParameter(PIDSource.PIDSourceParameter.kdistance); // have encoder measure rate,not distance
rightModuleEncoder.start();
LiveWindow.addSensor("Drivetrain","rightModuleEncoder",rightModuleEncoder);
//initialize motors
frontWheelMotor = new Victor246(1,1);
LiveWindow.addActuator("Drivetrain","frontWheelMotor",(Victor) frontWheelMotor);
leftWheelMotor = new Victor246(1,2);
LiveWindow.addActuator("Drivetrain","leftWheelMotor",(Victor) leftWheelMotor);
backWheelMotor = new Victor246(1,3);
LiveWindow.addActuator("Drivetrain","backWheelMotor",(Victor) backWheelMotor);
rightWheelMotor = new Victor246(1,4);
LiveWindow.addActuator("Drivetrain","rightWheelMotor",(Victor) rightWheelMotor);
frontModuleMotor = new Jaguar246(2,"frontModuleMotor",(Jaguar) frontModuleMotor);
leftModuleMotor = new Jaguar246(2,"leftModuleMotor",(Jaguar) leftModuleMotor);
backModuleMotor = new Jaguar246(2,"backModuleMotor",(Jaguar) backModuleMotor);
rightModuleMotor = new Jaguar246(2,"rightModuleMotor",(Jaguar) rightModuleMotor);
//initialize limit switch
angleZeroingButton = new DigitalInput(1,9);
LiveWindow.addSensor("Drivetrain","encoderZeroingSwitch",angleZeroingButton);
}