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


Java PowerDistributionPanel类代码示例

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


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

示例1: robotInit

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:2141-Spartonics,项目名称:Spartonics-Code,代码行数:27,代码来源:Robot.java

示例2: init

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
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)", "Drivetrain", driveTrainCIMFrontLeft);
    LiveWindow.addActuator("RearRight (1)", "Drivetrain", driveTrainCIMRearRight);
    LiveWindow.addActuator("FrontRight (11)", "Drivetrain", driveTrainCIMFrontRight);
    LiveWindow.addActuator("Drive Train", "Gyro", gyro);
    // LiveWindow.addActuator("Shooter", "Shooter", shooter1);
}
 
开发者ID:Team4914,项目名称:2017-emmet,代码行数:26,代码来源:RobotMap.java

示例3: HardwareAdaptor

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
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();
}
 
开发者ID:taco650,项目名称:MinuteMan,代码行数:20,代码来源:HardwareAdaptor.java

示例4: robotInit

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
@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);
}
 
开发者ID:Team2537,项目名称:Cogsworth,代码行数:22,代码来源:Robot.java

示例5: operatorControl

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * 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));
	}
}
 
开发者ID:FRC1458,项目名称:turtleshell,代码行数:25,代码来源:Robot.java

示例6: Robot

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
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
}
 
开发者ID:TechnoWolves5518,项目名称:2015RobotCode,代码行数:23,代码来源:Robot.java

示例7: SensorInput

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Chilean-Heart,项目名称:2015-frc-robot,代码行数:21,代码来源:SensorInput.java

示例8: CANObject

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * 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);
    // }
}
 
开发者ID:FIRST-Team-339,项目名称:2017,代码行数:22,代码来源:CANObject.java

示例9: getPDP

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * // * 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;
}
 
开发者ID:FIRST-Team-339,项目名称:2017,代码行数:16,代码来源:CANObject.java

示例10: PDP

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:Flash3388,项目名称:FlashLib,代码行数:11,代码来源:PDP.java

示例11: robotInit

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:41,代码来源:Snobot.java

示例12: HarvesterRollers

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
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();
    }
 
开发者ID:CraftSpider,项目名称:Stronghold2016-340,代码行数:13,代码来源:HarvesterRollers.java

示例13: VoltageCompensatedShooter

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
public VoltageCompensatedShooter(CANTalon shooter, double voltageLevelToMaintain)
{
	m_shooter = shooter;
	m_panel = new PowerDistributionPanel();
	m_voltageLevelToMaintain = voltageLevelToMaintain;
	turnOff();
}
 
开发者ID:first95,项目名称:FRC2017,代码行数:8,代码来源:VoltageCompensatedShooter.java

示例14: getCurrent

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:RunnymedeRobotics1310,项目名称:Robot2015,代码行数:15,代码来源:PowerSubsystem.java

示例15: setupSensors

import edu.wpi.first.wpilibj.PowerDistributionPanel; //导入依赖的package包/类
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();
}
 
开发者ID:FRC1458,项目名称:turtleshell,代码行数:13,代码来源:Robot.java


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