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


Java SmartDashboard.putData方法代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.smartdashboard.SmartDashboard.putData方法的典型用法代码示例。如果您正苦于以下问题:Java SmartDashboard.putData方法的具体用法?Java SmartDashboard.putData怎么用?Java SmartDashboard.putData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.wpi.first.wpilibj.smartdashboard.SmartDashboard的用法示例。


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

示例1: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
@Override
public void robotInit() {
	chassis = new Chassis();
	intake = new Intake();
	wheelintake = new wheelIntake();

	oi = new OI();
	chooser.addDefault("Default Auto", new DriveWithJoystick());
	// chooser.addObject("My Auto", new MyAutoCommand());
	SmartDashboard.putData("Auto mode", chooser);
	
	chassis.publishToSmartDashboard();
	

}
 
开发者ID:2141-Spartonics,项目名称:Spartonics-Code,代码行数:20,代码来源:Robot.java

示例2: OI

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public OI() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS

    xBoxController = new Joystick(0);
    
    aButton = new JoystickButton(xBoxController, 1);
    bButton = new JoystickButton(xBoxController, 2);
    xButton = new JoystickButton(xBoxController, 3);
    aButton.whenPressed(new RelayOn());
    //b button operated by default command only?
    bButton.whenPressed(new AllForward());
    xButton.whenPressed(new MotorPositionCheck());
    

    // SmartDashboard Buttons
    SmartDashboard.putData("Autonomous Command", new AutonomousCommand());
    SmartDashboard.putData("RelayOn", new RelayOn());
    SmartDashboard.putData("AllForward", new AllForward());
    SmartDashboard.putData("MotorPositionCheck", new MotorPositionCheck());
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
 
开发者ID:FRC2832,项目名称:Practice_Robot_Code,代码行数:22,代码来源:OI.java

示例3: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
@Override
public void robotInit() {
	
	// Initialize hardware
	RobotMap.init();

	// Initialize subsystems and default ManualDrive
	driveTrain = new DriveTrain();

	vision = new Vision();
	vision.init();
	shooter = new Shooter();
	indexer = new Indexer();
	ballCollector = new BallCollector();
	gearLoader = new GearLoader();
	lifter = new Lifter();
	
	// Initialize OI
	oi = new OI();
	getStatus = new GetStatus();
	getStatus.setRunWhenDisabled(true);

	chooser = new SendableChooser<>();
	chooser.addDefault("Cross Line (L/R)", new CGAutoCrossLine());
	chooser.addObject("Right", new CGAutoRight());
	chooser.addObject("Middle", new CGAutoMiddle());
	chooser.addObject("Left", new CGAutoLeft());
	
	SmartDashboard.putData("Auto mode", chooser);
}
 
开发者ID:1757WestwoodRobotics,项目名称:2017-Steamworks,代码行数:35,代码来源:Robot.java

示例4: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
@Override
public void robotInit() {
    chooser.addDefault("gear", new HangGear());
    chooser.addObject("baseline", new BaseLine());
    SmartDashboard.putData("Auto", chooser);

    oi = new OI();

    UsbCamera cam = CameraServer.getInstance().startAutomaticCapture(0);
    cam.setResolution(640, 480);
    cam.setFPS(60);
    UsbCamera cam1 = CameraServer.getInstance().startAutomaticCapture(1);
    cam1.setResolution(640, 480);
    cam1.setFPS(60);
    SmartDashboard.putString("Robot State:", "started");
    System.out.println("Robot init");
    chassis.startMonitor();
    intaker.startMonitor();

    shooter.setSleepTime(100);
    shooter.startMonitor();

    stirrer.setSleepTime(300);
    stirrer.startMonitor();

    uSensor.setSleepTime(100);
    uSensor.startMonitor();
}
 
开发者ID:FRCteam6414,项目名称:FRC6414program,代码行数:33,代码来源:Robot.java

示例5: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的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

示例6: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/** runs when robot is turned on */
public void robotInit() {
	/// instantiate operator interface
		OI.ye();
		
	/// instantiate subsystems
		SUB_DRIVE = new SubsystemDrive();
	
	/// instantiate autonomous chooser
		autoChooser = new SendableChooser<>();
		autoChooser.addDefault(Autonomous.NOTHING.toString(), Autonomous.NOTHING); // set default to nothing
		for(int i = 1; i < Autonomous.values().length; i++) { 
			autoChooser.addObject(Autonomous.values()[i].toString(), Autonomous.values()[i]); } // add each autonomous enum value to chooser
		SmartDashboard.putData("Auto Mode", autoChooser); //display the chooser on the dash
}
 
开发者ID:wh1ter0se,项目名称:PowerUp-2018,代码行数:16,代码来源:Robot.java

示例7: init

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public static void init() {
	sensors.setDefCommand(new CommandReadSensors());
	driver.setDefCommand(new CommandDrive());
	
	//Don't move or change this. EVER.
	oi = new OI();

	//Calls the method in SubsystemSensors that starts all sensors. Do not remove.
	sensors.initSensors();

	//Adds information from all subsystems to the dashboard.
	for(int a = 0; a < subsystemList.size(); a++) SmartDashboard.putData(subsystemList.get(a));
	SmartDashboard.putNumber("Number of subsystems", id);
}
 
开发者ID:FRC5800,项目名称:FRC-5800-Stronghold,代码行数:15,代码来源:CommandBase.java

示例8: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
@Override
public void robotInit() {
    compressor.start();
    CameraServer.getInstance().startAutomaticCapture(0);
    autoSelector = new SendableChooser<>();
    autoSelector.addDefault("Drive Forward", new DriveForward());
    autoSelector.addObject("Place Middle Gear", new MidGearAuto());
    autoSelector.addObject("Place Right Gear <<< Feeling lucky?", new RightGearAuto());
    autoSelector.addObject("Shoot on Blue Alliance", new BlueShootAuto());
    autoSelector.addObject("Shoot on Red Alliance", new RedShootAuto());
    SmartDashboard.putData("Autonomous Command", autoSelector);
    visiontracking = new VisionTracking();
    //created this last for ordering issues
    oi = new OperatorInterface();
}
 
开发者ID:FRC-2928,项目名称:VikingRobot,代码行数:16,代码来源:Robot.java

示例9: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public void robotInit() {
/*UsbCamera camera = CameraServer.getInstance().startAutomaticCapture(); 
camera.setResolution(320,500);*/
	

/*
visionThread = new VisionThread(camera, new GripPipeline(), pipeline -> {
       if (!pipeline.filterContoursOutput().isEmpty()) {
           Rect r = Imgproc.boundingRect(pipeline.filterContoursOutput().get(0));
            
           synchronized (imgLock) {
               centerX = r.x + (r.width / 2);
               centerY = r.y + (r.height / 2);
              
               centerOrjin = -1.centerX 1-1.centerY);
               
               --|--
               
               
           }
       }
   });
   visionThread.start();
   */
   chooser.addDefault("Default Auto", defaultAuto);
chooser.addObject("My Auto", customAuto);
SmartDashboard.putData("Auto choices", chooser);		
}
 
开发者ID:mustafamertunali,项目名称:FRC-6416-frc2017,代码行数:29,代码来源:Robot.java

示例10: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
@Override
public void robotInit() {
	oi = new OI();
	
	drivetrain = new Drivetrain();

	// chooser.addObject("My Auto", new MyAutoCommand());
	SmartDashboard.putData("Auto mode", chooser);
	SmartDashboard.putNumber("kP", 0.0);
	SmartDashboard.putNumber("kI", 0.0);
	SmartDashboard.putNumber("kD", 0.0);
}
 
开发者ID:Team694,项目名称:DriveStraightBot,代码行数:17,代码来源:Robot.java

示例11: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
@Override
public void robotInit() {
	oi = new OI();
	chooser.addDefault("Default Auto", new ExampleCommand());
	// chooser.addObject("My Auto", new MyAutoCommand());
	SmartDashboard.putData("Auto mode", chooser);
}
 
开发者ID:luke-backer,项目名称:wall-bounce,代码行数:12,代码来源:Robot.java

示例12: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
@Override
public void robotInit() {
	oi = new OI();
	autoChooser = new SendableChooser<Command>();
	autoChooser.addDefault("My Auto 1", new MyAutoCommand1());
	//autoChooser.addObject("My Auto 2", new MyAutoCommand2());
	//autoChooser.addObject("My Auto 3", new GyroDriveCommand(0.6, 0.6));
	SmartDashboard.putData("Auto mode", autoChooser);
}
 
开发者ID:FRC6706,项目名称:FRC6706_JAVA2017,代码行数:14,代码来源:Robot.java

示例13: putData

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public static void putData(NamedSendable value) {
	SmartDashboard.putData(value);
}
 
开发者ID:Team997Coders,项目名称:2017SteamBot2,代码行数:4,代码来源:CustomDashboard.java

示例14: OI

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public OI() {
	double speed = Preferences.getInstance().getDouble(RobotMap.desiredSpeed, 0.0);
	double distance = Preferences.getInstance().getDouble(RobotMap.desiredDistance, 0.0);
	SmartDashboard.putData(new DriveDistance(distance, speed));
	SmartDashboard.putData(new CenterGearAutonomous());
	SmartDashboard.putData(new UpManipulator());
	SmartDashboard.putData(new DriveStraightAuto(distance, speed));

	JoystickButton leftJoyTrigger = new JoystickButton(stickLeft, 1);
	JoystickButton button2Left = new JoystickButton(stickLeft, 2);
	JoystickButton button3Left = new JoystickButton(stickLeft, 3);
	JoystickButton button4Left = new JoystickButton(stickLeft, 4);
	JoystickButton button5Left = new JoystickButton(stickLeft, 5);
	JoystickButton button6Left = new JoystickButton(stickLeft, 6);
	JoystickButton button7Left = new JoystickButton(stickLeft, 7);
	JoystickButton button8Left = new JoystickButton(stickLeft, 8);
	JoystickButton button9Left = new JoystickButton(stickLeft, 9);
	JoystickButton button10Left = new JoystickButton(stickLeft, 10);
	JoystickButton button11Left = new JoystickButton(stickLeft, 11);

	JoystickButton rightJoyTrigger = new JoystickButton(stickRight, 1);
	// JoystickButton button2Right = new JoystickButton(stickRight, 2);
	// JoystickButton button3Right = new JoystickButton(stickRight, 3);
	// JoystickButton button4Right = new JoystickButton(stickRight, 4);
	// JoystickButton button5Right = new JoystickButton(stickRight, 5);
	// JoystickButton button6Right = new JoystickButton(stickRight, 6);
	// JoystickButton button7Right = new JoystickButton(stickRight, 7);
	// JoystickButton button8Right = new JoystickButton(stickRight, 8);
	// JoystickButton button9Right = new JoystickButton(stickRight, 9);
	// JoystickButton button10Right = new JoystickButton(stickRight, 10);
	// JoystickButton button11Right = new JoystickButton(stickRight, 11);

	JoystickButton buttonA = new JoystickButton(xbox, 1);
	JoystickButton buttonB = new JoystickButton(xbox, 2);
	JoystickButton buttonX = new JoystickButton(xbox, 3);
	JoystickButton buttonY = new JoystickButton(xbox, 4);
	// XboxLeftTrigger xboxLeftTrigger = new XboxLeftTrigger();
	// XboxRightTrigger xboxRightTrigger = new XboxRightTrigger();

	JoystickButton leftButton = new JoystickButton(xbox, 5);
	JoystickButton rightButton = new JoystickButton(xbox, 6);
	JoystickButton back = new JoystickButton(xbox, 7);
	JoystickButton start = new JoystickButton(xbox, 8);
	JoystickButton leftJoyXboxButton = new JoystickButton(xbox, 9);
	JoystickButton rightJoyXboxButton = new JoystickButton(xbox, 10);
	// Xbox commands

	buttonA.whenPressed(new ToggleGearManip());
	buttonX.whileHeld(new ClimberOn());
	buttonB.whileHeld(new ShooterCommandGroup());
	buttonB.whenReleased(new AugerOff());
	buttonB.whenReleased(new ShooterOff());
	buttonB.whenReleased(new ElevatorOff());
	rightButton.whenPressed(new DropManipulatorReverseMotor());

	// Joystick commands

	rightJoyTrigger.whileHeld(new RunIntake());
	leftJoyTrigger.whileHeld(new DriveStraightJoysticks());
	button2Left.toggleWhenActive(new DriveHalfSpeed());
}
 
开发者ID:chopshop-166,项目名称:frc-2017,代码行数:62,代码来源:OI.java

示例15: robotInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */

public void robotInit() {
	RobotMap.init();
	

	autoChooser = new SendableChooser();
	autoChooser.addDefault("MiddleProgram", new MoveForward());
	autoChooser.addObject("LeftSideAuto", new AutonomousLeftSide());
	autoChooser.addObject("RightSideAuto", new AutonomousRightSide());
	SmartDashboard.putData("Autonomous Mode Chooser", autoChooser);
	// create variable autoChooser and create different instances of the
	// variable so you
	// can select different autonomouses through the SmartDashboard

	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
       driveBase = new DriveBase();
       gearBase = new GearBase();
       climberBase = new ClimberBase();
       intakeBase = new IntakeBase();
       lifterBase = new LifterBase();

   // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
	// OI must be constructed after subsystems. If the OI creates Commands
	// (which it very likely will), subsystems are not guaranteed to be
	// constructed yet. Thus, their requires() statements may grab null
	// pointers. Bad news. Don't move it.
       //visionStream = new VisionStream();
	oi = new OI();
	

	autonomousCommand = new AutonomousCommand();

	// instantiate the command used for the autonomous period
	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS


   // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS

	CameraServer.getInstance().startAutomaticCapture();
	// starts vision stream
}
 
开发者ID:RobotsByTheC,项目名称:CMonster2017,代码行数:46,代码来源:Robot.java


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