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


Java Drive类代码示例

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


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

示例1: robotInit

import org.usfirst.frc.team166.robot.subsystems.Drive; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be used for any initialization code.
 */
@Override
public void robotInit() {
	drive = new Drive();
	gearManipulator = new GearManipulator();
	intake = new Intake();
	shooter = new Shooter();
	storage = new Storage();
	climber = new Climber();
	elevator = new Elevator();
	vision = new Vision();
	visionProcessing = new LiveUsbCamera();
	oi = new OI();
	Robot.gearManipulator.gearManipulatorUp();
	chooser.addDefault("Center Gear Auto", new CenterGearAutonomous());
	chooser.addObject("Base Line Autonomous", new BaseLineAutonomous());
	chooser.addObject("Boiler side Blue auto", new BoilerSideBlueAuto());
	chooser.addObject("Boiler side Red auto", new BoilerSideRedAuto());
	chooser.addObject("Do Nothing Autonomous", null);

	double speed = Preferences.getInstance().getDouble(RobotMap.centerGearAutoSpeed, 0);
	double distance = Preferences.getInstance().getDouble(RobotMap.centerGearAutoDistance, 0);

	SmartDashboard.putData("Auto Mode", chooser);
	// xboxLeftTrigger.whileActive(new ClimberTriggerOn());
	xboxRightTrigger.whileActive(new RunShooter());

	visionProcessing.runUsbCamera();
}
 
开发者ID:chopshop-166,项目名称:frc-2017,代码行数:32,代码来源:Robot.java

示例2: robotInit

import org.usfirst.frc.team166.robot.subsystems.Drive; //导入依赖的package包/类
/**
 * This function is run when the robot is first started up and should be used for any initialization code.
 */
@Override
public void robotInit() {
	drive = new Drive();
	intake = new Intake();
	shooter = new Shooter();
	aimShooter = new AimShooter();
	vision = new Vision();
	intakeRoller = new IntakeRoller();
	aManipulators = new AManipulators();
	shooterLock = new ShooterLock();

	// autochooser
	autoChooser = new SendableChooser();

	oi = new OI();

	// auto chooser commands
	autoChooser.addObject("NOTHING", null);
	autoChooser.addDefault("ONE: LOW", new FarLeftAuto());
	autoChooser.addObject("MID: UP", new AllUpMidAuto());
	autoChooser.addObject("MID: DOWN", new AllDownMidAuto());
	autoChooser.addObject("MID: CDF", new MidCDFAuto());
	autoChooser.addObject("TWO: DOWN (Untested)", new AllDownPositionTwoAuto());
	autoChooser.addObject("TWO: UP (Untested)", new AllUpPositionTwoAuto());

	// autoChooser.addObject("MidLeftAuto", new MidLeftAuto());
	// autoChooser.addObject("MidRightAuto", new MidRightAuto());
	// autoChooser.addObject("FarRightAuto", new FarRightAuto());
	// autoChooser.addObject("Uber Auto", new UberAuto());

	// Hard code for auto
	// autonomousCommand = new FarLeftAuto();
	// autonomousCommand = new AllDownAuto();
	// autonomousCommand = new AllUpAuto();
	// autonomousCommand = new PaperWeightAuto();

	SmartDashboard.putData("Autonomous", autoChooser);

	povUpTrigger.whenActive(new MoveActuatorsUp());
	povDownTrigger.whenActive(new MoveActuatorsDown());
	rightXBoxTrigger.whenActive(new SlowMediumRangeShot());
	// leftXBoxTrigger.whenActive(new BackwardMovingShot());
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:47,代码来源:Robot.java


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