Java 类edu.wpi.first.wpilibj.livewindow.LiveWindowSendable 实例源码

项目:FRC-2015cb    文件:RobotMap.java   
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveTrainFrontLeftMotor = new Jaguar(2);
    LiveWindow.addActuator("DriveTrain", "FrontLeftMotor", (Jaguar) driveTrainFrontLeftMotor);

    driveTrainRearLeftMotor = new Jaguar(3);
    LiveWindow.addActuator("DriveTrain", "RearLeftMotor", (Jaguar) driveTrainRearLeftMotor);

    driveTrainFrontRightMotor = new Jaguar(1);
    LiveWindow.addActuator("DriveTrain", "FrontRightMotor", (Jaguar) driveTrainFrontRightMotor);

    driveTrainRearRightMotor = new Jaguar(0);
    LiveWindow.addActuator("DriveTrain", "RearRightMotor", (Jaguar) driveTrainRearRightMotor);

    /*driveTrainRearLeftPID = new PIDSpeedController(backLeftEncoder, driveTrainRearLeftMotor, "Drive", "Back Left");
    LiveWindow.addActuator("DriveTrain", "RearLeftPID", (Jaguar) driveTrainRearLeftMotor);

    driveTrainRearRightMotor = new PIDSpeedController(backRightEncoder, driveTrainRearRightMotor, "Drive", "Back Right");
    LiveWindow.addActuator("DriveTrain", "RearRightPID", (Jaguar) driveTrainRearRightMotor);*/

    driveTrainrobotDrive = new RobotDrive(driveTrainFrontLeftMotor, driveTrainRearLeftMotor,
          driveTrainFrontRightMotor, driveTrainRearRightMotor);

    driveTrainrobotDrive.setSafetyEnabled(true);
    driveTrainrobotDrive.setExpiration(0.1);
    driveTrainrobotDrive.setSensitivity(0.3);
    driveTrainrobotDrive.setMaxOutput(1.0);
    driveTrainrobotDrive.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, true);
    driveTrainrobotDrive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);

    accel = new BuiltInAccelerometer();
    accel = new BuiltInAccelerometer(Accelerometer.Range.k4G);
    LiveWindow.addSensor("DriveTrain", "Accelerometer", (LiveWindowSendable) accel); 

    gyro = new Gyro(0);
    LiveWindow.addSensor("DriveTrain", "Gyro", (LiveWindowSendable) gyro); 

    liftMotor = new Talon(4);
    LiveWindow.addActuator("Lift", "Lift Motor", (Talon) liftMotor);

    topLimit = new DigitalInput(8);
    LiveWindow.addSensor("Lift", "Upper Limit Switch", topLimit);
    bottomLimit = new DigitalInput(9);
    LiveWindow.addSensor("Lift", "Lower Limit Switch", bottomLimit);

    toteInRobot = new DigitalInput(4);
    LiveWindow.addSensor("Lift", "Tote In Robot", toteInRobot);
    lotOfTotes = new DigitalInput(5);
    LiveWindow.addSensor("Lift", "5 Totes in Robot", lotOfTotes);

    liftEncoder = new Encoder(6,7);
    LiveWindow.addSensor("Lift", "Lift Encoder", liftEncoder);
    backLeftEncoder = new Encoder(2,3);
    LiveWindow.addSensor("Lift", "Back Left Encoder", backLeftEncoder);
    backRightEncoder = new Encoder(0,1);
    LiveWindow.addSensor("Lift", "Back Right Encoder", backRightEncoder);

    leftPicker = new Talon(5);
    LiveWindow.addActuator("Pickers", "Left Picker", (Talon) leftPicker);
    rightPicker = new Talon(6);
    LiveWindow.addActuator("Pickers", "Right Picker", (Talon) rightPicker);

    compressor = new Compressor(0);
    LiveWindow.addActuator("Lift", "Compressor", compressor);
    dogs = new Solenoid(0);
    LiveWindow.addActuator("Lift", "Dogs", dogs);
    pusher = new Solenoid(1);
    LiveWindow.addActuator("Lift", "Pusher", pusher);
    flipper = new Solenoid(2);
    LiveWindow.addActuator("Lift", "Flipper", flipper);

    thatArmThatOpensToReleaseStacks = new Solenoid(3);
    LiveWindow.addActuator("Lift", "Stack Arm", thatArmThatOpensToReleaseStacks);

}