本文整理汇总了Java中com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter类的典型用法代码示例。如果您正苦于以下问题:Java AutonomousBooleanConfigFileParameter类的具体用法?Java AutonomousBooleanConfigFileParameter怎么用?Java AutonomousBooleanConfigFileParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AutonomousBooleanConfigFileParameter类属于com.wildstangs.autonomous.parameters包,在下文中一共展示了AutonomousBooleanConfigFileParameter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defineConfigValues
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
private void defineConfigValues() {
StartDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".StartDrive", 60.5);
AngleTurn = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".AngleTurn", 90);
SecondDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".SecondDrive", 60.5);
ThirdDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".ThirdDrive", 60.5);
FourthDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".FourthDrive", 60.5);
FifthDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".FifthDrive", 60.5);
FirstEnterWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstEnterWheelSetPoint", 2800);
FirstExitWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstExitWheelSetPoint", 3550);
FirstShooterAngle = new AutonomousBooleanStartPositionConfigFileParameter("FirstShooterAngle", false);
SecondEnterWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.EnterWheelSetPoint", 2100);
SecondExitWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.ExitWheelSetPoint", 2750);
SecondShooterAngle = new AutonomousBooleanConfigFileParameter("FrontPyramid.ShooterAngle", true);
ThirdFrisbeeDelay = new AutonomousIntegerConfigFileParameter("ThirdFrisbeeDelay", 700);
AccumulatorDelay = new AutonomousIntegerConfigFileParameter("LowerAccumulatorDelay", 300);
startPreset = new WsShooter.Preset(FirstEnterWheelSetPoint.getValue(),
FirstExitWheelSetPoint.getValue(),
FirstShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
secondShooterPreset = new WsShooter.Preset(SecondEnterWheelSetPoint.getValue(),
SecondExitWheelSetPoint.getValue(),
SecondShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
}
开发者ID:wildstang111,项目名称:2013_drivebase_proto,代码行数:25,代码来源:WsAutonomousProgramShootSevenManualFinger.java
示例2: defineConfigValues
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
private void defineConfigValues() {
TwistAngle = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".TwistAngle", 30);
FirstDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".FirstDrive", 60.5);
SecondDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".SecondDrive", 60.5);
ThirdDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".ThirdDrive", 60.5);
FirstEnterWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstEnterWheelSetPoint", 2800);
FirstExitWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstExitWheelSetPoint", 3550);
FirstShooterAngle = new AutonomousBooleanStartPositionConfigFileParameter("FirstShooterAngle", false);
SecondEnterWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.EnterWheelSetPoint", 2100);
SecondExitWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.ExitWheelSetPoint", 2750);
SecondShooterAngle = new AutonomousBooleanConfigFileParameter("FrontPyramid.ShooterAngle", true);
ThirdFrisbeeDelay = new AutonomousIntegerConfigFileParameter("ThirdFrisbeeDelay", 700);
FunnelatorLoadDelay = new AutonomousIntegerConfigFileParameter("FunnelatorLoadDelay", 300);
firstShooterPreset = new WsShooter.Preset(FirstEnterWheelSetPoint.getValue(),
FirstExitWheelSetPoint.getValue(),
FirstShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
secondShooterPreset = new WsShooter.Preset(SecondEnterWheelSetPoint.getValue(),
SecondExitWheelSetPoint.getValue(),
SecondShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
}
示例3: defineConfigValues
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
private void defineConfigValues() {
FirstDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".FirstDrive", 60.5);
SecondDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".SecondDrive", 60.5);
ThirdDrive = new DoubleConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".ThirdDrive", 60.5);
FirstEnterWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstEnterWheelSetPoint", 2800);
FirstExitWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstExitWheelSetPoint", 3550);
FirstShooterAngle = new AutonomousBooleanStartPositionConfigFileParameter("FirstShooterAngle", false);
SecondEnterWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.EnterWheelSetPoint", 2100);
SecondExitWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.ExitWheelSetPoint", 2750);
SecondShooterAngle = new AutonomousBooleanConfigFileParameter("FrontPyramid.ShooterAngle", true);
ThirdFrisbeeDelay = new AutonomousIntegerConfigFileParameter("ThirdFrisbeeDelay", 700);
FunnelatorLoadDelay = new AutonomousIntegerConfigFileParameter("FunnelatorLoadDelay", 300);
firstShooterPreset = new WsShooter.Preset(FirstEnterWheelSetPoint.getValue(),
FirstExitWheelSetPoint.getValue(),
FirstShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
secondShooterPreset = new WsShooter.Preset(SecondEnterWheelSetPoint.getValue(),
SecondExitWheelSetPoint.getValue(),
SecondShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
}
示例4: defineConfigValues
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
private void defineConfigValues() {
firstDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.FirstDrive", 27);
secondDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.SecondDrive", 109);
thirdDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.ThirdDrive", -58);
firstEnterWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstEnterWheelSetPoint", 2800);
firstExitWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstExitWheelSetPoint", 3550);
firstShooterAngle = new AutonomousBooleanStartPositionConfigFileParameter("FirstShooterAngle", false);
secondEnterWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.EnterWheelSetPoint", 2100);
secondExitWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.ExitWheelSetPoint", 2750);
secondShooterAngle = new AutonomousBooleanConfigFileParameter("FrontPyramid.ShooterAngle", true);
thirdFrisbeeDelay = new AutonomousIntegerConfigFileParameter("ThirdFrisbeeDelay", 700);
accumulatorDelay = new AutonomousIntegerConfigFileParameter("LowerAccumulatorDelay", 300);
startPreset = new WsShooter.Preset(firstEnterWheelSetPoint.getValue(),
firstExitWheelSetPoint.getValue(),
firstShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
secondShooterPreset = new WsShooter.Preset(secondEnterWheelSetPoint.getValue(),
secondExitWheelSetPoint.getValue(),
secondShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
}
示例5: defineConfigValues
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
private void defineConfigValues() {
firstDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.FirstDrive", 27);
secondDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.SecondDrive", 109);
thirdDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.ThirdDrive", -58);
thirdDriveHeading = new AutonomousDoubleConfigFileParameter("ShootSeven.ThirdDriveHeading", 0.22);
firstEnterWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstEnterWheelSetPoint", 2800);
firstExitWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstExitWheelSetPoint", 3550);
firstShooterAngle = new AutonomousBooleanStartPositionConfigFileParameter("FirstShooterAngle", false);
secondEnterWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.EnterWheelSetPoint", 2100);
secondExitWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.ExitWheelSetPoint", 2750);
secondShooterAngle = new AutonomousBooleanConfigFileParameter("FrontPyramid.ShooterAngle", true);
accumulatorDelay = new AutonomousIntegerConfigFileParameter("LowerAccumulatorDelay", 300);
startPreset = new WsShooter.Preset(firstEnterWheelSetPoint.getValue(),
firstExitWheelSetPoint.getValue(),
firstShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
secondShooterPreset = new WsShooter.Preset(secondEnterWheelSetPoint.getValue(),
secondExitWheelSetPoint.getValue(),
secondShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
}
开发者ID:wildstang111,项目名称:2013_drivebase_proto,代码行数:23,代码来源:WsAutonomousProgramShootSevenActiveAccumulator.java
示例6: defineConfigValues
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
private void defineConfigValues() {
firstDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.FirstDrive", 27);
secondDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.SecondDrive", 109);
thirdDrive = new AutonomousDoubleConfigFileParameter("ShootSeven.ThirdDrive", -58);
firstEnterWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstEnterWheelSetPoint", 2800);
firstExitWheelSetPoint = new AutonomousIntegerStartPositionConfigFileParameter("FirstExitWheelSetPoint", 3550);
firstShooterAngle = new AutonomousBooleanStartPositionConfigFileParameter("FirstShooterAngle", false);
secondEnterWheelSetPoint = new IntegerConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".SecondEnterWheelSetPoint", 2200);
secondExitWheelSetPoint = new IntegerConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".SecondExitWheelSetPoint", 2850);
secondShooterAngle = new BooleanConfigFileParameter(this.getClass().getName(), WsAutonomousManager.getInstance().getStartPosition().toConfigString() + ".SecondShooterAngle", true);
thirdEnterWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.EnterWheelSetPoint", 2100);
thirdExitWheelSetPoint = new AutonomousIntegerConfigFileParameter("FrontPyramid.ExitWheelSetPoint", 2750);
thirdShooterAngle = new AutonomousBooleanConfigFileParameter("FrontPyramid.ShooterAngle", true);
thirdFrisbeeDelay = new AutonomousIntegerConfigFileParameter("ThirdFrisbeeDelay", 700);
accumulatorDelay = new AutonomousIntegerConfigFileParameter("LowerAccumulatorDelay", 300);
startPreset = new WsShooter.Preset(firstEnterWheelSetPoint.getValue(),
firstExitWheelSetPoint.getValue(),
firstShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
secondShooterPreset = new WsShooter.Preset(secondEnterWheelSetPoint.getValue(),
secondExitWheelSetPoint.getValue(),
secondShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
thirdShooterPreset = new WsShooter.Preset(thirdEnterWheelSetPoint.getValue(),
thirdExitWheelSetPoint.getValue(),
thirdShooterAngle.getValue()
? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
}
开发者ID:wildstang111,项目名称:2013_drivebase_proto,代码行数:31,代码来源:WsAutonomousProgramShootSevenDriveAfterOne.java
示例7: WsDriveBase
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
public WsDriveBase(String name) {
super(name);
WHEEL_DIAMETER_config = new DoubleConfigFileParameter(this.getClass().getName(), "wheel_diameter", 6);
TICKS_PER_ROTATION_config = new DoubleConfigFileParameter(this.getClass().getName(), "ticks_per_rotation", 360.0);
THROTTLE_LOW_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "throttle_low_gear_accel_factor", 0.250);
HEADING_LOW_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "heading_low_gear_accel_factor", 0.500);
THROTTLE_HIGH_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "throttle_high_gear_accel_factor", 0.125);
HEADING_HIGH_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "heading_high_gear_accel_factor", 0.250);
MAX_HIGH_GEAR_PERCENT_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_high_gear_percent", 0.80);
ENCODER_GEAR_RATIO_config = new DoubleConfigFileParameter(this.getClass().getName(), "encoder_gear_ratio", 7.5);
DEADBAND_config = new DoubleConfigFileParameter(this.getClass().getName(), "deadband", 0.05);
SLOW_TURN_FORWARD_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "slow_turn_forward_speed", 0.16);
SLOW_TURN_BACKWARD_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "slow_turn_backward_speed", -0.19);
FEED_FORWARD_VELOCITY_CONSTANT_config = new DoubleConfigFileParameter(this.getClass().getName(), "feed_forward_velocity_constant", 1.00);
FEED_FORWARD_ACCELERATION_CONSTANT_config = new DoubleConfigFileParameter(this.getClass().getName(), "feed_forward_acceleration_constant", 0.00018);
MAX_ACCELERATION_DRIVE_PROFILE_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_acceleration_drive_profile", 600.0);
MAX_SPEED_INCHES_LOWGEAR_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_speed_inches_lowgear", 90.0);
DECELERATION_VELOCITY_THRESHOLD_config = new DoubleConfigFileParameter(this.getClass().getName(), "deceleration_velocity_threshold", 48.0);
DECELERATION_MOTOR_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "deceleration_motor_speed", 0.3);
STOPPING_DISTANCE_AT_MAX_SPEED_LOWGEAR_config = new DoubleConfigFileParameter(this.getClass().getName(), "stopping_distance_at_max_speed_lowgear", 10.0);
DRIVE_OFFSET_config = new AutonomousDoubleConfigFileParameter("DriveOffset", 1.00);
USE_LEFT_SIDE_FOR_OFFSET_config = new AutonomousBooleanConfigFileParameter("UseLeftDriveForOffset", true);
QUICK_TURN_CAP_config = new DoubleConfigFileParameter(this.getClass().getName(), "quick_turn_cap", 10.0);
QUICK_TURN_ANTITURBO_config = new DoubleConfigFileParameter(this.getClass().getName(), "quick_turn_antiturbo", 10.0);
//Anti-Turbo button
registerForJoystickButtonNotification(WsJoystickButtonEnum.DRIVER_BUTTON_8);
//Turbo button
registerForJoystickButtonNotification(WsJoystickButtonEnum.DRIVER_BUTTON_7);
//Shifter Button
registerForJoystickButtonNotification(WsJoystickButtonEnum.DRIVER_BUTTON_6);
//Left/right slow turn buttons
registerForJoystickButtonNotification(WsJoystickButtonEnum.DRIVER_BUTTON_1);
registerForJoystickButtonNotification(WsJoystickButtonEnum.DRIVER_BUTTON_3);
//Initialize the drive base encoders
leftDriveEncoder = new Encoder(2, 3, true, EncodingType.k4X);
leftDriveEncoder.reset();
leftDriveEncoder.start();
rightDriveEncoder = new Encoder(4, 5, false, EncodingType.k4X);
rightDriveEncoder.reset();
rightDriveEncoder.start();
//Initialize the gyro
//@TODO: Get the correct port
driveHeadingGyro = new Gyro(1);
//Initialize the PIDs
driveDistancePidInput = new WsDriveBaseDistancePidInput();
driveDistancePidOutput = new WsDriveBaseDistancePidOutput();
driveDistancePid = new WsPidController(driveDistancePidInput, driveDistancePidOutput, "WsDriveBaseDistancePid");
driveHeadingPidInput = new WsDriveBaseHeadingPidInput();
driveHeadingPidOutput = new WsDriveBaseHeadingPidOutput();
driveHeadingPid = new WsPidController(driveHeadingPidInput, driveHeadingPidOutput, "WsDriveBaseHeadingPid");
driveSpeedPidInput = new WsDriveBaseSpeedPidInput();
driveSpeedPidOutput = new WsDriveBaseSpeedPidOutput();
driveSpeedPid = new WsSpeedPidController(driveSpeedPidInput, driveSpeedPidOutput, "WsDriveBaseSpeedPid");
continuousAccelerationFilter = new ContinuousAccelFilter(0, 0, 0);
init();
}
示例8: DriveBase
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
public DriveBase(String name) {
super(name);
WHEEL_DIAMETER_config = new DoubleConfigFileParameter(this.getClass().getName(), "wheel_diameter", 6);
TICKS_PER_ROTATION_config = new DoubleConfigFileParameter(this.getClass().getName(), "ticks_per_rotation", 360.0);
THROTTLE_LOW_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "throttle_low_gear_accel_factor", 0.250);
HEADING_LOW_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "heading_low_gear_accel_factor", 0.500);
THROTTLE_HIGH_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "throttle_high_gear_accel_factor", 0.125);
HEADING_HIGH_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "heading_high_gear_accel_factor", 0.250);
MAX_HIGH_GEAR_PERCENT_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_high_gear_percent", 0.80);
ENCODER_GEAR_RATIO_config = new DoubleConfigFileParameter(this.getClass().getName(), "encoder_gear_ratio", 7.5);
DEADBAND_config = new DoubleConfigFileParameter(this.getClass().getName(), "deadband", 0.05);
SLOW_TURN_FORWARD_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "slow_turn_forward_speed", 0.16);
SLOW_TURN_BACKWARD_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "slow_turn_backward_speed", -0.19);
FEED_FORWARD_VELOCITY_CONSTANT_config = new DoubleConfigFileParameter(this.getClass().getName(), "feed_forward_velocity_constant", 1.00);
FEED_FORWARD_ACCELERATION_CONSTANT_config = new DoubleConfigFileParameter(this.getClass().getName(), "feed_forward_acceleration_constant", 0.00018);
MAX_ACCELERATION_DRIVE_PROFILE_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_acceleration_drive_profile", 600.0);
MAX_SPEED_INCHES_LOWGEAR_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_speed_inches_lowgear", 90.0);
DECELERATION_VELOCITY_THRESHOLD_config = new DoubleConfigFileParameter(this.getClass().getName(), "deceleration_velocity_threshold", 48.0);
DECELERATION_MOTOR_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "deceleration_motor_speed", 0.3);
STOPPING_DISTANCE_AT_MAX_SPEED_LOWGEAR_config = new DoubleConfigFileParameter(this.getClass().getName(), "stopping_distance_at_max_speed_lowgear", 10.0);
DRIVE_OFFSET_config = new AutonomousDoubleConfigFileParameter("DriveOffset", 1.00);
USE_LEFT_SIDE_FOR_OFFSET_config = new AutonomousBooleanConfigFileParameter("UseLeftDriveForOffset", true);
QUICK_TURN_CAP_config = new DoubleConfigFileParameter(this.getClass().getName(), "quick_turn_cap", 10.0);
QUICK_TURN_ANTITURBO_config = new DoubleConfigFileParameter(this.getClass().getName(), "quick_turn_antiturbo", 10.0);
//Anti-Turbo button
registerForJoystickButtonNotification(JoystickButtonEnum.DRIVER_BUTTON_8);
//Turbo button
registerForJoystickButtonNotification(JoystickButtonEnum.DRIVER_BUTTON_7);
//Shifter Button
registerForJoystickButtonNotification(JoystickButtonEnum.DRIVER_BUTTON_6);
//Initialize the drive base encoders
leftDriveEncoder = new Encoder(2, 3, true, EncodingType.k4X);
leftDriveEncoder.reset();
leftDriveEncoder.start();
rightDriveEncoder = new Encoder(4, 5, false, EncodingType.k4X);
rightDriveEncoder.reset();
rightDriveEncoder.start();
//Initialize the gyro
//@TODO: Get the correct port
driveHeadingGyro = new Gyro(1);
continuousAccelerationFilter = new ContinuousAccelFilter(0, 0, 0);
driveSpeedPidInput = new DriveBaseSpeedPidInput();
driveSpeedPidOutput = new DriveBaseSpeedPidOutput();
driveSpeedPid = new SpeedPidController(driveSpeedPidInput, driveSpeedPidOutput, "DriveBaseSpeedPid");
init();
}
示例9: WsDriveBase
import com.wildstangs.autonomous.parameters.AutonomousBooleanConfigFileParameter; //导入依赖的package包/类
public WsDriveBase(String name) {
super(name);
WHEEL_DIAMETER_config = new DoubleConfigFileParameter(this.getClass().getName(), "wheel_diameter", 6);
TICKS_PER_ROTATION_config = new DoubleConfigFileParameter(this.getClass().getName(), "ticks_per_rotation", 360.0);
THROTTLE_LOW_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "throttle_low_gear_accel_factor", 0.250);
HEADING_LOW_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "heading_low_gear_accel_factor", 0.500);
THROTTLE_HIGH_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "throttle_high_gear_accel_factor", 0.125);
HEADING_HIGH_GEAR_ACCEL_FACTOR_config = new DoubleConfigFileParameter(this.getClass().getName(), "heading_high_gear_accel_factor", 0.250);
MAX_HIGH_GEAR_PERCENT_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_high_gear_percent", 0.80);
ENCODER_GEAR_RATIO_config = new DoubleConfigFileParameter(this.getClass().getName(), "encoder_gear_ratio", 7.5);
DEADBAND_config = new DoubleConfigFileParameter(this.getClass().getName(), "deadband", 0.05);
SLOW_TURN_FORWARD_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "slow_turn_forward_speed", 0.16);
SLOW_TURN_BACKWARD_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "slow_turn_backward_speed", -0.19);
FEED_FORWARD_VELOCITY_CONSTANT_config = new DoubleConfigFileParameter(this.getClass().getName(), "feed_forward_velocity_constant", 1.00);
FEED_FORWARD_ACCELERATION_CONSTANT_config = new DoubleConfigFileParameter(this.getClass().getName(), "feed_forward_acceleration_constant", 0.00018);
MAX_ACCELERATION_DRIVE_PROFILE_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_acceleration_drive_profile", 600.0);
MAX_SPEED_INCHES_LOWGEAR_config = new DoubleConfigFileParameter(this.getClass().getName(), "max_speed_inches_lowgear", 90.0);
DECELERATION_VELOCITY_THRESHOLD_config = new DoubleConfigFileParameter(this.getClass().getName(), "deceleration_velocity_threshold", 48.0);
DECELERATION_MOTOR_SPEED_config = new DoubleConfigFileParameter(this.getClass().getName(), "deceleration_motor_speed", 0.3);
STOPPING_DISTANCE_AT_MAX_SPEED_LOWGEAR_config = new DoubleConfigFileParameter(this.getClass().getName(), "stopping_distance_at_max_speed_lowgear", 10.0);
DRIVE_OFFSET_config = new AutonomousDoubleConfigFileParameter("DriveOffset", 1.00);
USE_LEFT_SIDE_FOR_OFFSET_config = new AutonomousBooleanConfigFileParameter("UseLeftDriveForOffset", true);
QUICK_TURN_CAP_config = new DoubleConfigFileParameter(this.getClass().getName(), "quick_turn_cap", 10.0);
QUICK_TURN_ANTITURBO_config = new DoubleConfigFileParameter(this.getClass().getName(), "quick_turn_antiturbo", 10.0);
//Anti-Turbo button
Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.DRIVER_JOYSTICK).getSubject(WsDriverJoystickButtonEnum.BUTTON8);
subject.attach(this);
//Turbo button
subject = WsInputManager.getInstance().getOiInput(WsInputManager.DRIVER_JOYSTICK).getSubject(WsDriverJoystickButtonEnum.BUTTON7);
subject.attach(this);
//Shifter Button
subject = WsInputManager.getInstance().getOiInput(WsInputManager.DRIVER_JOYSTICK).getSubject(WsDriverJoystickButtonEnum.BUTTON6);
subject.attach(this);
//Left/right slow turn buttons
subject = WsInputManager.getInstance().getOiInput(WsInputManager.DRIVER_JOYSTICK).getSubject(WsDriverJoystickButtonEnum.BUTTON1);
subject.attach(this);
subject = WsInputManager.getInstance().getOiInput(WsInputManager.DRIVER_JOYSTICK).getSubject(WsDriverJoystickButtonEnum.BUTTON3);
subject.attach(this);
//Initialize the drive base encoders
leftDriveEncoder = new Encoder(2, 3, true, EncodingType.k4X);
leftDriveEncoder.reset();
leftDriveEncoder.start();
rightDriveEncoder = new Encoder(4, 5, false, EncodingType.k4X);
rightDriveEncoder.reset();
rightDriveEncoder.start();
//Initialize the gyro
//@TODO: Get the correct port
driveHeadingGyro = new Gyro(1);
//Initialize the PIDs
driveDistancePidInput = new WsDriveBaseDistancePidInput();
driveDistancePidOutput = new WsDriveBaseDistancePidOutput();
driveDistancePid = new WsPidController(driveDistancePidInput, driveDistancePidOutput, "WsDriveBaseDistancePid");
driveHeadingPidInput = new WsDriveBaseHeadingPidInput();
driveHeadingPidOutput = new WsDriveBaseHeadingPidOutput();
driveHeadingPid = new WsPidController(driveHeadingPidInput, driveHeadingPidOutput, "WsDriveBaseHeadingPid");
driveSpeedPidInput = new WsDriveBaseSpeedPidInput();
driveSpeedPidOutput = new WsDriveBaseSpeedPidOutput();
driveSpeedPid = new WsSpeedPidController(driveSpeedPidInput, driveSpeedPidOutput, "WsDriveBaseSpeedPid");
continuousAccelerationFilter = new ContinuousAccelFilter(0, 0, 0);
init();
}