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

edu.wpi.first.wpilibj.PowerDistributionPanel的实例源码

项目: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);
}
项目:2017-emmet    文件RobotMap.java   
public static void init() {
    driveTrainCIMRearLeft = new CANTalon(2); // rear left motor
    driveTrainCIMFrontLeft = new CANTalon(12); // 
    driveTrainCIMRearRight = new CANTalon(1);
    driveTrainCIMFrontRight = new CANTalon(11);
    driveTrainRobotDrive41 = new RobotDrive(driveTrainCIMRearLeft,driveTrainCIMFrontLeft,driveTrainCIMRearRight,driveTrainCIMFrontRight);
    climberclimber = new CANTalon(3);
    c1 = new Talon(5);
    pDPPowerdistributionPanel1 = new PowerdistributionPanel(0);
    gyro = new ADXRS450_Gyro(Port.kOnboardCS0);
    c2 = new Talon(6);
    ultra = new AnalogInput(0);

    LiveWindow.addSensor("PDP","PowerdistributionPanel 1",pDPPowerdistributionPanel1);
    LiveWindow.addSensor("Ultra","Ultra",ultra);
   //  LiveWindow.addActuator("Intake","Intake",intakeIntake);
    LiveWindow.addActuator("climber","climber",climberclimber);
    LiveWindow.addActuator("RearLeft (2)","Drivetrain",driveTrainCIMRearLeft);
    LiveWindow.addActuator("FrontLeft (12)",driveTrainCIMFrontLeft);
    LiveWindow.addActuator("RearRight (1)",driveTrainCIMRearRight);
    LiveWindow.addActuator("FrontRight (11)",driveTrainCIMFrontRight);
    LiveWindow.addActuator("Drive Train","Gyro",gyro);
    // LiveWindow.addActuator("Shooter","Shooter",shooter1);
}
项目:MinuteMan    文件HardwareAdaptor.java   
private HardwareAdaptor(){
    pdp = new PowerdistributionPanel();
    comp = new Compressor();
    shifter = new DoubleSolenoid(SolenoidMap.SHIFTER_FORWARD,SolenoidMap.SHIFTER_REVERSE);

    navx = new AHRS(coprocessorMap.NAVX_PORT);

    dtLeftEncoder = new Encoder(EncoderMap.DT_LEFT_A,EncoderMap.DT_LEFT_B,EncoderMap.DT_LEFT_INVERTED);
    S_DTLeft.linkEncoder(dtLeftEncoder);
    dtRightEncoder = new Encoder(EncoderMap.DT_RIGHT_A,EncoderMap.DT_RIGHT_B,EncoderMap.DT_RIGHT_INVERTED);
    S_DTRight.linkEncoder(dtRightEncoder);

    dtLeft = S_DTLeft.getInstance();
    dtRight = S_DTRight.getInstance();
    S_DTWhole.linkDTSides(dtLeft,dtRight);
    dtWhole = S_DTWhole.getInstance();

    arduino = S_Arduino.getInstance();
}
项目:Cogsworth    文件Robot.java   
@Override
public void robotinit() {
    driveSys = new DriveSubsystem();
    driveSys.initDefaultCommand();

    climberSys = new climberSubsystem();
    climberSys.registerButtons();

    cameras = new Cameras();
    cameras.start();

    piSys = new PISubsystem();
    piSys.initDefaultCommand();

    pdp = new PowerdistributionPanel();

    autochooser = new Autochooser();
    SmartDashboard.putData("Auto Choices",autochooser);
    SmartDashboard.putData("Reclibrate RPi",new RPiCalibration());
    SmartDashboard.putNumber("RPi Target Duty Cycle",VisionRotate.TARGET_DUTY_CYCLE);
}
项目:turtleshell    文件Robot.java   
/**
 * Runs the motors with arcade steering.
 */
@Override
public void operatorControl() {

    PowerdistributionPanel panel = new PowerdistributionPanel();

    while (isOperatorControl() && isEnabled()) {
        talon1.set(-j.getAxis(AxisType.kZ));
        talon2.set(j.getAxis(AxisType.kZ));

        SmartDashboard.putNumber("JoystickValue",j.getAxis(AxisType.kZ));

        SmartDashboard.putNumber("Talon1",talon1.getoutputCurrent());
        SmartDashboard.putNumber("Talon2",talon2.getoutputCurrent());

        SmartDashboard.putNumber("Talon1 PDP",panel.getCurrent(11));
        SmartDashboard.putNumber("Talon2 PDP",panel.getCurrent(4));

        agitator.set(j1.getAxis(AxisType.kZ));
        SmartDashboard.putNumber("Joystick2Value",j1.getAxis(AxisType.kZ));
    }
}
项目:2015RobotCode    文件Robot.java   
public Robot() {    // initialize variables in constructor
    stick = new Joystick(RobotMap.JOYSTICK_PORT); // set the stick to refer to joystick #0
    button = new JoystickButton(stick,RobotMap.BTN_TRIGGER);

    myRobot = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR,RobotMap.REAR_LEFT_MOTOR,RobotMap.FRONT_RIGHT_MOTOR,RobotMap.REAR_RIGHT_MOTOR);
    myRobot.setExpiration(RobotDrive.kDefaultExpirationTime);  // set expiration time for motor movement if error occurs

    pdp = new PowerdistributionPanel();  // instantiate class to get PDP values

    compressor = new Compressor(); // Compressor is controlled automatically by PCM

    solenoid = new DoubleSolenoid(RobotMap.soLENOID_PCM_PORT1,RobotMap.soLENOID_PCM_PORT2); // solenoid on PCM port #0 & #1

    /*camera = CameraServer.getInstance();
    camera.setQuality(50);
    camera.setSize(200);*/
    frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB,0);  // create the image frame for cam
    session = NIVision.IMAQdxOpenCamera("cam0",NIVision.IMAQdxcameraControlMode.CameraControlModeController);  // get reference to camera
    NIVision.IMAQdxconfigureGrab(session);  // grab current streaming session
}
项目:2015-frc-robot    文件SensorInput.java   
/**
 * Instantiates the Sensor Input module to read all sensors connected to the roboRIO.
 */
private Sensorinput() { 
    limit_left = new DigitalInput(ChiliConstants.left_limit);
    limit_right = new DigitalInput(ChiliConstants.right_limit);
    accel = new BuiltInAccelerometer(Accelerometer.Range.k2G);
    gyro = new Gyro(ChiliConstants.gyro_channel);
    pdp = new PowerdistributionPanel();
    left_encoder = new Encoder(ChiliConstants.left_encoder_channelA,ChiliConstants.left_encoder_channelB,false);
    right_encoder = new Encoder(ChiliConstants.right_encoder_channelA,ChiliConstants.right_encoder_channelB,true);
    gyro_i2c = new GyroITG3200(I2C.Port.kOnboard);

    gyro_i2c.initialize();
    gyro_i2c.reset();
    gyro.initGyro();

    left_encoder.setdistancePerpulse(ChiliConstants.kdistancePerpulse);
    right_encoder.setdistancePerpulse(ChiliConstants.kdistancePerpulse);
}
项目:2017    文件CANObject.java   
/**
 * Creates Power distribution Board Object
 * 
 * @param newPdp
 *            the CAN Power distribution Board associated with this object
 * @param newCanId
 *            the ID of the CAN object
 */
public CANObject (final PowerdistributionPanel newPdp,int newCanId)
{
    pdp = newPdp;
    canId = newCanId;
    typeId = 4;

    // if(useDebug == true)
    // {
    // System.out.println("The pdp is " + talon);
    // System.out.println("The canId of the CANJaguar is " + canId);
    // System.out.println("The type Id of the CANJaguar is " + typeId);
    // }
}
项目:2017    文件CANObject.java   
/**
 * // * Checks if the CAN Device is the Power distribution Panel
 * // *
 * 
 * @return Returns Power distribution Panel if the type ID is 3,if not returns
 *         null
 */
public PowerdistributionPanel getPDP ()
{
    if (typeId == 4)
        {
        return pdp;
        }
    return null;
}
项目:FlashLib    文件PDP.java   
/**
 * Initializes the wrapper for a PDP at the given module.
 * @param module the module
 */
public PDP(int module){
    super("PDP"+module,FlashboardSendableType.PDP);
    pdp = new PowerdistributionPanel(module);

    voltage = pdp.getVoltage();
}
项目:snobot-2017    文件Snobot.java   
/**
 * This function is run when the robot is first started up and should be
 * used for any initialization code.
 */
public void robotinit()
{
    // PWM's
    mTestMotor1 = new Talon(0);
    mTestMotor2 = new Jaguar(1);
    mServo = new Servo(2);

    // Digital IO
    mDigitalOutput = new DigitalOutput(0);
    mRightEncoder = new Encoder(4,5);
    mLeftEncoder = new Encoder(1,2);
    mUltrasonic = new Ultrasonic(7,6);

    // Analog IO
    mAnalogGryo = new AnalogGyro(0);
    mPotentiometer = new AnalogPotentiometer(1);

    // Solenoid
    mSolenoid = new Solenoid(0);

    // Relay
    mRelay = new Relay(0);

    // Joysticks
    mJoystick1 = new Joystick(0);
    mJoystick2 = new XBoxController(1);

    // SPI
    mSpiGryo = new ADXRS450_Gyro();

    // Utilities
    mTimer = new Timer();
    mPDP = new PowerdistributionPanel();

    Preferences.getInstance().putDouble("Motor One Speed",.5);
}
项目:Stronghold2016-340    文件HarvesterRollers.java   
public HarvesterRollers() {
        shooterWheelA = new CANTalon(RobotMap.HARVESTER_SHOOTER_WHEEL_A);//Construct shooter A as CANTalon,this should have encoder into it
        shooterWheelB = new CANTalon(RobotMap.HARVESTER_SHOOTER_WHEEL_B);//Construct shooter B as CANTalon
//      shooterWheelB.changeControlMode(CANTalon.TalonControlMode.Follower);//turn shooter motor B to a slave
//      shooterWheelB.set(shooterWheelA.get());//slave shooter motor B to shooter motor A

        harvesterBallControl = new CANTalon(RobotMap.HARVESTER_BALL_CONTROL);

        ballSensorLeft = new DigitalInput(RobotMap.BALL_SENSOR_LEFT);
        ballSensorRight = new DigitalInput(RobotMap.BALL_SENSOR_RIGHT);
        pdp = new PowerdistributionPanel();
    }
项目:FRC2017    文件VoltageCompensatedShooter.java   
public VoltageCompensatedShooter(CANTalon shooter,double voltageLevelToMaintain)
{
    m_shooter = shooter;
    m_panel = new PowerdistributionPanel();
    m_voltageLevelToMaintain = voltageLevelToMaintain;
    turnOff();
}
项目:Robot2015    文件PowerSubsystem.java   
/**
 * Get the current on any channel on the Power distribution Panel.  
 * @param channel - the channel number on the Power distribution Panel.  
 * @return double - the current on the channel or 0 if the channel number is invalid.
 */
public double getCurrent(int channel) {

    if (channel >= 0 && channel < PowerdistributionPanel.kPDPChannels) {
        return powerdistributionPanel.getCurrent(channel);
    }

    System.out.println("Invalid channel number (" + channel + ") requested for PowerSubsystem.getCurrent()");
    return 0;
}
项目:turtleshell    文件Robot.java   
private void setupSensors() {
    navX = new TurtleNavX(I2C.Port.kOnboard);
    try {
        lidar = new LIDARLite(I2C.Port.kMXP);
        // new LIDARSerial(SerialPort.Port.kUSB1);
    } catch (Exception e) {
        e.printstacktrace();
        lidar = new TurtleFakedistanceEncoder();
    }

    pdp = new PowerdistributionPanel();
}
项目:turtleshell    文件PDP.java   
public PDP() {
    try {
        powerdistributionPanel = new PowerdistributionPanel();
    } catch (Exception e) {
        powerdistributionPanel = null;
    }
}
项目:turtleshell    文件PDP.java   
public PDP(int module) {
    try {
        powerdistributionPanel = new PowerdistributionPanel(module);
    } catch (Exception e) {
        powerdistributionPanel = null;
    }
}
项目:2015RobotCode    文件Robot.java   
/**
   * This function is run when the robot is first started up and should be
   * used for any initialization code.
   */
  public void robotinit() {

    // initialize all subsystems and important classes
oi = new OI();
//autoSys = new AutonomousSys();
driveSys = new DrivingSys();

      // instantiate the command used for the autonomous period
      //autonomousCommand = new AutonomousCmd();

      // instantiate cmd used for teleop period
      arcadeDriveCmd = new ArcadeDriveJoystick();

      // Show what cmd the susbsystem is running on SmartDashboard
      SmartDashboard.putData(driveSys);

      // Initialize Power distribution Panel
      pdp = new PowerdistributionPanel();

      // Compressor is controlled automatically by PCM
      compressor = new Compressor();

      solenoid = new DoubleSolenoid(0,1);
      solenoid.set(DoubleSolenoid.Value.kReverse);

      /*camera = CameraServer.getInstance();
      camera.setQuality(50);
      camera.startAutomaticCapture("cam0");*/

  }
项目:CMonster2015    文件Robot.java   
/**
 * Called when the robot is first started up and should be used for any
 * initialization code.
 */
@Override
public void robotinit() {
    // Initialize the robot map
    RobotMap.init();
    // BEGIN AUTOGENERATED CODE,SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveSubsystem = new DriveSubsystem();
    toteLifterSubsystem = new ToteLifterSubsystem();
    containerHookSubsystem = new ContainerHookSubsystem();

    // END AUTOGENERATED CODE,SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    oi = new OI();
    pdp = new PowerdistributionPanel();

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

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

    // Start sending data to SmartDashboard
    loggingCommand = new LoggingCommand();
    loggingCommand.start();

    // Add autonomous modes to the chooser
    autonomousChooser.addDefault("Grab RC and drive to auto zone",new ContainerAutoZoneAutonomousCommand());
    autonomousChooser.addobject("Grab RC and drive to left Feeder",new ContainerFeederStationAutonomousCommand(true));
    autonomousChooser.addobject("Grab RC and drive to right Feeder",new ContainerFeederStationAutonomousCommand(false));
    autonomousChooser.addobject("Grab RC",new ContainerAutonomousCommand());
    autonomousChooser.addobject("Do nothing",null);
    SmartDashboard.putData("Autonomous Mode",autonomousChooser);
}
项目:2017-Robot    文件Robot.java   
@Override
public void robotinit() {

        chooser = new SendableChooser<Integer>();
        chooser.addDefault("center red",1);
        chooser.addobject("center blue",2);
        chooser.addobject("boiler red",3);
        chooser.addobject("boiler blue",4);
        chooser.addobject("ret red",5);
        chooser.addobject("ret blue",6);
        chooser.addobject("current test",7);

        SmartDashboard.putData("Auto choices",chooser);

        //NETWORK TABLE VARIABLES
        table = NetworkTable.getTable("dataTable");

        //POWER disT PANEL
        pdp = new PowerdistributionPanel();

        //NAVX
        navx = new AHRS(SPI.Port.kMXP);

        // CONTROLLER
        jsLeft = new Joystick(0);
        jsRight = new Joystick(1);
        xBox = new XBoxController(5);

        // MOTORS
        leftFront = new Talon(pwm5);
        leftMid = new Talon(pwm3);
        leftBack = new Talon(pwm1);
        rightFront = new Talon(pwm4);
        rightMid = new Talon(pwm2);
        rightBack = new Talon(pwm0);

        // ENCODERS
        encLeftDrive = new Encoder(0,1);
        encRightDrive = new Encoder(2,3);

        // COMPRESSOR
        compressor = new Compressor();
        compressor.start();

        //SOLENOIDs
        driveChain = new DoubleSolenoid(0,1);
        driveChain.set(Value.kReverse);
        presser = new DoubleSolenoid(2,3);
        presser.set(Value.kReverse);
        gearpiston = new DoubleSolenoid(4,5);
        gearpiston.set(Value.kReverse);


        //CANTALONS
        climber = new CANTalon(2);
        shooter = new CANTalon(4);
        intake = new CANTalon(9);
        Feeder = new CANTalon(13);

        // CAMERA
        //DON'T DELETE THE COMMENTED THREAD-IT IS USED FOR CALIBRATION
        /*
        UsbCamera usbCam = new UsbCamera("mscam",0);
        usbCam.setVideoMode(VideoMode.PixelFormat.kMJPEG,160,120,20);
        MjpegServer server1 = new MjpegServer("cam1",1181);
        server1.setSource(usbCam);
        */

        UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();
        camera.setVideoMode(VideoMode.PixelFormat.kMJPEG,20);

        //SMARTDASBOARD
        driveSetting = "LOW START";
        gearSetting = "GEAR CLOSE START";
}
项目:Steamworks2017Robot    文件PdpSubsystem.java   
/**
 * Creates the PdpSubsystem.
 */
public PdpSubsystem() {
  if (Robot.deviceFinder.isPdpAvailable()) {
    pdp = new PowerdistributionPanel();
  }
}
项目:2017-emmet    文件RobotMap.java   
public static void init() {
    // DRIVETRAIN MOTORS \\
    drivetrainCIMRearLeft = new CANTalon(2);
    drivetrainCIMFrontLeft = new CANTalon(12);
    drivetrainCIMRearRight = new CANTalon(1);
    drivetrainCIMFrontRight = new CANTalon(11);
    LiveWindow.addActuator("Drivetrain","RearLeft(2)",drivetrainCIMRearLeft);
    LiveWindow.addActuator("Drivetrain","FrontLeft(12)",drivetrainCIMFrontLeft);
    LiveWindow.addActuator("Drivetrain","RearRight(1)",drivetrainCIMRearRight);
    LiveWindow.addActuator("Drivetrain","FrontRight(11)",drivetrainCIMFrontRight);

    // DRIVE \\
    drivetrainRobotDrive41 = new RobotDrive(drivetrainCIMRearLeft,drivetrainCIMFrontLeft,drivetrainCIMRearRight,drivetrainCIMFrontRight);

    // DRIVE SENSORS \\
    gyro = new ADXRS450_Gyro(Port.kOnboardCS0);
    // accel = new BuiltInAccelerometer();
    enc = new Encoder(9,8);
    LiveWindow.addSensor("Drive Sensors",gyro);
    // LiveWindow.addSensor("Drive Sensors","Accelerometer",accel);
    LiveWindow.addSensor("Drive Sensors","Encoder",enc);

    // climB \\
    climber = new Talon(5);
    climber2 = new Talon(6);
    LiveWindow.addActuator("climber",climber);
    LiveWindow.addActuator("climber","climber2",climber2);

    // GEAR \\
    claw = new CANTalon(3);
    LiveWindow.addActuator("Gear","Claw",claw);

    // FUEL \\
    // shooter = new Talon(6);
    // LiveWindow.addActuator("Fuel",shooter);

    // DIAGNOSTIC \\
    pdp = new PowerdistributionPanel(0);
    LiveWindow.addSensor("PDP","Power distribution Panel",pdp);

}
项目:2017-emmet    文件RobotMap.java   
public static void init() {
    // DRIVETRAIN MOTORS \\
    drivetrainCIMRearLeft = new CANTalon(2);
    drivetrainCIMFrontLeft = new CANTalon(12);
    drivetrainCIMRearRight = new CANTalon(1);
    drivetrainCIMFrontRight = new CANTalon(11);
    LiveWindow.addActuator("Drivetrain",drivetrainCIMFrontRight);

    // DRIVE SENSORS \\
    gyro = new ADXRS450_Gyro(Port.kOnboardCS0);
    // accel = new BuiltInAccelerometer();
    enc = new Encoder(0,1);
    LiveWindow.addSensor("Drive Sensors",claw);

    // FUEL \\
    shooter = new Talon(6);
    LiveWindow.addActuator("Fuel",pdp);

}
项目:2017TestBench    文件RobotMap.java   
public static void init() {
    // BEGIN AUTOGENERATED CODE,SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    motorsVictor0 = new VictorSP(0);
    LiveWindow.addActuator("Motors","Victor0",(VictorSP) motorsVictor0);

    motorsVictor1 = new VictorSP(1);
    LiveWindow.addActuator("Motors","Victor1",(VictorSP) motorsVictor1);


    LiveWindow.addActuator("Motors","TalonSRX",(CANTalon) motorsCANTalon);

    electricalPowerdistributionPanel1 = new PowerdistributionPanel(0);
    LiveWindow.addSensor("Electrical",electricalPowerdistributionPanel1);

    sensorsAnalogGyro1 = new AnalogGyro(0);
    LiveWindow.addSensor("Sensors","AnalogGyro 1",sensorsAnalogGyro1);
    sensorsAnalogGyro1.setSensitivity(0.007);


    // END AUTOGENERATED CODE,SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
项目:STEAMworks    文件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() {
    // Instantiate subsystems and add to subsystem list (e.g.,for logging to dashboard)
    pdp = new PowerdistributionPanel();
    compressor = new Compressor();
    subsystemsList.add(compressor);
    driveTrain = new DriveTrain();
    subsystemsList.add(driveTrain);
    //visionTest = null;
    visionTest = new Visiontest();
    subsystemsList.add(visionTest);
    gate = new Gate();
    subsystemsList.add(gate);
    flapper = new Flapper();
    subsystemsList.add(flapper);
    ballShifter = new BallShifter();
    subsystemsList.add(ballShifter);
    ballShooter = new BallShooter();
    subsystemsList.add(ballShooter);
    intake = new Intake();
    subsystemsList.add(intake);
    climber = new climber();
    subsystemsList.add(climber);
    ultrasonics = new Doubleultrasonic();
    subsystemsList.add(ultrasonics);
    navx = new NavX();
    subsystemsList.add(navx);

    // Autonomous
    chooser.addobject("AutoDrivetoPeg",new AutoDrivetoPeg(108));
    chooser.addobject("Auto Place Gear Turn Right",new AutoplaceGear(108,60));
    chooser.addobject("Auto Place Gear Straight",0));
    chooser.addobject("Auto Place Gear Turn Left",-60));
    chooser.addobject("Auto Turn using Vision",new AutoTurnByVision(0));
    chooser.addobject("Auto Turn To Peg",new AutoTurnToPeg());
    chooser.addobject("Auto Drive distance",new AutoDrivedistance(108,10000));
    chooser.addDefault("None",new AutoNone());
    SmartDashboard.putData("Auto Mode",chooser);

    // Preferences
    Preferences prefs = Preferences.getInstance();
    boolean driveMode = prefs.getBoolean("Drive Mode",RobotPreferences.DRIVE_MODE_DEFAULT);
    SmartDashboard.putBoolean("Prefs: Drive Mode",driveMode);
    SmartDashboard.putNumber("Prefs: Drive Kp",prefs.getDouble("Drive Kp",RobotPreferences.DRIVE_KP_DEFAULT));
    SmartDashboard.putNumber("Prefs: Drive Ki",prefs.getDouble("Drive Ki",RobotPreferences.DRIVE_KI_DEFAULT));
    SmartDashboard.putNumber("Prefs: Drive Kd",prefs.getDouble("Drive Kd",RobotPreferences.DRIVE_KD_DEFAULT));
    SmartDashboard.putNumber("Prefs: Vision Kp",prefs.getDouble("Vision Kp",RobotPreferences.VISION_KP_DEFAULT));
    SmartDashboard.putNumber("Prefs: Vision Ki",prefs.getDouble("Vision Ki",RobotPreferences.VISION_KI_DEFAULT));
    SmartDashboard.putNumber("Prefs: Vision Kd",prefs.getDouble("Vision Kd",RobotPreferences.VISION_KD_DEFAULT));
    SmartDashboard.putNumber("Prefs: Vision Update Delay",prefs.getLong("Vision Update Delay",RobotPreferences.VISION_UPDATE_DELAY_DEFAULT));
    SmartDashboard.putNumber("Prefs: Turn To Peg Angle",prefs.getDouble("Turn To Peg Angle",RobotPreferences.TURN_TO_PEG_ANGLE_DEFAULT));
    SmartDashboard.putNumber("Prefs: Vision Time Limit",prefs.getDouble("Auto Vision Time Limit",RobotPreferences.VISION_TIME_DEFAULT));

    //Instantiate after all subsystems and preferences - or the world will die
    //We don't want that,do we?
    oi = new OI(driveMode);

    //Todo uncomment to see subsystems on dashboard
    //addSubsystemsToDashboard(subsystemsList);
    ArrayList<LoggableSubsystem> tempList = new ArrayList<LoggableSubsystem>();
    tempList.add(driveTrain);
    addSubsystemsToDashboard(tempList);
}
项目:Frc2017FirstSteamWorks    文件FrcRobotBattery.java   
/**
 * Constructor: Creates an instance of the object.
 *
 * @param module specifies the CAN ID of the PDP.
 */
public FrcRobotBattery(int module)
{
    super();
    pdp = new PowerdistributionPanel(module);
}
项目:scorpion    文件TalonSRX246.java   
public TalonSRX246(final int channel,int pdpPort,PowerdistributionPanel pdp)
{
    super(channel);
    this.pdpPort = pdpPort;
    this.pdp = pdp;
}
项目:scorpion    文件Talon246.java   
public Talon246(final int channel,PowerdistributionPanel pdp)
{
    super(channel);
    this.pdpPort = pdpPort;
    this.pdp = pdp;
}
项目:scorpion    文件Victor246.java   
public Victor246(final int channel,PowerdistributionPanel pdp)
{
    super(channel);
    this.pdpPort = pdpPort;
    this.pdp = pdp;
}
项目:scorpion    文件ArmMotor.java   
public ArmMotor(int channel,PowerdistributionPanel pdp,ArmJoint joint)
{
    super(channel,pdpPort,pdp);
    this.joint = joint;
}
项目:scorpion    文件Jaguar246.java   
public Jaguar246(final int channel,PowerdistributionPanel pdp)
{
    super(channel);
    this.pdpPort = pdpPort;
    this.pdp = pdp;
}
项目:scorpion    文件VictorSP246.java   
public VictorSP246(final int channel,PowerdistributionPanel pdp)
{
    super(channel);
    this.pdpPort = pdpPort;
    this.pdp = pdp;
}
项目:2015-FRC-robot    文件Robot.java   
public Robot() {
    motorLeft = new Talon(1);
    motorRight = new Talon(2);

    motorCenter = new Talon(0);

    motorLift = new Talon(4);
    motorArm = new Talon(3);

    pistonArmTilt1 = new DoubleSolenoid(1,0);
    pistonArmTilt2 = new DoubleSolenoid(2,3);
    pistonLiftWidth = new DoubleSolenoid(4,5);
    pistonCenterSuspension = new Solenoid(6);

    analogLift = new AnalogInput(0);

    digitalInLiftTop = new DigitalInput(0);
    digitalInLiftBottom = new DigitalInput(1);

    digitalInArmUp = new DigitalInput(3);
    digitalInArmDown = new DigitalInput(2);
    //schuyler 480 526 1606

    pdp = new PowerdistributionPanel();

    frontdistanceSensor = new AnalogInput(1);

    //sonicVex = new Ultrasonic(5,6);
    //sonicVex.setAutomaticMode(true);

    /*
     * PIDControllerLift = new PIDController(0,analogLift,* motorLift); PIDControllerLift.setInputRange(0,1);
     * PIDControllerLift.setoutputRange(0,.5); PIDControllerLift.disable();
     */

    stickLeft = new Joystick(0);
    stickRight = new Joystick(1);
    stickAux = new Joystick(2);

    stickAuxLastButton = new boolean[stickAux.getButtonCount()];


    autoModes.put(autoModeNone,"None");
    autoModes.put(autoModetoZone,"Move to Zone");
    autoModes.put(autoModetoZoneOver,"Move over platform to Zone");
    autoModes.put(autoModeGrabToZone,"Grab and move to zone");
    autoModes.put(autoModeGrabToZoneOver,"Grab and move over platform to zone");
    /*autoModes.put(autoModeDrivetoAutoZone,"(Tested) Drive to Auto Zone");
    autoModes.put(autoModeDrivetoAutoZoneOverPlatform,"(Untested) Drive to Auto Zone Over Platform");
    autoModes.put(autoModeGrabCanAndDrivetoAutoZone,"(Tested) Grab Can and drive to Auto Zone");
    autoModes.put(autoModeGrabCanAndDrivetoAutoZoneOverScoringPlatform,"(Untested) Grab Can to and drive Auto Zone over Scoring Platform");
    autoModes.put(autoModeDriveIntoAutoZoneFromLandfill,"(Untested) Drive into Auto Zone from Landfill");
    autoModes.put(autoModeGrabCanOffStep,"(Untested) Grab Can off step");
    autoModes.put(autoModeGrabToteOrCanMoveBack,"(Untested) Grab Tote or can and move to auto zone");
    autoModes.put(autoModeGrabToteOrCanMoveBackOverScoringPlatform,"(Untested) Grab Tote or can and move to auto zone (driving over scoring platform)");
    */
    autochooser = new SendableChooser();
    autochooser.addDefault("No Auto",0);
    int i = 0;
    int counter = 0;
    while(counter < autoModes.size()){
        if(autoModes.containsKey(i)){
            autochooser.addobject(autoModes.get(i),i);
            counter++;
        }
        i++;
    }
    SmartDashboard.putData("Auto Mode",autochooser);
}
项目:2017    文件CANObject.java   
/**
 * Sets the object to a Power distribution Panel
 * 
 * @param pdp
 *            power distribution panel object to change to
 */
public void setCAN (final PowerdistributionPanel pdp)
{
    CANObject.pdp = pdp;
    typeId = 4;
}
项目:2017    文件CANNetwork.java   
/**
 * 
 * @param pdp
 *            The power distribution panel in the network.
 */
public CANNetwork (PowerdistributionPanel pdp)
{
    this.pdp = pdp;
}
项目:FlashLib    文件PDP.java   
/**
 * Gets the wrapped {@link PowerdistributionPanel} object.
 * @return the wrapped object
 */
public PowerdistributionPanel getPanel(){
    return pdp;
}
项目:CasseroleLib    文件CIMCurrentEstimator.java   
/**
 * Sets up the current estimator with the system parameters.
 * 
 * @param numMotors Integer number of motors in the gearBox system. Usually 2 or 3 for a side of
 *        a drivetrain,or 1 for a single motor.
 * @param controllerVDrop_V voltage drop induced by the motor controller,in V.
 * @param pdp Instance of the PDP class from the top level (needed for voltage measurements)
 */
public CIMCurrentEstimator(int numMotors,double controllerVDrop_V,PowerdistributionPanel pdp) {
    this.numMotorsInSystem = numMotors;
    this.contVDrop = controllerVDrop_V;
    this.pdp = pdp;
}
项目:strongback-java    文件Hardware.java   
/**
 * Gets the {@link PowerPanel} of the robot.
 *
 * @return the {@link PowerPanel} of the robot
 */
public static PowerPanel powerPanel() {
    PowerdistributionPanel pdp = new PowerdistributionPanel();
    return PowerPanel.create(pdp::getCurrent,pdp::getTotalCurrent,pdp::getVoltage,pdp::getTemperature);
}

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