當前位置: 首頁>>代碼示例>>Java>>正文


Java LiveWindow.addActuator方法代碼示例

本文整理匯總了Java中edu.wpi.first.wpilibj.livewindow.LiveWindow.addActuator方法的典型用法代碼示例。如果您正苦於以下問題:Java LiveWindow.addActuator方法的具體用法?Java LiveWindow.addActuator怎麽用?Java LiveWindow.addActuator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.wpi.first.wpilibj.livewindow.LiveWindow的用法示例。


在下文中一共展示了LiveWindow.addActuator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的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

示例2: DefenseBuster

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public DefenseBuster() {
		super(0.5, 0, 0);
//		super(1.50, 0.03, 5.0);

		MAX_SPEED = getPreferencesDouble(RobotMap.PREF_DEFENSE_BUSTER_MAX_SPEED, 0.8);
		MIN_VALUE = getPreferencesDouble(RobotMap.PREF_DEFENSE_BUSTER_MIN_VALUE, 2.5);
		MAX_VALUE = getPreferencesDouble(RobotMap.PREF_DEFENSE_BUSTER_MAX_VALUE, 3.9);
		PARK_VALUE = getPreferencesDouble(RobotMap.PREF_DEFENSE_BUSTER_PARK_VALUE, 2.1);

		softFuse = new SoftFuse(angleMotor, 40, 1, 2);
		
		getPIDController().setInputRange(MIN_VALUE, MAX_VALUE);
		getPIDController().setAbsoluteTolerance(0.01);
		getPIDController().setToleranceBuffer(8);
		setSetpoint(PARK_VALUE);
		softFuse.positionFuse(angleMotor.getOutputCurrent());

		getPIDController().enable();
		LiveWindow.addActuator("DefenseBuster", "PIDSubsystem Controller", getPIDController());
	}
 
開發者ID:firebears-frc,項目名稱:FB2016,代碼行數:21,代碼來源:DefenseBuster.java

示例3: BallGetter

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public BallGetter() {
		
		super(1.005, 0, 0);
//		super(1.75, 0.04, 2.5);

		MAX_SPEED = getPreferencesDouble(RobotMap.PREF_BALL_GETTER_MAX_SPEED, 0.65);
		MIN_VALUE = getPreferencesDouble(RobotMap.PREF_BALL_GETTER_MIN_VALUE, .75);
		MAX_VALUE = getPreferencesDouble(RobotMap.PREF_BALL_GETTER_MAX_VAUE, 2.2);
		MAXGET_SPEED = getPreferencesDouble(RobotMap.PREF_BALL_GETTER_MAXGET_SPEED, 0.75);
		PARK_VALUE = getPreferencesDouble(RobotMap.PREF_BALL_GETTER_PARK_VALUE, .9);
		SIDE_SPEED = MAXGET_SPEED * 0.5;
		
		getPIDController().setInputRange(MIN_VALUE, MAX_VALUE);
		getPIDController().setAbsoluteTolerance(0.01);
		getPIDController().setToleranceBuffer(8);
		setSetpoint(2.1);
//		Robot.ballGetter.ballGetterPosition = 1;
		getPIDController().enable();
		LiveWindow.addActuator("BallGetter", "PIDSubsystem Controller", getPIDController());
		LiveWindow.addSensor("BallGetter", "current", RobotMap.ballGetterAngleMotor);
	}
 
開發者ID:firebears-frc,項目名稱:FB2016,代碼行數:22,代碼來源:BallGetter.java

示例4: initSolenoid

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
/**
 * Common function to implement constructor behavior.
 */
private synchronized void initSolenoid() {
  checkSolenoidModule(m_moduleNumber);
  checkSolenoidChannel(m_channel);

  try {
    m_allocated.allocate(m_moduleNumber * kSolenoidChannels + m_channel);
  } catch (CheckedAllocationException e) {
    throw new AllocationException("Solenoid channel " + m_channel + " on module "
      + m_moduleNumber + " is already allocated");
  }

  long port = SolenoidJNI.getPortWithModule((byte) m_moduleNumber, (byte) m_channel);
  m_solenoid_port = SolenoidJNI.initializeSolenoidPort(port);

  LiveWindow.addActuator("Solenoid", m_moduleNumber, m_channel, this);
  UsageReporting.report(tResourceType.kResourceType_Solenoid, m_channel, m_moduleNumber);
}
 
開發者ID:trc492,項目名稱:Frc2016FirstStronghold,代碼行數:21,代碼來源:Solenoid.java

示例5: CANTalon

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
/**
 * Constructor for the CANTalon device.
 * @param deviceNumber The CAN ID of the Talon SRX
 * @param controlPeriodMs The period in ms to send the CAN control frame.
 *                        Period is bounded to [1ms,95ms].
 */
public CANTalon(int deviceNumber, int controlPeriodMs) {
  m_deviceNumber = deviceNumber;
  /* bound period to be within [1 ms,95 ms] */
  m_handle = CanTalonJNI.new_CanTalonSRX(deviceNumber, controlPeriodMs);
  m_safetyHelper = new MotorSafetyHelper(this);
  m_controlEnabled = true;
  m_profile = 0;
  m_setPoint = 0;
  m_codesPerRev = 0;
  m_numPotTurns = 0;
  m_feedbackDevice = FeedbackDevice.QuadEncoder;
  setProfile(m_profile);
  applyControlMode(TalonControlMode.PercentVbus);
  LiveWindow.addActuator("CANTalon", m_deviceNumber, this);
}
 
開發者ID:trc492,項目名稱:Frc2016FirstStronghold,代碼行數:22,代碼來源:CANTalon.java

示例6: initRelay

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
/**
 * Common relay initialization method. This code is common to all Relay
 * constructors and initializes the relay and reserves all resources that need
 * to be locked. Initially the relay is set to both lines at 0v.
 */
private void initRelay() {
  SensorBase.checkRelayChannel(m_channel);
  try {
    if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
      relayChannels.allocate(m_channel * 2);
      UsageReporting.report(tResourceType.kResourceType_Relay, m_channel);
    }
    if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
      relayChannels.allocate(m_channel * 2 + 1);
      UsageReporting.report(tResourceType.kResourceType_Relay, m_channel + 128);
    }
  } catch (CheckedAllocationException e) {
    throw new AllocationException("Relay channel " + m_channel + " is already allocated");
  }

  m_port = DIOJNI.initializeDigitalPort(DIOJNI.getPort((byte) m_channel));

  m_safetyHelper = new MotorSafetyHelper(this);
  m_safetyHelper.setSafetyEnabled(false);

  LiveWindow.addActuator("Relay", m_channel, this);
}
 
開發者ID:trc492,項目名稱:Frc2016FirstStronghold,代碼行數:28,代碼來源:Relay.java

示例7: init

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public static void init() {
      // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
  	compressor = new Compressor();
  	
      driveTrainLeftFront = new CANTalon(1);
      LiveWindow.addActuator("DriveTrain", "LeftFront", driveTrainLeftFront);
      driveTrainRightFront = new CANTalon(3);
      LiveWindow.addActuator("DriveTrain", "RightFront", driveTrainRightFront);
      driveTrainLeftRear = new CANTalon(2);
      driveTrainLeftRear.changeControlMode(TalonControlMode.Follower);
      driveTrainLeftRear.set(driveTrainLeftFront.getDeviceID());
      LiveWindow.addActuator("DriveTrain", "LeftRear", driveTrainLeftRear);
      driveTrainRightRear = new CANTalon(4);
      driveTrainRightRear.changeControlMode(TalonControlMode.Follower);
      driveTrainRightRear.set(driveTrainRightFront.getDeviceID());
      driveTrainRightRear.reverseOutput(false);
      LiveWindow.addActuator("DriveTrain", "RightRear", driveTrainRightRear);
      
      driveTrainLeftFront.setInverted(true);
      driveTrainRightFront.setInverted(true);
      driveTrainLeftRear.setInverted(true);
      driveTrainRightRear.setInverted(true);
      
      driveTrainRobotDrive41 = new RobotDrive(driveTrainRightFront, driveTrainLeftFront);
driveTrainRobotDrive41.setSafetyEnabled(true);
driveTrainRobotDrive41.setExpiration(0.1);
driveTrainRobotDrive41.setSensitivity(0.5);
driveTrainRobotDrive41.setMaxOutput(1.0);
      
      climbMotor = new CANTalon(5);
      LiveWindow.addActuator("Climbing", "Motor", climbMotor);
      
      lightsLightEnable = new Relay(0);
      LiveWindow.addActuator("Lights", "LightEnable", lightsLightEnable);
      
      gearIntakeRamp = new DoubleSolenoid(1, 0);
      LiveWindow.addActuator("GearIntake", "IntakeRamp", gearIntakeRamp);

      // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
  }
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:41,代碼來源:RobotMap.java

示例8: Shooter

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public Shooter() {
	super();
	shooterFeeder = new CANTalon(8);
    LiveWindow.addActuator("Shooter", "Feeder", shooterFeeder);
    shooterFeeder.enableBrakeMode(false);
    
    shooterShootMotor = new CANTalon(7);
    LiveWindow.addActuator("Shooter", "ShootMotor", shooterShootMotor);
    shooterShootMotor.enableBrakeMode(false);
       /* choose the sensor */
    shooterShootMotor.setFeedbackDevice(FeedbackDevice.QuadEncoder);
    shooterShootMotor.reverseSensor(true);
    shooterShootMotor.configEncoderCodesPerRev(PulsesPerRevolution); // if using FeedbackDevice.QuadEncoder

       /* set the peak and nominal outputs, 12V means full */
    shooterShootMotor.configNominalOutputVoltage(+0.0f, -0.0f);
    shooterShootMotor.configPeakOutputVoltage(+12.0f, -12.0f);
       
       /* set closed loop gains in slot0 */
    shooterShootMotor.setProfile(0);
    shooterShootMotor.setF(pidF);
       shooterShootMotor.setP(pidP);	
       
       //only change I and D to smooth out control
       shooterShootMotor.setI(0); 
       shooterShootMotor.setD(0);
    
    shooterAgitator = new CANTalon(10);
    LiveWindow.addActuator("Shooter", "Agitator", shooterAgitator);
    shooterAgitator.enableBrakeMode(false);
}
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:32,代碼來源:Shooter.java

示例9: GearScore

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public GearScore() {
	super();
	
    gearScorePusher = new DoubleSolenoid(3, 4);
    LiveWindow.addActuator("GearScore", "Pusher", gearScorePusher);

    gearScoreDoor = new DoubleSolenoid(6, 5);
    LiveWindow.addActuator("GearScore", "Door", gearScoreDoor);
}
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:10,代碼來源:GearScore.java

示例10: BallIntake

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public BallIntake() {
	super();
	ballIntakeMotor = new CANTalon(9);
    LiveWindow.addActuator("BallIntake", "Intake", ballIntakeMotor);
    ballIntakeMotor.enableBrakeMode(false);
    
}
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:8,代碼來源:BallIntake.java

示例11: init

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    driveTrainLeftFront = new Victor(0);
    LiveWindow.addActuator("DriveTrain", "LeftFront", (Victor) driveTrainLeftFront);
    
    driveTrainLeftRear = new Victor(1);
    LiveWindow.addActuator("DriveTrain", "LeftRear", (Victor) driveTrainLeftRear);
    
    driveTrainRightFront = new Victor(2);
    LiveWindow.addActuator("DriveTrain", "RightFront", (Victor) driveTrainRightFront);
    
    driveTrainRightRear = new Victor(3);
    LiveWindow.addActuator("DriveTrain", "RightRear", (Victor) driveTrainRightRear);
    
    driveTrainRobotDrive = new RobotDrive(driveTrainLeftFront, driveTrainLeftRear,
          driveTrainRightFront, driveTrainRightRear);
    
    driveTrainRobotDrive.setSafetyEnabled(false);
    driveTrainRobotDrive.setExpiration(0.1);
    driveTrainRobotDrive.setSensitivity(1.0);
    driveTrainRobotDrive.setMaxOutput(1.0);

    shootershooterTalon = new CANTalon(0);
    LiveWindow.addActuator("Shooter", "shooterTalon", shootershooterTalon);
    

// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    // set this up
    gyro = new ADXRS450_Gyro();
}
 
開發者ID:Team2667,項目名稱:SteamWorks,代碼行數:31,代碼來源:RobotMap.java

示例12: init

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public static void init() {
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    motorRelayMotorRelay1 = new Relay(0);
    LiveWindow.addActuator("MotorRelay", "MotorRelay1", motorRelayMotorRelay1);

    lFront = new CANTalon(1);
    LiveWindow.addActuator("Wheels", "Speed Controller 1", (CANTalon) lFront);
    
    rFront = new CANTalon(3);
    LiveWindow.addActuator("Wheels", "Speed Controller 2", (CANTalon) rFront);
    
    lRear = new CANTalon(2);
    LiveWindow.addActuator("Wheels", "Speed Controller 3", (CANTalon) lRear);
    
    rRear = new CANTalon(4);
    LiveWindow.addActuator("Wheels", "Speed Controller 4", (CANTalon) rRear);
    
    driveSystem = new RobotDrive(lFront, lRear,
          rFront, rRear);
    
    driveSystem.setSafetyEnabled(true);
    driveSystem.setExpiration(0.1);
    driveSystem.setSensitivity(0.5);
    driveSystem.setMaxOutput(1.0);
    
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
 
開發者ID:FRC2832,項目名稱:Practice_Robot_Code,代碼行數:28,代碼來源:RobotMap.java

示例13: Rotate

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public Rotate(double degrees) {
    super(.0125,.008,.2);
    requires(Robot.drivebase);
    getPIDController().setAbsoluteTolerance(1);
    getPIDController().setOutputRange(-.8,.8);
    setSetpoint(degrees);
    LiveWindow.addActuator("Drivebase", "RotateRelative PID Controller", getPIDController());
}
 
開發者ID:FRC-2928,項目名稱:VikingRobot,代碼行數:9,代碼來源:Rotate.java

示例14: DistancePID

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public DistancePID() {  
	
	super("DistancePID", 0.14, 0.0, 0.01);  //calls the parent constructor with arguments P,I,D
	//working PIDs: 0.24, 0, 0
	
	setAbsoluteTolerance(0.2);       // more parameters
	getPIDController().setContinuous(false);
	setInputRange(-10,  10);
    setOutputRange(-0.25, 0.25); //1/5 speed
    
    LiveWindow.addActuator("DistancePID", "DistancePID", getPIDController());
}
 
開發者ID:RobotsByTheC,項目名稱:CMonster2017,代碼行數:13,代碼來源:DistancePID.java

示例15: HeadingPID

import edu.wpi.first.wpilibj.livewindow.LiveWindow; //導入方法依賴的package包/類
public HeadingPID() {  
	super("HeadingPID", 0.06, 0.0, 0.0);  //calls the parent constructor with arguments P,I,D
	//keep P term at 0.06!!!!
	
	setAbsoluteTolerance(0.5);          // more parameters
	getPIDController().setContinuous(false);
	setInputRange(-180.0,  180.0);
    setOutputRange(-0.25, 0.25);
    
    LiveWindow.addActuator("HeadingPID", "HeadingPID", getPIDController());
}
 
開發者ID:RobotsByTheC,項目名稱:CMonster2017,代碼行數:12,代碼來源:HeadingPID.java


注:本文中的edu.wpi.first.wpilibj.livewindow.LiveWindow.addActuator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。