本文整理汇总了Java中edu.wpi.first.wpilibj.templates.RobotMap类的典型用法代码示例。如果您正苦于以下问题:Java RobotMap类的具体用法?Java RobotMap怎么用?Java RobotMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RobotMap类属于edu.wpi.first.wpilibj.templates包,在下文中一共展示了RobotMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DriveTrain
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
/**
*
*/
public DriveTrain() {
super("DriveTrain");
FLeftMotor = new Victor(RobotMap.FLeftMotorPWM);
FRightMotor = new Victor(RobotMap.FRightMotorPWM);
BLeftMotor = new Victor(RobotMap.BLeftMotorPWM);
BRightMotor = new Victor(RobotMap.BRightMotorPWM);
//MLeftMotor = new Victor(RobotMap.MLeftMotorPWM);
//MRightMotor = new Victor(RobotMap.MRightMotorPWM);
drive = new RobotDrive(FLeftMotor, BLeftMotor, FRightMotor, BRightMotor);
//drive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
//drive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);
GShiftSolDown = new Solenoid(RobotMap.DriveTrainLowGearSolenoid);
GShiftSolUp = new Solenoid(RobotMap.DriveTrainHighGearSolenoid);
display = DriverStationLCD.getInstance();
}
示例2: RoboDrive
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public RoboDrive(){
try {
//creates the motors
aLeft = new CANJaguar(RobotMap.LEFT_DRIVE_MOTOR_ALPHA);
bLeft = new CANJaguar(RobotMap.LEFT_DRIVE_MOTOR_BETA);//, CANJaguar.ControlMode.kSpeed);
aRight = new CANJaguar(RobotMap.RIGHT_DRIVE_MOTOR_ALPHA);
bRight = new CANJaguar(RobotMap.RIGHT_DRIVE_MOTOR_BETA);//, CANJaguar.ControlMode.kSpeed);
//creates the drive train
roboDrive = new RobotDrive(aLeft, bLeft, aRight, bRight);
roboDrive.setSafetyEnabled(false);
} catch(CANTimeoutException ex) {
ex.printStackTrace();
}
}
示例3: Drivetrain
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public Drivetrain()
{
frontModule = new SwerveModule(RobotMap.frontWheelEncoder, RobotMap.frontModuleEncoder, RobotMap.frontWheelMotor, RobotMap.frontModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, 0, RobotMap.FRONT_BACK_LENGTH/2, "frontModule");
leftModule = new SwerveModule(RobotMap.leftWheelEncoder, RobotMap.leftModuleEncoder, RobotMap.leftWheelMotor, RobotMap.leftModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, -RobotMap.LEFT_RIGHT_WIDTH/2, 0, "leftModule");
backModule = new SwerveModule(RobotMap.backWheelEncoder, RobotMap.backModuleEncoder, RobotMap.backWheelMotor, RobotMap.backModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, 0, -RobotMap.FRONT_BACK_LENGTH/2, "backModule");
rightModule = new SwerveModule(RobotMap.rightWheelEncoder, RobotMap.rightModuleEncoder, RobotMap.rightWheelMotor, RobotMap.rightModuleMotor, RobotMap.WHEEL_TOP_ABSOLUTE_SPEED, RobotMap.LEFT_RIGHT_WIDTH/2, 0, "rightModule");
//We were having occasional errors with the creation of the nav6 object, so we make 5 attempts before allowing the error to go through and being forced to redeploy.
int count = 0;
int maxTries = 5;
while(true) {
try {
nav6 = new IMUAdvanced(new BufferingSerialPort(57600));
if(nav6 != null) break;
} catch (VisaException e) {
if (++count == maxTries)
{
e.printStackTrace();
break;
}
Timer.delay(.01);
}
}
LiveWindow.addSensor("Drivetrain", "Gyro", nav6);
}
示例4: Autonomous1
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public Autonomous1() {
System.out.println("Auton");
addParallel(new SetShooter(RobotMap.preset1), 5.0);
addSequential(new ChangeElevation(true), 5.0);
addParallel(new SetShooter(RobotMap.preset1));
addSequential(new ShooterReady());
addParallel(new SetShooter(RobotMap.preset1));
addSequential(new KickHopper());
addParallel(new SetShooter(RobotMap.preset1));
addSequential(new ShooterReady());
addParallel(new SetShooter(RobotMap.preset1));
addSequential(new KickHopper());
addParallel(new SetShooter(RobotMap.preset1));
addSequential(new ShooterReady());
addParallel(new SetShooter(RobotMap.preset1));
addSequential(new KickHopper());
addSequential(new SetShooter(0.0), 1.0);
}
示例5: target
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public boolean target() {
gyro.reset();
double leftValue = limit((getGyroAngle()-aimRotation)*-RobotMap.rotationKp);
double rightValue = limit((getGyroAngle()-aimRotation)*RobotMap.rotationKp);
if (leftValue<0) drive.tankDrive(-2.0+leftValue, 2.0+rightValue);
else drive.tankDrive(2.0+leftValue, -2.0+rightValue);
if((getGyroAngle()>=-0.5 && getGyroAngle()<=0.5)) {
double checkRotation = getImage();
if ((getGyroAngle()-checkRotation>=-0.5) && (getGyroAngle()-checkRotation<=0.5)) {
drive.drive(0.0, 0.0);
return true;
} else return false;
} else return false;
}
示例6: execute
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void execute() {
// for (int i = 0; i < 8; i++){
//
// switch(i){
//
// case 1:
//
// }
// }
RobotMap.shifter_2.set(!RobotMap.shifter.get());
RobotMap.powerTakeoff_2.set(!RobotMap.powerTakeoff.get());
RobotMap.frontPusherFirst_2.set(!RobotMap.frontPusherFirst.get());
RobotMap.frontPusherSecond_2.set(!RobotMap.frontPusherSecond.get());
RobotMap.rearPusher_2.set(!RobotMap.rearPusher.get());
RobotMap.popper_2.set(!RobotMap.popper.get());
RobotMap.popper2_2.set(!RobotMap.popper2.get());
}
示例7: execute
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void execute() {
this.determineSetpoint();
if (lastAngle != RobotMap.desiredShooterAngle) {
VerticalTurretAxis.resetGyro();
lastAngle = RobotMap.desiredShooterAngle;
}
// if (RobotMap.desiredShooterAngle != 0.0) {
//
// VerticalTurretAxis.getGyro();
// this.setSetpoint(RobotMap.desiredShooterAngle);
// //VerticalTurretAxis = RobotMap.desiredShooterAngle;
// }
//
// if (Math.abs (RobotMap.desiredShooterAngle - VerticalTurretAxis.readGyroDegress()) < 0.5) {
// RobotMap.desiredShooterAngle = 0.0;
// }
}
示例8: ShooterMotorControl
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public ShooterMotorControl() {
super("ShooterControl", Kp, Ki, Kd);
Encoder topEncoder = new Encoder(RobotMap.topEncoderChannelA, RobotMap.topEncoderChannelB);
Encoder bottomEncoder = new Encoder(RobotMap.bottomEncoderChannelA, RobotMap.bottomEncoderChannelB);
try {
shooterJagTop = new CANJaguar(RobotMap.shooterJagTopID);
shooterJagBottom = new CANJaguar(RobotMap.shooterJagBottomID);
} catch (CANTimeoutException e) {
e.printStackTrace();
}
// Use these to get going:
// setSetpoint() - Sets where the PID controller should move the system
// to
// enable() - Enables the PID controller.
enable();
}
示例9: initialize
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void initialize() {
counter++;
delayTimer = RobotMap.ShooterDelayTimer;
delayTimer.start();
display.println(DriverStationLCD.Line.kUser2, 1, "Pass command " + counter + " ");
display.updateLCD();
}
示例10: execute
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void execute() {
theDriveTrain.drive(RobotMap.AutonomousSpeed);
if (time.get() > 1.00) {
timesup = true;
}
}
示例11: initialize
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
protected void initialize() {
counter++;
delayTimer = RobotMap.ShooterDelayTimer;
delayTimer.start();
//TODO: use roller subsystem to lower the roller.
display.println(DriverStationLCD.Line.kUser2, 1, "lauch command " + counter + " ");
display.updateLCD();
}
示例12: launch
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public void launch() {
if (launcherSafetySwitch.get() == RobotMap.SafetoFire) {
launcherLeft.set(RobotMap.LaunchSolenoidValue);
launcherRight.set(RobotMap.LaunchSolenoidValue);
} else if (launcherSafetySwitch.get() != RobotMap.SafetoFire) {
launcherLeft.set(!RobotMap.LaunchSolenoidValue);
launcherRight.set(!RobotMap.LaunchSolenoidValue);
}
}
示例13: pass
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
public void pass() {
if (launcherSafetySwitch.get() == RobotMap.SafetoFire) {
launcherLeft.set(RobotMap.LaunchSolenoidValue);
launcherRight.set(!RobotMap.LaunchSolenoidValue);
} else if (launcherSafetySwitch.get() != RobotMap.SafetoFire) {
launcherLeft.set(!RobotMap.LaunchSolenoidValue);
launcherRight.set(!RobotMap.LaunchSolenoidValue);
}
}
示例14: shiftLowGear
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
/**
*
*/
public void shiftLowGear() {
GShiftSolUp.set(!RobotMap.DriveTrainLowGearSolenoidValue);
GShiftSolDown.set(RobotMap.DriveTrainLowGearSolenoidValue);
GShiftSolUp.set(false);
GShiftSolDown.set(true);
display.println(Line.kUser1, 1, "Into Low Gear ");
display.updateLCD();
}
示例15: shiftHighGear
import edu.wpi.first.wpilibj.templates.RobotMap; //导入依赖的package包/类
/**
*
*/
public void shiftHighGear() {
GShiftSolUp.set(!RobotMap.DriveTrainLowGearSolenoidValue);
GShiftSolDown.set(RobotMap.DriveTrainLowGearSolenoidValue);
GShiftSolUp.set(true);
GShiftSolDown.set(false);
display.println(Line.kUser1, 1, "Into High Gear ");
display.updateLCD();
}