本文整理汇总了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");
}
示例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));
}
}
示例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());
}
示例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");
}
}
示例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());
}
示例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();
}
示例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;
}
示例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();
}
示例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());
}
示例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);
}
}
示例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());
}
示例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);
}
示例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());
}
示例14: StatefulCommand
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public StatefulCommand(double timeout) {
super(timeout);
SmartDashboard.putString(getName() + "_state", "init");
}
示例15: execute
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
protected void execute() {
SmartDashboard.putString(getName() + "_state", getState());
}