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


Java SmartDashboard.putString方法代码示例

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


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

示例1: execute

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
protected void execute() {
 	//figure out how close is "close enough" because it's unlikely we'll ever get to 2.5 on the dot.  Figure this out through testing
 	
 	Robot.driveTrain.setTankDriveCommand(.6, .6);
 /*	if (Robot.pixyCamera.transaction(sendBuffer, sendBuffer.length, buffer, 1))
 	{
 		pixyValue = buffer[0]  & 0xFF;
 	} */
 	SmartDashboard.putNumber("pixyXAutonAimGear", Robot.pixyValue);
 	if ((int) Robot.pixyValue > 128 && (int) Robot.pixyValue != 255) //132
 			{
 		Robot.driveTrain.setTankDriveCommand(.3, .6);
 		SmartDashboard.putString("PixyImage", "turning right");
 	}
 	else if ((int) Robot.pixyValue < 126){
Robot.driveTrain.setTankDriveCommand(.6, .3);
SmartDashboard.putString("PixyImage", "turning left");//123
 	}
 	else if (Robot.pixyValue == 255)
 		SmartDashboard.putString("PixyImage", "no image");
 
 }
 
开发者ID:FRC2832,项目名称:Robot_2017,代码行数:23,代码来源:AutonAimGear.java

示例2: execute

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
protected void execute() {
	//figure out how close is "close enough" because it's unlikely we'll ever get to 2.5 on the dot.  Figure this out through testing
	double power = 0;
	
/*	if (Robot.pixyCamera.transaction(sendBuffer, sendBuffer.length, buffer, 1))
	{
		pixyValue = buffer[0]  & 0xFF;
	} */
	
	SmartDashboard.putNumber("pixyXAutonAimGear", Robot.pixyValue);
	if (Robot.pixyValue == 255) {
		SmartDashboard.putString("PixyImage", "no image");
    	Robot.driveTrain.setTankDriveCommand(power, power);
	} else {
		final double turnP = 0.6;
		double turn = (127.0 - ((double)Robot.pixyValue)) / 127;
		
		System.out.println("VR-Pixy: " + Robot.pixyValue + " turn: " + turn);
		Robot.driveTrain.setTankDriveCommand(power + (turn * turnP), power - (turn * turnP));
	}	

}
 
开发者ID:FRC2832,项目名称:Robot_2017,代码行数:23,代码来源:VisionRotate.java

示例3: execute

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
     * Continues looping until isFinished returns true(non-Javadoc)
     * Go straight until you reach distance or time
     */
    public void execute() {
        SmartDashboard.putString("Mode", "STRAIGHT");
//        System.out.println("STRAIGHT");

        double speed = Constants.STRAIGHT_SPEED * direction;

//        double leftSpeed = speed - gyroPID.getOutput();
        double leftSpeed = speed;
        double rightSpeed = speed + gyroPID.getOutput();

        driveTrain.setLeftMotors(leftSpeed);
        driveTrain.setRightMotors(rightSpeed);

        // stop if traveled distance
        straightDone = Math.abs(driveTrain.getDistanceTraveled()) >= Math.abs(distance);
        SmartDashboard.putBoolean("EncoderStoppedStraight", straightDone);
        SmartDashboard.putBoolean("TimeStoppedStraight", isTimedOut());
    }
 
开发者ID:Team334,项目名称:R2017,代码行数:23,代码来源:Straight.java

示例4: setTarget

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * Sets target to auto align with
 * Sets all specifications (setpoint, tolerance, areaCap)
 *
 * @param target Target to align with
 */
public void setTarget(Target target) {
    this.target = target;

    if (target == Target.GEAR) {
        areaPID.getController().setSetpoint(Constants.GEAR_TARGET);
        areaPID.getController().setAbsoluteTolerance(Constants.GEAR_TOLERANCE); // 5% tolerance
        areaCap = Constants.GEAR_AREA_CAP;
        SmartDashboard.putString("Target", "GEAR");
    } else if (target == Target.BOILER) {
        areaPID.getController().setSetpoint(Constants.BOILER_TARGET);
        areaPID.getController().setAbsoluteTolerance(Constants.BOILER_TOLERANCE);
        areaCap = Constants.BOILER_AREA_CAP;
        SmartDashboard.putString("Target", "BOILER");
    }
}
 
开发者ID:Team334,项目名称:R2017,代码行数:22,代码来源:VisionAutoAlign.java

示例5: disabledPeriodic

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public void disabledPeriodic() {
	Scheduler.getInstance().run();
	
	SmartDashboard.putString("Selected Auto", chooser.getSelected().getName());
	publishToSmartDashboard();
	//SmartDashboard.putString("Selected Autonomous", chooser.getSelected().getName());
	
}
 
开发者ID:2141-Spartonics,项目名称:Spartonics-Code,代码行数:9,代码来源:Robot.java

示例6: 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

示例7: autoAlign

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
     * calculates amount to turn and move forward to align to target
     * STOPS ROBOT IF TARGET LOST OR IN RANGE
     *
     * @return true if pids ran successfully, false if vision done or interrupted
     */
    public boolean autoAlign() {
        System.out.println("Lost Target " + tracker.lostTarget());
        System.out.println("VisionData running " + VisionData.visionRunning());
        System.out.println("Too close = " + (areaPID.getInput() > areaCap));
        System.out.println("On target " + areaPID.getController().onTarget());
        System.out.println("------------");

        // stop if no vision, no target, too close, or at destination
        tracker.addTargetFound(VisionData.foundTarget());

        if (tracker.lostTarget() || !VisionData.visionRunning() || areaPID.getInput() > areaCap || areaPID.getController().onTarget()) {
            driveTrain.stop();
            SmartDashboard.putString("Mode", "FINISHED");
            return false;
        }

        double div = 0.85 * (1 + Math.abs(offsetPID.getOutput()) / 30.0);
        double speedLeft = offsetPID.getOutput() + areaPID.getOutput() / div;
        double speedRight = -offsetPID.getOutput() + areaPID.getOutput() / div;

//        double angle = VisionData.getAngle();
//        gyroPID.getController().setPID(0.005, 0.0, 0.0);
//        gyroPID.getController().setSetpoint(gyroPID.getInput() + angle);
//
//        // slow down when turning
//        double div = (1 + Math.abs(gyroPID.getOutput()));
//        double speedLeft = gyroPID.getOutput() - areaPID.getOutput() / div;
//        double speedRight = -gyroPID.getOutput() - areaPID.getOutput() / div;

        driveTrain.setLeftMotors(speedLeft);
        driveTrain.setRightMotors(speedRight);

        return true;
    }
 
开发者ID:Team334,项目名称:R2017,代码行数:41,代码来源:VisionAutoAlign.java

示例8: initialize

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
protected void initialize() {

setInitEncoderVal(DriveEncoders.getAbsoluteValue());
SmartDashboard.putString("Auton Debugging", "DriveForwardInit");
System.out.println("DriveFowardInit");
startTime = Timer.getFPGATimestamp();
}
 
开发者ID:FRC2832,项目名称:Robot_2017,代码行数:8,代码来源:DriveCorrected.java

示例9: sendSensorData

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public void sendSensorData() {
		SmartDashboard.putNumber("Right Encoder", driveTrain.getRightDistance());
		SmartDashboard.putNumber("Left Encoder", driveTrain.getLeftDistance());
		SmartDashboard.putNumber("LeftEncVelocity", Robot.driveTrain.getLeftSpeedEnc());
		SmartDashboard.putNumber("RightEncVelocity", Robot.driveTrain.getRightSpeedEnc());
		SmartDashboard.putNumber("LeftSpeed", Robot.driveTrain.getLeftSpeed());
		SmartDashboard.putNumber("RightSpeed", Robot.driveTrain.getRightSpeed());
		SmartDashboard.putNumber("ShootFire Amount Turned", Robot.shoot.getShootFireDistance());
		SmartDashboard.putNumber("ShootFire EncVelocity", Robot.shoot.getShootFireSpeedEnc());
		SmartDashboard.putNumber("ShootFire EncPosition", Robot.shoot.getShootFireDistance());
		SmartDashboard.putNumber("Intake", Robot.oi.getIntake());
		SmartDashboard.putString("ShootFire Speed Control", Robot.shoot.getShootFireMode());
		SmartDashboard.putBoolean("ShootFire is PID?", Robot.shoot.isShootFirePID());
		SmartDashboard.putBoolean("getHighGear", Robot.gear.getHighGear());
		SmartDashboard.putBoolean("haltGear", Robot.gear.getHaltGear());
		SmartDashboard.putBoolean("Is HalfOne?", Robot.driveTrain.getHalfOne());
		SmartDashboard.putBoolean("Is HalfTwo?", Robot.driveTrain.getHalfTwo());
		SmartDashboard.putBoolean("Right Encoder Movement", Robot.driveTrain.encoderEnabledRight());
		SmartDashboard.putBoolean("Left Encoder Movement", Robot.driveTrain.encoderEnabledLeft());
		//pidf
		
		
		
		SmartDashboard.putNumber("GyroAngle", Robot.driveTrain.getGyroAngle());
		// SmartDashboard.putBoolean("PTO On", Robot.driveTrain.getPTO());
		SmartDashboard.putString("DriveTrain control mode", Robot.driveTrain.getDriveTrainControlMode());
		SmartDashboard.putBoolean("DriveTrain is PID?", Robot.driveTrain.isDriveTrainPID());
		SmartDashboard.putNumber("DriveTrain PID: LP", Robot.driveTrain.getLvalueP());
		SmartDashboard.putNumber("DriveTrain PID: LI", Robot.driveTrain.getLvalueI());
		SmartDashboard.putNumber("DriveTrain PID: LD", Robot.driveTrain.getLvalueD());
//		SmartDashboard.putNumber("DriveTrain PID: F", Robot.driveTrain.getValueF());
		
		
	}
 
开发者ID:2729StormRobotics,项目名称:StormRobotics2017,代码行数:35,代码来源:Robot.java

示例10: stri

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public static void stri(String label, String data, boolean log)
{
	SmartDashboard.putString(label, data);
	if(log)
	{
		BulldogLogger.getInstance().log(label, data);
	}
}
 
开发者ID:BytingBulldogs3539,项目名称:BBLIB,代码行数:9,代码来源:bbShuffle.java

示例11: sendDataToSmartDashboard

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * Sends all diagnostics.
 */
public void sendDataToSmartDashboard() {
  SmartDashboard.putString("Gear_Mechanism_Position", position.toString());
  
  SmartDashboard.putNumber("Light_Spoke_Down", lsSpokeDown.getAverageVoltage());
  SmartDashboard.putNumber("Light_Wedge_Down", lsWedgeDown.getAverageVoltage());
  SmartDashboard.putString("Gear_Orientation", getGearOrientation().toString());
  SmartDashboard.putBoolean("Pressure_Plate", isPressurePlatePressed());
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:12,代码来源:GearManipulator.java

示例12: execute

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * Continues looping until isFinished returns true(non-Javadoc)
 * Move using vision until vision lost or at destination
 */
public void execute() {
    SmartDashboard.putString("Mode", "VISION");

    boolean running = visionAutoAlign.autoAlign();
    visionDone = !running;

    System.out.println("Vision Done = " + visionDone);
}
 
开发者ID:Team334,项目名称:R2017,代码行数:13,代码来源:VisionAuton.java

示例13: end

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
protected void end() {
	Robot.driveTrain.setArcadeDriveCommand(0.0, 0.0);
	SmartDashboard.putString("Auton Debugging", "DriveForwardEnd");
	System.out.println("DriveFowardEnd" + DriveEncoders.getAbsoluteValue());

}
 
开发者ID:FRC2832,项目名称:Robot_2017,代码行数:7,代码来源:DriveCorrected.java

示例14: StatefulCommand

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public StatefulCommand(double timeout) {
  super(timeout);
  SmartDashboard.putString(getName() + "_state", "init");
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:5,代码来源:StatefulCommand.java

示例15: execute

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
protected void execute() {
  SmartDashboard.putString(getName() + "_state", getState());
}
 
开发者ID:ligerbots,项目名称:Steamworks2017Robot,代码行数:4,代码来源:StatefulCommand.java


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