本文整理匯總了Java中edu.wpi.first.wpilibj.command.Subsystem類的典型用法代碼示例。如果您正苦於以下問題:Java Subsystem類的具體用法?Java Subsystem怎麽用?Java Subsystem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Subsystem類屬於edu.wpi.first.wpilibj.command包,在下文中一共展示了Subsystem類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Conditional
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public Conditional(final Command ifTrue,final Command ifFalse) {
super("Condition?" + (ifTrue == null ? "" : ifTrue .getName()) +
":" + (ifFalse == null ? "" : ifFalse.getName()));
// Wrap the Commands to expose protected methods
if(ifTrue != null) {
_ifTrue = new PublicCommand(ifTrue);
for(Enumeration e = _ifTrue.getRequirements();e.hasMoreElements();) {
requires((Subsystem) e.nextElement());
}
} else {
_ifTrue = null;
}
if(ifFalse != null) {
_ifFalse = new PublicCommand(ifFalse);
for(Enumeration e = _ifFalse.getRequirements();e.hasMoreElements();) {
requires((Subsystem) e.nextElement());
}
} else {
_ifFalse = null;
}
}
示例2: AimWithCamera
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public AimWithCamera()
{
requires((Subsystem) driveTrain);
requires((Subsystem) shooterArticulator);
if (CommandBase.lightSystem != null)
requires((Subsystem) lightSystem);
table = NetworkTable.getTable("IMGPROC");
TOLERANCE = Double.parseDouble(BadPreferences.getValue(toleranceKey, "" + TOLERANCE));
TURN_SPEED = Double.parseDouble(BadPreferences.getValue(turnKey, "" + TURN_SPEED));
NUMBER_CYCLES_TO_VERIFY = Integer.parseInt(
BadPreferences.getValue(neededCyclesKey, "" + NUMBER_CYCLES_TO_VERIFY));
SWEET_SPOT_X = Double.parseDouble(BadPreferences.getValue(sweetXKey, "" + SWEET_SPOT_X));
SWEET_SPOT_Y = Double.parseDouble(BadPreferences.getValue(sweetYKey, "" + SWEET_SPOT_Y));
}
示例3: WaitUntilSpeed
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public WaitUntilSpeed(CANTalon cantalon, int speed, Subsystem sub) {
this.speed = speed;
this.cantalon = cantalon;
requires(sub);
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
示例4: addSubsystemsToDashboard
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
/**
* Log subsystems on the SmartDashboard
* @param subsystems list of subsystems
*/
private void addSubsystemsToDashboard(ArrayList<LoggableSubsystem> subsystems) {
for (LoggableSubsystem subsystem : subsystems) {
if (subsystem != null && subsystem instanceof Subsystem) {
SmartDashboard.putData((Subsystem) subsystem);
}
}
}
示例5: Toggle
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public Toggle(TwoState object, double speed, boolean continuous){
super(continuous);
this.object = object;
this.speed = speed;
if(object instanceof Subsystem){
requires((Subsystem)object);
}
}
示例6: SetState
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public SetState(TwoState object, TwoState.State targetState, double speed, boolean continous){
super(continous);
this.object = object;
this.targetState = targetState;
this.speed = speed;
if(object instanceof Subsystem){
requires((Subsystem)object);
}
}
示例7: Shoot
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public Shoot(double speed)
{
requires( (Subsystem) shooter);
//SmartDashboard.putNumber("abc", 1);//this method deals with smartDashboard
//smartdash is still under constructing, put it in later.
shooterSpeed = speed;
shooterRunTime = 5;
}
示例8: SafeShoot
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public SafeShoot()
{
requires((Subsystem) frisbeePusher);
requires((Subsystem) shooter);
//requires((Subsystem) lightSystem);
REQUIRED_SHOOTER_SPEED = Double.parseDouble(BadPreferences.getValue("REQUIRED_SHOOTER_SPEED", "5000"));
}
示例9: initialize
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
protected void initialize()
{
requires ((Subsystem) lightSystem);
red = 0;
blue = 0;
green = 0;
}
示例10: ControlLighting
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public ControlLighting()
{
requires ((Subsystem) lightSystem);
lightSystem.turnOn();
SmartDashboard.putNumber("Red Channel", red);
SmartDashboard.putNumber("Green Channel", green);
SmartDashboard.putNumber("Blue Channel", blue);
}
示例11: teleopPeriodic
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
Scheduler.getInstance().run();
Watchdog.getInstance().feed();
// Timer.delay(.1);
if (((Subsystem) CommandBase.driveTrain).getCurrentCommand() == null) {
Scheduler.getInstance().add(new DriveWithController());
}
}
示例12: CommandInterruptSubsystem
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public CommandInterruptSubsystem(Subsystem sub) {
super(null);
subsystem = sub;
}
示例13: WaitUntilTime
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public WaitUntilTime(long length, Subsystem sub) {
this.length = length;
requires(sub);
}
示例14: DoNothingBase
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public DoNothingBase(Subsystem subsystem) {
requires(subsystem);
}
示例15: TriggerToShoot
import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public TriggerToShoot()
{
requires((Subsystem) shooter);
}