本文整理汇总了Java中edu.wpi.first.wpilibj.RobotDrive.setExpiration方法的典型用法代码示例。如果您正苦于以下问题:Java RobotDrive.setExpiration方法的具体用法?Java RobotDrive.setExpiration怎么用?Java RobotDrive.setExpiration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.RobotDrive
的用法示例。
在下文中一共展示了RobotDrive.setExpiration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DriveTrainSubsystem
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public DriveTrainSubsystem()
{
lastLeft = 0.0D;
lastRight = 0.0D;
leftTalon0 = new CANTalon(RobotMap.Motor.LEFT_TALON_0);
leftTalon1 = new CANTalon(RobotMap.Motor.LEFT_TALON_1);
rightTalon0 = new CANTalon(RobotMap.Motor.RIGHT_TALON_0);
rightTalon1 = new CANTalon(RobotMap.Motor.RIGHT_TALON_1);
drive = new RobotDrive(leftTalon0, leftTalon1, rightTalon0, rightTalon1);
drive.setExpiration(0.1D);
setTalonSettings(leftTalon0);
setTalonSettings(leftTalon1);
setTalonSettings(rightTalon0);
setTalonSettings(rightTalon1);
}
示例2: Robot
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public Robot() {
myRobot = new RobotDrive(0, 1);
myRobot.setExpiration(0.1);
stick = new Joystick(0);
try {
/***********************************************************************
* navX-MXP:
* - Communication via RoboRIO MXP (SPI, I2C, TTL UART) and USB.
* - See http://navx-mxp.kauailabs.com/guidance/selecting-an-interface.
*
* navX-Micro:
* - Communication via I2C (RoboRIO MXP or Onboard) and USB.
* - See http://navx-micro.kauailabs.com/guidance/selecting-an-interface.
*
* Multiple navX-model devices on a single robot are supported.
************************************************************************/
ahrs = new AHRS(SPI.Port.kMXP);
} catch (RuntimeException ex ) {
DriverStation.reportError("Error instantiating navX MXP: " + ex.getMessage(), true);
}
}
示例3: Robot
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public Robot() {
myRobot = new RobotDrive(frontLeftChannel, rearLeftChannel,
frontRightChannel, rearRightChannel);
myRobot.setExpiration(0.1);
stick = new Joystick(0);
try {
/***********************************************************************
* navX-MXP:
* - Communication via RoboRIO MXP (SPI, I2C, TTL UART) and USB.
* - See http://navx-mxp.kauailabs.com/guidance/selecting-an-interface.
*
* navX-Micro:
* - Communication via I2C (RoboRIO MXP or Onboard) and USB.
* - See http://navx-micro.kauailabs.com/guidance/selecting-an-interface.
*
* Multiple navX-model devices on a single robot are supported.
************************************************************************/
ahrs = new AHRS(SPI.Port.kMXP);
} catch (RuntimeException ex ) {
DriverStation.reportError("Error instantiating navX MXP: " + ex.getMessage(), true);
}
}
示例4: Robot
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public Robot() {
myRobot = new RobotDrive(frontLeftChannel, rearLeftChannel,
frontRightChannel, rearRightChannel);
myRobot.setExpiration(0.1);
stick = new Joystick(0);
try {
/***********************************************************************
* navX-MXP:
* - Communication via RoboRIO MXP (SPI, I2C, TTL UART) and USB.
* - See http://navx-mxp.kauailabs.com/guidance/selecting-an-interface.
*
* navX-Micro:
* - Communication via I2C (RoboRIO MXP or Onboard) and USB.
* - See http://navx-micro.kauailabs.com/guidance/selecting-an-interface.
*
* Multiple navX-model devices on a single robot are supported.
************************************************************************/
ahrs = new AHRS(SPI.Port.kMXP);
} catch (RuntimeException ex ) {
DriverStation.reportError("Error instantiating navX MXP: " + ex.getMessage(), true);
}
}
示例5: Robot
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public Robot() {
myRobot = new RobotDrive(frontLeftChannel, rearLeftChannel,
frontRightChannel, rearRightChannel);
myRobot.setExpiration(0.1);
stick = new Joystick(0);
try {
/***********************************************************************
* navX-MXP:
* - Communication via RoboRIO MXP (SPI, I2C, TTL UART) and USB.
* - See http://navx-mxp.kauailabs.com/guidance/selecting-an-interface.
*
* navX-Micro:
* - Communication via I2C (RoboRIO MXP or Onboard) and USB.
* - See http://navx-micro.kauailabs.com/guidance/selecting-an-interface.
*
* Multiple navX-model devices on a single robot are supported.
************************************************************************/
ahrs = new AHRS(SPI.Port.kMXP);
} catch (RuntimeException ex ) {
DriverStation.reportError("Error instantiating navX MXP: " + ex.getMessage(), true);
}
}
示例6: Robot
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public Robot() { // initialize variables in constructor
stick = new Joystick(RobotMap.JOYSTICK_PORT); // set the stick to refer to joystick #0
button = new JoystickButton(stick, RobotMap.BTN_TRIGGER);
myRobot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR, RobotMap.REAR_LEFT_MOTOR,
RobotMap.FRONT_RIGHT_MOTOR, RobotMap.REAR_RIGHT_MOTOR);
myRobot.setExpiration(RobotDrive.kDefaultExpirationTime); // set expiration time for motor movement if error occurs
pdp = new PowerDistributionPanel(); // instantiate class to get PDP values
compressor = new Compressor(); // Compressor is controlled automatically by PCM
solenoid = new DoubleSolenoid(RobotMap.SOLENOID_PCM_PORT1, RobotMap.SOLENOID_PCM_PORT2); // solenoid on PCM port #0 & #1
/*camera = CameraServer.getInstance();
camera.setQuality(50);
camera.setSize(200);*/
frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0); // create the image frame for cam
session = NIVision.IMAQdxOpenCamera("cam0",
NIVision.IMAQdxCameraControlMode.CameraControlModeController); // get reference to camera
NIVision.IMAQdxConfigureGrab(session); // grab current streaming session
}
示例7: init
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public static void init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
compressor = new Compressor();
driveTrainLeftFront = new CANTalon(1);
LiveWindow.addActuator("DriveTrain", "LeftFront", driveTrainLeftFront);
driveTrainRightFront = new CANTalon(3);
LiveWindow.addActuator("DriveTrain", "RightFront", driveTrainRightFront);
driveTrainLeftRear = new CANTalon(2);
driveTrainLeftRear.changeControlMode(TalonControlMode.Follower);
driveTrainLeftRear.set(driveTrainLeftFront.getDeviceID());
LiveWindow.addActuator("DriveTrain", "LeftRear", driveTrainLeftRear);
driveTrainRightRear = new CANTalon(4);
driveTrainRightRear.changeControlMode(TalonControlMode.Follower);
driveTrainRightRear.set(driveTrainRightFront.getDeviceID());
driveTrainRightRear.reverseOutput(false);
LiveWindow.addActuator("DriveTrain", "RightRear", driveTrainRightRear);
driveTrainLeftFront.setInverted(true);
driveTrainRightFront.setInverted(true);
driveTrainLeftRear.setInverted(true);
driveTrainRightRear.setInverted(true);
driveTrainRobotDrive41 = new RobotDrive(driveTrainRightFront, driveTrainLeftFront);
driveTrainRobotDrive41.setSafetyEnabled(true);
driveTrainRobotDrive41.setExpiration(0.1);
driveTrainRobotDrive41.setSensitivity(0.5);
driveTrainRobotDrive41.setMaxOutput(1.0);
climbMotor = new CANTalon(5);
LiveWindow.addActuator("Climbing", "Motor", climbMotor);
lightsLightEnable = new Relay(0);
LiveWindow.addActuator("Lights", "LightEnable", lightsLightEnable);
gearIntakeRamp = new DoubleSolenoid(1, 0);
LiveWindow.addActuator("GearIntake", "IntakeRamp", gearIntakeRamp);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例8: init
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public static void init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
driveTrainLeftFront = new Victor(0);
LiveWindow.addActuator("DriveTrain", "LeftFront", (Victor) driveTrainLeftFront);
driveTrainLeftRear = new Victor(1);
LiveWindow.addActuator("DriveTrain", "LeftRear", (Victor) driveTrainLeftRear);
driveTrainRightFront = new Victor(2);
LiveWindow.addActuator("DriveTrain", "RightFront", (Victor) driveTrainRightFront);
driveTrainRightRear = new Victor(3);
LiveWindow.addActuator("DriveTrain", "RightRear", (Victor) driveTrainRightRear);
driveTrainRobotDrive = new RobotDrive(driveTrainLeftFront, driveTrainLeftRear,
driveTrainRightFront, driveTrainRightRear);
driveTrainRobotDrive.setSafetyEnabled(false);
driveTrainRobotDrive.setExpiration(0.1);
driveTrainRobotDrive.setSensitivity(1.0);
driveTrainRobotDrive.setMaxOutput(1.0);
shootershooterTalon = new CANTalon(0);
LiveWindow.addActuator("Shooter", "shooterTalon", shootershooterTalon);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
// set this up
gyro = new ADXRS450_Gyro();
}
示例9: init
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public static void init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
motorRelayMotorRelay1 = new Relay(0);
LiveWindow.addActuator("MotorRelay", "MotorRelay1", motorRelayMotorRelay1);
lFront = new CANTalon(1);
LiveWindow.addActuator("Wheels", "Speed Controller 1", (CANTalon) lFront);
rFront = new CANTalon(3);
LiveWindow.addActuator("Wheels", "Speed Controller 2", (CANTalon) rFront);
lRear = new CANTalon(2);
LiveWindow.addActuator("Wheels", "Speed Controller 3", (CANTalon) lRear);
rRear = new CANTalon(4);
LiveWindow.addActuator("Wheels", "Speed Controller 4", (CANTalon) rRear);
driveSystem = new RobotDrive(lFront, lRear,
rFront, rRear);
driveSystem.setSafetyEnabled(true);
driveSystem.setExpiration(0.1);
driveSystem.setSensitivity(0.5);
driveSystem.setMaxOutput(1.0);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例10: init
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public static void init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
driveTrainLeftMotor = new Talon(0);
LiveWindow.addActuator("DriveTrain", "LeftMotor", (Talon) driveTrainLeftMotor);
driveTrainRightMotor = new Talon(1);
LiveWindow.addActuator("DriveTrain", "RightMotor", (Talon) driveTrainRightMotor);
driveTrainRobotDrive = new RobotDrive(driveTrainLeftMotor, driveTrainRightMotor);
driveTrainRobotDrive.setSafetyEnabled(true);
driveTrainRobotDrive.setExpiration(0.1);
driveTrainRobotDrive.setSensitivity(0.5);
driveTrainRobotDrive.setMaxOutput(1.0);
intakeintakeMotor = new Talon(2);
LiveWindow.addActuator("Intake", "intakeMotor", (Talon) intakeintakeMotor);
pneumaticSystemCompressor = new Compressor(0);
pneumaticSystemDoubleSolenoidPusher = new DoubleSolenoid(0, 0, 1);
LiveWindow.addActuator("Pneumatic System", "DoubleSolenoidPusher", pneumaticSystemDoubleSolenoidPusher);
sensorBaseUltraSonicMaxbotix = new AnalogInput(0);
LiveWindow.addSensor("SensorBase", "UltraSonicMaxbotix", sensorBaseUltraSonicMaxbotix);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例11: robotInit
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public void robotInit() {
frontLeft = new VictorSP(0);
backLeft = new VictorSP(1);
frontRight = new VictorSP(2);
backRight = new VictorSP(3);
intakeMotor = new VictorSP(4);
compressor = new Compressor(0);
intakeSolenoid = new Solenoid(0);
driveTrain = new RobotDrive(frontLeft, backLeft, frontRight, backRight);
driveTrain.setSafetyEnabled(false);
driveTrain.setExpiration(0.1);
driveTrain.setSensitivity(0.5);
driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, false);
driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false);
driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontRight, false);
driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearRight, false);
XboxController = new Joystick(2);
rightJoystick = new Joystick(1);
leftJoystick = new Joystick(0);
}
示例12: Robot
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public Robot() {
myRobot = new RobotDrive(frontLeftChannel, rearLeftChannel,
frontRightChannel, rearRightChannel);
myRobot.setExpiration(0.1);
stick = new Joystick(0);
try {
/***********************************************************************
* navX-MXP:
* - Communication via RoboRIO MXP (SPI, I2C, TTL UART) and USB.
* - See http://navx-mxp.kauailabs.com/guidance/selecting-an-interface.
*
* navX-Micro:
* - Communication via I2C (RoboRIO MXP or Onboard) and USB.
* - See http://navx-micro.kauailabs.com/guidance/selecting-an-interface.
*
* Multiple navX-model devices on a single robot are supported.
************************************************************************/
ahrs = new AHRS(SPI.Port.kMXP);
} catch (RuntimeException ex ) {
DriverStation.reportError("Error instantiating navX MXP: " + ex.getMessage(), true);
}
turnController = new PIDController(kP, kI, kD, kF, ahrs, this);
turnController.setInputRange(-180.0f, 180.0f);
turnController.setOutputRange(-1.0, 1.0);
turnController.setAbsoluteTolerance(kToleranceDegrees);
turnController.setContinuous(true);
/* Add the PID Controller to the Test-mode dashboard, allowing manual */
/* tuning of the Turn Controller's P, I and D coefficients. */
/* Typically, only the P value needs to be modified. */
LiveWindow.addActuator("DriveSystem", "RotateController", turnController);
}
示例13: init
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
public static void init() {
leftDriveMotor = new Talon(leftDriveMotorPin);
LiveWindow.addActuator("driveTrain", "Left Motor",
(Talon) leftDriveMotor);
rightDriveMotor = new Talon(rightDriveMotorPin);
LiveWindow.addActuator("driveTrain", "Right Motor",
(Talon) rightDriveMotor);
shifterSolenoid = new DoubleSolenoid(shifterSolenoidUpPin, shifterSolenoidDownPin);
LiveWindow.addActuator("driveTrain", "Gearbox Shifter",
(DoubleSolenoid) shifterSolenoid);
winchMotor = new Talon(winchMotorPin);
LiveWindow.addActuator("chainLifter", "Elevator Motor",
(Talon) winchMotor);
robotDrive = new RobotDrive(leftDriveMotor, rightDriveMotor);
robotDrive.setSafetyEnabled(true);
robotDrive.setExpiration(0.1);
robotDrive.setSensitivity(0.5);
robotDrive.setMaxOutput(1.0);
robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false);
robotDrive.setInvertedMotor(RobotDrive.MotorType.kRearRight, false);
grabberSolenoid = new DoubleSolenoid(grabberSolenoidOpenPin, grabberSolenoidClosePin);
LiveWindow.addActuator("grabberArm", "Grabber Solenoid",
(DoubleSolenoid) grabberSolenoid);
compressor = new Compressor();
LiveWindow.addActuator("grabberArm", "compressor",
(Compressor) compressor);
}
示例14: initialize
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
@Override
public void initialize() {
m_robot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR, RobotMap.REAR_LEFT_MOTOR,
RobotMap.FRONT_RIGHT_MOTOR, RobotMap.REAR_RIGHT_MOTOR);
m_robot.setExpiration(RobotDrive.kDefaultExpirationTime); // set expiration time for motor movement if error occurs
m_robot.setSafetyEnabled(true); // enable safety so motors don't burn out
m_robot.setInvertedMotor(MotorType.kFrontRight, true);
//m_robot.setInvertedMotor(MotorType.kFrontLeft, true);
m_robot.setInvertedMotor(MotorType.kRearRight, true);
//m_robot.setInvertedMotor(MotorType.kRearLeft, true);
}
示例15: Robot
import edu.wpi.first.wpilibj.RobotDrive; //导入方法依赖的package包/类
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);
}