微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

edu.wpi.first.wpilibj.smartdashboard.SmartDashboard的实例源码

项目:Spartonics-Code    文件Robot.java   
/**
 * 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();


}
项目:Spartonics-Code    文件Robot.java   
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotinit() {


    chooser = new SendableChooser<Command>();
    chassis = new Chassis();
    intake = new Intake();
    winch = new Winch();
//  shooter = new Shooter();

    oi = new OI();
    imu = new Adis16448_IMU(Adis16448_IMU.Axis.kX);
    pdp = new PowerdistributionPanel();

    chooser.addDefault("Drive Straight",new DriveStraight(73,0.5));
    //chooser.addobject("Left Gear Curve",new LeftGearCurve());
    chooser.addobject("Left Gear Turn",new LeftGearTurn());
    //chooser.addobject("Right Gear Curve",new RightGearCurve());
    chooser.addobject("Right Gear Turn",new RightGearTurn());
    chooser.addobject("Middle Gear",new StraightGear());
    chooser.addobject("Turn in place",new Turndegrees(60,.2));
    SmartDashboard.putData("Autonomous Chooser",chooser);
}
项目:Steamworks2017Robot    文件Vision.java   
@Override
public void sendDataToSmartDashboard() {
  // phone handles vision data for us
  SmartDashboard.putBoolean("LED_On",isLedRingOn());

  boolean gearLiftPhone = false;
  boolean boilerPhone = false;
  ConnectionInfo[] connections = NetworkTablesJNI.getConnections();
  for (ConnectionInfo connInfo : connections) {
    if (System.currentTimeMillis() - connInfo.last_update < 100) {
      if (connInfo.remote_id.equals("Android_GEAR_LIFT")) {
        gearLiftPhone = true;
      } else if (connInfo.remote_id.equals("Android_BOILER")) {
        boilerPhone = true;
      }
    }
  }

  SmartDashboard.putBoolean("VisionGearLift",gearLiftPhone);
  SmartDashboard.putBoolean("VisionGearLift_data",isGearVisionDataValid());
  SmartDashboard.putBoolean("VisionBoiler",boilerPhone);
  SmartDashboard.putBoolean("VisionBoiler_data",isBoilerVisionDataValid());
}
项目:STEAMworks    文件DriveTrain.java   
@Override
public void log() {
    SmartDashboard.putNumber("DriveTrain: distance",getdistance());
    SmartDashboard.putNumber("DriveTrain: left distance",leftEncoder.getdistance());
    SmartDashboard.putNumber("DriveTrain: left veLocity",leftEncoder.getRate());
    SmartDashboard.putNumber("DriveTrain: right distance",rightEncoder.getdistance());
    SmartDashboard.putNumber("DriveTrain: right veLocity",rightEncoder.getRate());
    SmartDashboard.putNumber("DriveTrain: front right current",frontRight.getoutputCurrent());
    SmartDashboard.putNumber("DriveTrain: front right current pdp",Robot.pdp.getCurrent(12));
    SmartDashboard.putNumber("DriveTrain: front left  current",frontLeft.getoutputCurrent());
    SmartDashboard.putNumber("DriveTrain: front left  current pdp",Robot.pdp.getCurrent(10));
    SmartDashboard.putNumber("DriveTrain: back  right current",backRight.getoutputCurrent());
    SmartDashboard.putNumber("DriveTrain: back  right current pdp",Robot.pdp.getCurrent(13));
    SmartDashboard.putNumber("DriveTrain: back  left  current",backLeft.getoutputCurrent());
    SmartDashboard.putNumber("DriveTrain: back  left  current pdp",Robot.pdp.getCurrent(11));
}
项目:Steamworks2017Robot    文件Shooter.java   
/**
 * Sends shooter data to smart dashboard.
 */
public void sendDataToSmartDashboard() {
  if (RobotMap.IS_ROADKILL) {
    return;
  }
  SmartDashboard.putNumber("Shooter_Master_Talon_Power",shooterMaster.getoutputCurrent() * shooterMaster.getoutputVoltage());
  SmartDashboard.putNumber("Shooter_Slave_Talon_Power",shooterSlave.getoutputCurrent() * shooterSlave.getoutputVoltage());
  SmartDashboard.putNumber("Shooter_RPM_Requested",requestedRpm);
  SmartDashboard.putNumber("Shooter_RPM_Real",getShooterRpm());
  SmartDashboard.putNumber("Shooter_PID_error",shooterMaster.getClosedLoopError());

  SmartDashboard.putBoolean("Shooter_Fault",shooterFault);
  SmartDashboard.putBoolean("Shooter_Master_Ok",shooterMaster.getFaultHardwareFailure() == 0);
  SmartDashboard.putBoolean("Shooter_Master_Temp_Ok",shooterMaster.getStickyFaultOverTemp() == 0);
  SmartDashboard.putBoolean("Shooter_Slave_Ok",shooterSlave.getFaultHardwareFailure() == 0);
  SmartDashboard.putBoolean("Shooter_Slave_Temp_Ok",shooterSlave.getStickyFaultOverTemp() == 0);

  SmartDashboard.putBoolean("Shooter_Master_Present",shooterMaster.isAlive());
  SmartDashboard.putBoolean("Shooter_Slave_Present",shooterSlave.isAlive());
}
项目:Robot_2017    文件AutonaimGear.java   
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");

 }
项目:Steamworks2017Robot    文件DriveTrain.java   
/**
 * Shifts the gearBoxes up or down.
 * 
 * @param shiftType whether to shift up or down
 */
public void shift(ShiftType shiftType) {
  logger.info(String.format("Shifting,type=%s,shifter state=%s",shiftType.toString(),shiftingSolenoid.get().toString()));
  if (pcmPresent) {
    if (shiftType == ShiftType.TOGGLE) {
      if (shiftingSolenoid.get() == DoubleSolenoid.Value.kReverse) {
        shiftingSolenoid.set(DoubleSolenoid.Value.kForward);
        SmartDashboard.putBoolean("Drive_Shift",true);
      } else {
        shiftingSolenoid.set(DoubleSolenoid.Value.kReverse);
        SmartDashboard.putBoolean("Drive_Shift",false);
      }
    } else if (shiftType == ShiftType.UP) {
      shiftingSolenoid.set(DoubleSolenoid.Value.kForward);
      SmartDashboard.putBoolean("Drive_Shift",true);
    } else {
      shiftingSolenoid.set(DoubleSolenoid.Value.kReverse);
      SmartDashboard.putBoolean("Drive_Shift",false);
    }
  }
}
项目:Robot_2017    文件Robot.java   
public void robotPeriodic() {
    SmartDashboard.putNumber("Pixy X value",pixyValue  );
    //SmartDashboard.putBoolean("IsIngesting",isIngesting);

    SmartDashboard.putNumber("Right Encoder",DriveEncoders.getRawRightValue());
    SmartDashboard.putNumber("Left Encoder",DriveEncoders.getRawLeftValue());
    SmartDashboard.putNumber("Encoder Differences",DriveEncoders.getRawEncDifference());

    SmartDashboard.putNumber("Accelerometer",NavX.ahrs.getWorldLinearaccelY());
    SmartDashboard.putBoolean("IMU_TP_Connected",NavX.ahrs.isConnected());
    SmartDashboard.putNumber("IMU_Yaw",NavX.ahrs.getYaw());

    SmartDashboard.putNumber("Left Encoder Value: ",RobotMap.driveTrainLeftFront.getEncPosition());
    SmartDashboard.putNumber("Right Encoder Value: ",RobotMap.driveTrainRightFront.getEncPosition());
    //SmartDashboard.putNumber("Compressor",RobotMap.compressor.getCompressorCurrent());   
    SmartDashboard.putNumber("Left Trigger: ",Robot.lTrigger);
    SmartDashboard.putNumber("Right Trigger: ",Robot.rTrigger);
    //SmartDashboard.putBoolean("Door Status",doorsOpen);
    SmartDashboard.putNumber("camera",Robot.camera);

}
项目:StormRobotics2017    文件Turn.java   
protected void execute() {
    System.err.println("Execute turn");
    Robot.driveTrain.tankDrive(-_leftSpeed,_rightSpeed);//negative sign for turning
    SmartDashboard.putNumber("distance traveled",Math.max(Robot.driveTrain.getLeftdistance(),Robot.driveTrain.getRightdistance()));
    SmartDashboard.putNumber("distance",_distanceL);

    // theoretically,this should print out current veLocity of both wheels
    SmartDashboard.putNumber("LeftEncVeLocity",Robot.driveTrain.getLeftSpeedEnc());
    SmartDashboard.putNumber("RightEncVeLocity",Robot.driveTrain.getRightSpeedEnc());

    SmartDashboard.putNumber("LeftSpeed",Robot.driveTrain.getLeftSpeed());
    SmartDashboard.putNumber("RightSpeed",Robot.driveTrain.getRightSpeed());       

    if (Math.abs(Robot.driveTrain.getLeftdistance()) >= Math.abs(_distanceL)) {
        System.err.println("Done left!");
        _leftSpeed = 0;
    }
    if (Math.abs(Robot.driveTrain.getRightdistance()) >= Math.abs(_distanceR)) {
        System.err.println("Done right!");
        _rightSpeed = 0;
    }

}
项目:BBLIB    文件bbShuffle.java   
public static bbShuffle getInstance()
{
    if (bs == null)
    {
        bs = new bbShuffle();
        if(bs == null)
        {
            SmartDashboard.putBoolean("BS Exists?",false);
            System.out.println("bbShuffle can't make itself. Fix it pls");
            return null;
        }
        SmartDashboard.putBoolean("BS Exists?",true);
        System.out.println("bbShuffle created itself");
        return bs;
    }
    SmartDashboard.putBoolean("BS Exists?",true);
    return bs;
}
项目:SteamWorks    文件OI.java   
public OI() {
    // BEGIN AUTOGENERATED CODE,SOURCE=ROBOTBUILDER ID=CONSTRUCTORS

    logitech = new Joystick(0);

    shooterbutton = new JoystickButton(logitech,1);
    shooterbutton.whileHeld(new shoot());


    // SmartDashboard Buttons
    SmartDashboard.putData("Autonomous Command",new AutonomousCommand());
    SmartDashboard.putData("shoot",new shoot());

// END AUTOGENERATED CODE,SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    shootBackwardsButton = new JoystickButton(logitech,2);
    shootBackwardsButton.whileHeld(new ShootReverse());

    LiftUPButton = new JoystickButton(logitech,3);
    LiftReservseButton = new JoystickButton(logitech,4);

    LiftUPButton.whileHeld(new LiftUP());
    LiftReservseButton.whileHeld(new LiftReverse());
}
项目:Practice_Robot_Code    文件OI.java   
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
}
项目:R2017    文件Robot.java   
@Override
public void teleopInit() {
    VisionData.getNt().putBoolean("running",false);

    bumper.setTeam();

    gyroPID.resetGyro();

    // Zeroes joysticks at the beginning
    stickCalLeft = controls.getLeftDrive();
    stickCalRight = controls.getRightDrive();

    // Test component speeds with SmartDashboard
    SmartDashboard.putNumber("Shooter Speed",shooterSpeed);
    SmartDashboard.putNumber("Indexer Speed",indexerSpeed);
    SmartDashboard.putNumber("Intake Speed",intakeSpeed);
}
项目:Steamworks2017Robot    文件Robot.java   
@Override
public void robotPeriodic() {
  try {
    // measure total cycle time,time we take during robotPeriodic,and WPIlib overhead
    final long start = System.nanoTime();
    logger.trace("robotPeriodic()");
    Scheduler.getInstance().run();

    long currentNanos = System.nanoTime();

    if (currentNanos - nanosAtLastUpdate > RobotMap.SMARTDASHBOARD_UPDATE_RATE * 1000000000) {
      allSubsystems.forEach(this::tryToSendDataToSmartDashboard);
      nanosAtLastUpdate = currentNanos;
    }

    SmartDashboard.putNumber("cycleMillis",(currentNanos - prevNanos) / 1000000.0);
    SmartDashboard.putNumber("ourTime",(currentNanos - start) / 1000000.0);
    prevNanos = currentNanos;
  } catch (Throwable ex) {
    logger.error("robotPeriodic error",ex);
    ex.printstacktrace();
  }
}
项目:Spartonics-Code    文件Robot.java   
public void publishToSmartDashboard(){
    chassis.publishToSmartDashboard();
    winch.publishToSmartDashboard();
    //shooter.publishToSmartDashboard();
    intake.publishToSmartDashboard();
    SmartDashboard.putNumber("Robot Angle",imu.getAngleX()/4);
    imu.updateTable();

}
项目:Spartonics-Code    文件Robot.java   
public void disabledPeriodic() {
    Scheduler.getInstance().run();

    SmartDashboard.putString("Selected Auto",chooser.getSelected().getName());
    publishToSmartDashboard();
    //SmartDashboard.putString("Selected Autonomous",chooser.getSelected().getName());

}
项目:BBLIB    文件bbShuffle.java   
public static void stri(String label,String data,boolean log)
{
    SmartDashboard.putString(label,data);
    if(log)
    {
        BulldogLogger.getInstance().log(label,data);
    }
}
项目:Steamworks2017Robot    文件Feeder.java   
/**
 * Sends diagnostics to SmartDashboard.
 */
public void sendDataToSmartDashboard() {
  SmartDashboard.putBoolean("Feeder_Present",FeederTalon != null && FeederTalon.isAlive());
  if (FeederTalon != null) {
    SmartDashboard.putNumber("Feeder_Power",FeederTalon.getoutputCurrent() * FeederTalon.getoutputVoltage());

    SmartDashboard.putBoolean("Feeder_Ok",FeederTalon.getFaultHardwareFailure() == 0);
    SmartDashboard.putBoolean("Feeder_Temp_Ok",FeederTalon.getStickyFaultOverTemp() == 0);
  }
}
项目:2017-emmet    文件Robot.java   
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
// @Override
public void robotinit() {

    System.out.println("1");

    RobotMap.init();

    drivetrain = new Drivetrain();
    climber = new climber();
    // fuel = new Fuel();
    gear = new Gear();

    oi = new OI();

    // initializes camera server
    server = CameraServer.getInstance();
    cameraInit();

    // initializes auto chooser
    autochooser = new SendableChooser();
    autochooser.addDefault("Middle Hook",new AutoMiddleHook());
    autochooser.addobject("Loading Station Hook",new AutoLeftHook());
    autochooser.addobject("Boiler Side Hook",new AutoRightHook());
    SmartDashboard.putData("Auto mode",autochooser);
    // auto delay
    SmartDashboard.putNumber("Auto delay",0);

    // resets all sensors
    resetAllSensors();
}
项目:FRC6414program    文件Shooter.java   
public Shooter() {
    super();
    System.out.println("shooter sub system init");
    threadInit(() -> {
        SmartDashboard.putNumber("shooter l speed:",leftShooter.get());
        SmartDashboard.putNumber("shooter r speed:",rightShooter.get());
        SmartDashboard.putNumber("shooter set @",((-Robot.oi.getThrottle() + 1) / 2) * 0.7 + 0.3);
    });
}
项目:steamworks-java    文件DrivetoPeg.java   
public DrivetoPeg(){        
    double distance = .2;

    requires(Robot.driveBase);
    double kP = -.4;
    double kI = 1;
    double kD = 5;

    pid = new PIDController(kP,kI,kD,new PIDSource() {
        PIDSourceType m_sourceType = PIDSourceType.kdisplacement;

        @Override
        public double pidGet() {
            return Robot.driveBase.getdistanceAhead();
        }

        @Override
        public void setPIDSourceType(PIDSourceType pidSource) {
            m_sourceType = pidSource;
        }

        @Override
        public PIDSourceType getPIDSourceType() {
            return m_sourceType;
        }
    },new PIDOutput() {
        @Override
        public void pidWrite(double d) {
            Robot.driveBase.driveForward(d);
            System.out.println(d);
        }
    });
    pid.setAbsolutetolerance(0.01);
    pid.setSetpoint(distance);
    pid.setoutputRange(0,.35);

    SmartDashboard.putData("drivetoPeg",pid);
}
项目:FRC6414program    文件USensor.java   
public USensor() {
    leftpulse = new DigitalOutput(RobotMap.LEFT_pulse);
    left = new Counter(RobotMap.LEFT_ECHO);
    left.setMaxPeriod(1);
    left.setSemiPeriodMode(true);
    left.reset();

    rightpulse = new DigitalOutput(RobotMap.RIGHT_pulse);
    right = new Counter(RobotMap.RIGHT_ECHO);
    right.setMaxPeriod(1);
    right.setSemiPeriodMode(true);
    right.reset();

    threadInit(() -> {
        leftpulse.pulse(RobotMap.US_pulse);
        rightpulse.pulse(RobotMap.US_pulse);

        do {
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                e.printstacktrace();
            }
        } while (left.get() < 2 || right.get() < 2);

        leftdistant = left.getPeriod() * 0.5 * RobotMap.SPEED_OF_SOUND;
        rightdistant = right.getPeriod() * 0.5 * RobotMap.SPEED_OF_SOUND;

        SmartDashboard.putNumber("left dis",leftdistant);
        SmartDashboard.putNumber("right dis",rightdistant);

        left.reset();
        right.reset();
    });
}
项目:KrunchieBot    文件Robot.java   
/**
 * 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",chooser);
}
项目:frc-2017    文件Robot.java   
/**
 * 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();
}
项目:CMonster2017    文件Robot.java   
/**
 * This function is called periodically during test mode
 */
public void testPeriodic() {
    LiveWindow.run();
    Robot.driveBase.EnableDriveBase();
    Robot.driveBase.DriveAutonomous();
    SmartDashboard.putNumber("AV distance",RobotMap.Averagedistance);
}
项目:R2017    文件VisionAutoAlign.java   
/**
     * 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;
    }
项目:Steamworks2017Robot    文件PdpSubsystem.java   
@Override
public void sendDataToSmartDashboard() {
  if (pdp != null) {
    SmartDashboard.putNumber("Temperature",pdp.getTemperature());
    //SmartDashboard.putNumber("TotalPower",pdp.getTotalPower());

    // in the past,this has tended to screw up the CAN bus
    // for (int i = 0; i < 16; i++) {
    // SmartDashboard.putNumber("Current_" + i,pdp.getCurrent(i));
    // }
  }
}
项目:FirsTSteamworks2017    文件Robot.java   
public void robotPeriodic(){
    lights.set(1);
    SmartDashboard.putBoolean("Pressurized",!compressor.getPressureSwitchValue());
    SmartDashboard.putBoolean("PressureCharging",compressor.enabled());
    SmartDashboard.putBoolean("PressureControlled",compressor.getClosedLoopControl());
    SmartDashboard.putNumber("PressureCurrent",compressor.getCompressorCurrent());
}
项目:FRC-2017-Command    文件ResetWinch.java   
/**
 * Stop rotating the winch
 */
@Override
protected void end() {
    Robot.winch.off();
    logger.info("Winch reset");
    SmartDashboard.putBoolean("Winch Ready",true);

}
项目:VikingRobot    文件Shoot.java   
@Override
protected void execute() {
    double targetSpeed = .5* 1500;
    Robot.shooter.setSetpoint(targetSpeed);
    SmartDashboard.putNumber("Setpoint Set",targetSpeed);
    Robot.shooter.agitate();


}
项目:2017-Steamworks    文件DrivedistanceAccelY.java   
protected void initialize() {
    // Reset for delta displacement
    Robot.driveTrain.resetAccel();

    Robot.driveTrain.enableAccelPIDY();
    Robot.driveTrain.setTargetdistanceY(SmartDashboard.getNumber("distanceDeltaY",0));
}
项目:STEAMworks    文件VisionTest.java   
@Override
public void log() {
    double cx = centerX;
    SmartDashboard.putNumber("Vision: Center Value",cx);
    SmartDashboard.putNumber("Vision: Target distance",targetdistance);
    SmartDashboard.putNumber("Vision: Target Azimuth",targetAzimuth);
    SmartDashboard.putNumber("Vision: Target X Offset",targetoffsetX);
    SmartDashboard.putBoolean("Vision: Target Detected",targetDetected);
}
项目:2017-Steamworks    文件DrivedistanceAccelX.java   
protected void initialize() {
    // Reset for delta displacement
    Robot.driveTrain.resetAccel();

    Robot.driveTrain.enableAccelPIDX();
    Robot.driveTrain.setTargetdistanceX(SmartDashboard.getNumber("distanceDeltaX",0));
}
项目:R2017    文件GyroPID.java   
public GyroPID() {
    gyroSource = new GyroSource();
    defaultOutput = new DefaultOutput();

    gyroPID = new PIDController(Constants.GYRO_P,Constants.GYRO_I,Constants.GYRO_D,gyroSource,defaultOutput);
    gyroPID.setContinuous();
    gyroPID.setoutputRange(-Constants.GYRO_CAP,Constants.GYRO_CAP);
    gyroPID.enable();

    SmartDashboard.putData("GryoPID",gyroPID);
}
项目:El-Jefe-2017    文件ClawSet.java   
protected void execute(){
    if(raise && !ignoreUp){
        clawLift.clawRaise(1);
    }
    else if(!raise && !ignoreDown){
        clawLift.clawRaise(-1);
    }
    SmartDashboard.putBoolean("raise",raise);
    SmartDashboard.putBoolean("ignoreUp",ignoreUp);
    SmartDashboard.putBoolean("ignoreDown",ignoreDown);
    SmartDashboard.putBoolean("up",clawLift.getLimitTop());
    SmartDashboard.putBoolean("down",clawLift.getLimitBottom());
}
项目:2017    文件SmartDashboardPIDTunerDevice.java   
public void update ()
{
    double P = SmartDashboard.getNumber("DB/Slider 0",0.0);
    double I = SmartDashboard.getNumber("DB/Slider 1",0.0);
    double D = SmartDashboard.getNumber("DB/Slider 2",0.0);
    double setPoint = SmartDashboard.getNumber("DB/Slider 3",0.0);
    this.tuner.setP(P);
    this.tuner.setI(I);
    this.tuner.setD(D);
    this.tuner.setSetpoint(setPoint);
}
项目:Steamworks2017Robot    文件GearManipulator.java   
/**
 * 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());
}
项目:FRC-5800-Stronghold    文件CommandReadSensors.java   
protected void execute() {      
    //Put any code here needed to handle readings from sensors.
    SmartDashboard.putNumber("Gyro",sensors.gyro.getAngle());

    SmartDashboard.putNumber("Drive Encoder L",sensors.driveEncoderL.get());
    SmartDashboard.putNumber("Drive Encoder R",sensors.driveEncoderR.get());
}
项目:2017-Steamworks    文件RotatetoAngle.java   
protected void initialize() {
    Robot.driveTrain.enableGyroPID();
    // Angle from SmartDash,default is the robots current angle
    double targetAngle = SmartDashboard.getNumber("targetAngle",Robot.driveTrain.getCurrentBoundedAngle());
    System.out.println(targetAngle);
    Robot.driveTrain.setTargetAngle(targetAngle);
}
项目:DriveStraightBot    文件Drivetrain.java   
public void startDrivingStraight(double speed) {
    controller.setPID(
            SmartDashboard.getNumber("kP",0.0),SmartDashboard.getNumber("kI",SmartDashboard.getNumber("kD",0.0)
            );
    autoMoveSpeed = speed;
    if (!controller.isEnabled()) {
        gyro.reset();
        controller.reset();
        controller.enable();
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。