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; } }
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)); }
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); }
/** * 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); } } }
public Toggle(TwoState object, double speed, boolean continuous){ super(continuous); this.object = object; this.speed = speed; if(object instanceof Subsystem){ requires((Subsystem)object); } }
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); } }
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; }
public Shoot(double time, double speed) { requires( (Subsystem) shooter); SmartDashboard.putNumber("abc", 1);//this method deals with smartDashboard //smartdash is still under constructing, put it in later. shooterRunTime = time; shooterSpeed = speed; }
public SafeShoot() { requires((Subsystem) frisbeePusher); requires((Subsystem) shooter); //requires((Subsystem) lightSystem); REQUIRED_SHOOTER_SPEED = Double.parseDouble(BadPreferences.getValue("REQUIRED_SHOOTER_SPEED", "5000")); }
protected void initialize() { requires ((Subsystem) lightSystem); red = 0; blue = 0; green = 0; }
public ControlLighting() { requires ((Subsystem) lightSystem); lightSystem.turnOn(); SmartDashboard.putNumber("Red Channel", red); SmartDashboard.putNumber("Green Channel", green); SmartDashboard.putNumber("Blue Channel", blue); }
/** * 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()); } }
public CommandInterruptSubsystem(Subsystem sub) { super(null); subsystem = sub; }
public WaitUntilTime(long length, Subsystem sub) { this.length = length; requires(sub); }
public DoNothingBase(Subsystem subsystem) { requires(subsystem); }
public TriggerToShoot() { requires((Subsystem) shooter); }
public Shoot() { requires( (Subsystem) shooter); //SmartDashboard.putNumber("abc", 1);//this method deals with smartDashboard //smartdash is still under constructing, put it in later. }
public ClimbForTenPoints() { requires((Subsystem) driveTrain); //requires((Subsystem) shooterArticulator); // requires((Subsystem) lightSystem); }
public ArticulateClimber() { requires ((Subsystem) climberArticulator); }
public TurnOnCameraLight() { requires((Subsystem) cameraLight); // Use requires() here to declare subsystem dependencies // eg. requires(chassis); }
public DemonstrateLighting() { requires((Subsystem) lightSystem); }
public DriveWithController() { requires((Subsystem) driveTrain); }
public ShootWithController() { requires((Subsystem) shooter); }
/** * Runs the command for the default time length. */ public DriveStraightBackwards() { requires((Subsystem) driveTrain); driveTime = 5*1000000; }
/** * Runs the command for the default time length. */ public DriveStraightForward() { requires((Subsystem) driveTrain); driveTime = 5*1000000; }
public ArticulateShooter() { requires ((Subsystem) shooterArticulator); }
/** * Drive forward the default amount of time (DRIVE_TIME). */ public DriveForward() { requires( (Subsystem) driveTrain); }
public RunLights(int color) { this.color = color; requires((Subsystem) lightSystem); }
/** * turns the robot at the given angle * @param angle the angle of the radius of the turn */ public Turn(double angle) { requires((Subsystem) driveTrain); turnAngle = angle; }
public Wait(double timeInSeconds, Subsystem s){ requires(s); // Subsystem to interupt. setTimeout(timeInSeconds); // Time to wait. setInterruptible(false); // Button pressed won't override this. }