本文整理汇总了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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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
}
示例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());
}
示例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());
}
示例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());
}