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


Java CommandBase类代码示例

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


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

示例1: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    autonomousCommand = new ExampleCommand();
    
    frontLeft = new Victor(1); // Creating Victor motors
    frontRight = new Victor(2);
    rearLeft = new Victor(3);
    rearRight = new Victor(4);
    
    myDrive = new RobotDrive(frontLeft, frontRight);
    // myDrive = new RobotDrive(frontLeft,frontRight,rearLeft,rearRight);
    
    driveStick = new Joystick(1);
    
    gyro = new Gyro(1);

    // Initialize all subsystems
    CommandBase.init();
}
 
开发者ID:Spartronics4915,项目名称:2014-Aerial-Assist,代码行数:24,代码来源:RobotTemplate.java

示例2: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
public void robotInit() {
        // instantiate the command used for the autonomous period
        //autonomousCommand = new ExampleCommand();
        
        // Initialize all subsystems
        CommandBase.init();
        
        table = NetworkTable.getTable("CRIO");
        table.putBoolean("bool", true);
        table.putNumber("double", 3.1415927);
        table.putString("sring", "a string");
        
        LogDebugger.log("robot init!!!");
	
//	LiveWindow.addActuator("compressor", "alt relay", RobotMap.testCompRelay);
//	LiveWindow.addActuator("compressor", "act compressor", RobotMap.airCompressor);
//	LiveWindow.addSensor("compressor", "sensor compressor", RobotMap.airCompressor);
    }
 
开发者ID:Team3574,项目名称:RKellyBot,代码行数:19,代码来源:Robot.java

示例3: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 *
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    DriveTrain = new DriveTrain();
    launchercontroller = new Launcher();
    rollerSubsystem = new Roller();
    display = DriverStationLCD.getInstance();
    compressor = new Compressor(RobotMap.PressureSwitchDigitalInput, RobotMap.CompressorRelay);
    compressor.start();
    
    DriveTrain.shiftHighGear();

    OI.initialize();


    autonomousCommand = new Autonomous();
    
    arduino = new ArduinoConnection();
    arduino.setPattern("4");
    pattern = 0;
    driverStation = DriverStation.getInstance();
    alliance = driverStation.getAlliance().value;
    digital1 = driverStation.getDigitalIn(1);
    digital2 = driverStation.getDigitalIn(2);
    digital3 = driverStation.getDigitalIn(3);
    // Initialize all subsystems.
    // Subsystems: a self-contained system within a larger system. 
    CommandBase.init();
}
 
开发者ID:CarmelRobotics,项目名称:aeronautical-facilitation,代码行数:32,代码来源:AeronauticalFacilitation.java

示例4: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    autonomousCommand = new ExampleCommand();
    RobotParts.compressor.start();
    RobotParts.drive.setSafetyEnabled(false);

    // Initialize all subsystems
    CommandBase.init();
}
 
开发者ID:FIRST-Team-2557-The-SOTABots,项目名称:2014,代码行数:14,代码来源:RobotTemplate.java

示例5: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    
    SmartDashboard.putData("Tank Drive", new SetStation(1));
    SmartDashboard.putData("Arcade Drive", new SetStation(2));
    SmartDashboard.putData("XBox Controller Tank", new SetStation(3));
    SmartDashboard.putData("XBox Controller Arcade", new SetStation(4));
    /**
     * Adds buttons to SmartDAshboard
    */        
    // instantiate the command used for the autonomous period
    autonomousCommand = new AutonomousCommand();
    prefs = Preferences.getInstance();
    prefs.putDouble("Deadband",0.1);
    prefs.putDouble("ArmDeadband", 0.1);
    prefs.putDouble("LeftPolarity", -1);
    prefs.putDouble("RightPolarity", -1);
    prefs.putDouble("Scaler", 1);
    prefs.putDouble("HueLow", 80);
    prefs.putDouble("HueHigh", 200);
    prefs.putDouble("SaturationLow",100);
    prefs.putDouble("SaturationHigh",300);
    prefs.putDouble("BrightnessLow",200);
    prefs.putDouble("BrightnessHigh", 240);
    SmartDashboard.putData(Scheduler.getInstance());
    /**
     * Adds variables to the Preferences Table in SmartDashboard,
     */
    // Initialize all subsystems
    CommandBase.init();

    System.out.println("--------------------2713-----------------------");
    System.out.println("*Awsome-sauce code produced by Fid  inc.      *");
    System.out.println("*WARNING: might not possibly work             *");
    System.out.println("-----------------TEST-ROBOT--------------------");       
}
 
开发者ID:iraiders,项目名称:2014Robot-,代码行数:40,代码来源:TestRobot.java

示例6: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    autonomousCommand = new ExampleCommand();

    // Initialize all subsystems
    CommandBase.init();
}
 
开发者ID:Team997Coders,项目名称:BunnyBotPIDv2,代码行数:12,代码来源:RobotTemplate.java

示例7: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    teleopDriveCommand = new DriveWithJoystick();

    // Initialize all subsystems
    CommandBase.init();
}
 
开发者ID:Team3585,项目名称:2014MainCode,代码行数:11,代码来源:RobotTemplate.java

示例8: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    autonomousCommand = new AutoMode();

    // Initialize all subsystems
    CommandBase.init();
}
 
开发者ID:Greater-Rochester-Robotics,项目名称:AerialAssist2014,代码行数:12,代码来源:RobotTemplate.java

示例9: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    //autonomousCommand = new Autonomous();
    // Initialize all subsystems
    CommandBase.init();
    SmartDashboard.putData(Scheduler.getInstance());
    delay = new Delay(1);
    gyroOff = CommandBase.gyro.getAngle()/Timer.getFPGATimestamp();
}
 
开发者ID:frc3946,项目名称:MecanumDrivetrain,代码行数:14,代码来源:RobotTemplate.java

示例10: teleopInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
public void teleopInit() {
// This makes sure that the autonomous stops running when
       // teleop starts running. If you want the autonomous to 
       // continue until interrupted by another command, remove
       // this line or comment it out.
       //autonomousCommand.cancel();
       delay = new Delay(1);
       gyroOff = CommandBase.gyro.getAngle()/Timer.getFPGATimestamp();
   }
 
开发者ID:frc3946,项目名称:MecanumDrivetrain,代码行数:10,代码来源:RobotTemplate.java

示例11: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    getWatchdog().setEnabled(true);
    RobotMap.init();
    CommandBase.init();
    drivetrain = CommandBase.drivetrain;
    SmartDashboard.putBoolean("motorKilled", false);
}
 
开发者ID:246overclocked,项目名称:rover,代码行数:12,代码来源:RoverRobot.java

示例12: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
public void robotInit() {
    autonomousCommand = new Autonomous1();
    autoChooser = new SendableChooser();
    autoChooser.addDefault("Autonomous 1", new Autonomous1());
    SmartDashboard.putData("Autonomous Chooser", autoChooser);
    CommandBase.init();
}
 
开发者ID:Team3266,项目名称:legacy,代码行数:8,代码来源:RobotTemplate.java

示例13: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
   // autonomousCommand = new ExampleCommand();

    // Initialize all subsystems
    CommandBase.init();
}
 
开发者ID:DECABotz-3186,项目名称:frc-3186,代码行数:12,代码来源:DecaBot.java

示例14: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // Initialize the CommandBase so that everything is ready to run
    CommandBase.init();
    
    // instantiate the command used for the autonomous period
    // Set it so that it runs the SodaDelivery command automatically during 
    // the automous period.
    autonomousCommand = new SodaDelivery();
}
 
开发者ID:TeamParadise,项目名称:GearsBot,代码行数:14,代码来源:GearsBot.java

示例15: robotInit

import edu.wpi.first.wpilibj.templates.commands.CommandBase; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotInit() {
    // instantiate the command used for the autonomous period
    autonomousCommand = new ExampleCommand();
    driveCommand = new Drive();
    shootCommand = new RunShooter();
    eccentricCommand = new EccentricWheel();
    potCommand = new Potentiometer();

    // Initialize all subsystems
    CommandBase.init();
}
 
开发者ID:FIRST-FRC-Team-4097,项目名称:Robot-Code-2013,代码行数:16,代码来源:RobotTemplate.java


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