当前位置: 首页>>代码示例>>Java>>正文


Java LiveWindowSendable类代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.livewindow.LiveWindowSendable的典型用法代码示例。如果您正苦于以下问题:Java LiveWindowSendable类的具体用法?Java LiveWindowSendable怎么用?Java LiveWindowSendable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LiveWindowSendable类属于edu.wpi.first.wpilibj.livewindow包,在下文中一共展示了LiveWindowSendable类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import edu.wpi.first.wpilibj.livewindow.LiveWindowSendable; //导入依赖的package包/类
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);
    
}
 
开发者ID:FRC2642,项目名称:FRC-2015cb,代码行数:76,代码来源:RobotMap.java


注:本文中的edu.wpi.first.wpilibj.livewindow.LiveWindowSendable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。