Java 类edu.wpi.first.wpilibj.command.Subsystem 实例源码

项目:Storm2014    文件:Conditional.java   
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;
    }
}
项目:BadRobot2013    文件:AimWithCamera.java   
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));
}
项目:Robot_2017    文件:WaitUntilSpeed.java   
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);
}
项目:STEAMworks    文件:Robot.java   
/**
 * 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);
        }
    }
}
项目:2014-Robot    文件:Toggle.java   
public Toggle(TwoState object, double speed, boolean continuous){
    super(continuous);
    this.object = object;
    this.speed = speed;

    if(object instanceof Subsystem){
        requires((Subsystem)object);
    }
}
项目:2014-Robot    文件:SetState.java   
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);
    }
}
项目:BadRobot2013    文件:Shoot.java   
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;
}
项目:BadRobot2013    文件:Shoot.java   
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;
}
项目:BadRobot2013    文件:SafeShoot.java   
public SafeShoot()
{
    requires((Subsystem) frisbeePusher);
    requires((Subsystem) shooter);
    //requires((Subsystem) lightSystem);

    REQUIRED_SHOOTER_SPEED = Double.parseDouble(BadPreferences.getValue("REQUIRED_SHOOTER_SPEED", "5000"));
}
项目:BadRobot2013    文件:AllColors.java   
protected void initialize() 
{
    requires ((Subsystem) lightSystem);
    red = 0;
    blue = 0;
    green = 0;
}
项目:BadRobot2013    文件:ControlLighting.java   
public ControlLighting()
{
    requires ((Subsystem) lightSystem);
    lightSystem.turnOn();
    SmartDashboard.putNumber("Red Channel", red);
    SmartDashboard.putNumber("Green Channel", green);
    SmartDashboard.putNumber("Blue Channel", blue);
}
项目:BadRobot2013    文件:RobotMain.java   
/**
 * 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());
    }
}
项目:FRC-5800-Stronghold    文件:CommandInterruptSubsystem.java   
public CommandInterruptSubsystem(Subsystem sub) {
    super(null);
    subsystem = sub;
}
项目:Robot_2017    文件:WaitUntilTime.java   
public WaitUntilTime(long length, Subsystem sub) {
    this.length = length;
    requires(sub);
}
项目:Robot2014    文件:DoNothingBase.java   
public DoNothingBase(Subsystem subsystem) {
    requires(subsystem);
}
项目:BadRobot2013    文件:TriggerToShoot.java   
public TriggerToShoot()
{
    requires((Subsystem) shooter);
}
项目:BadRobot2013    文件:Shoot.java   
public Shoot() 
{
    requires( (Subsystem) shooter);
    //SmartDashboard.putNumber("abc", 1);//this method deals with smartDashboard 
    //smartdash is still under constructing, put it in later.
}
项目:BadRobot2013    文件:ClimbForTenPoints.java   
public ClimbForTenPoints() {
    requires((Subsystem) driveTrain);
    //requires((Subsystem) shooterArticulator);
    // requires((Subsystem) lightSystem);
}
项目:BadRobot2013    文件:ArticulateClimber.java   
public ArticulateClimber()
{
    requires ((Subsystem) climberArticulator);
}
项目:BadRobot2013    文件:TurnOnCameraLight.java   
public TurnOnCameraLight()
{
    requires((Subsystem) cameraLight);
    // Use requires() here to declare subsystem dependencies
    // eg. requires(chassis);
}
项目:BadRobot2013    文件:DemonstrateLighting.java   
public DemonstrateLighting()
{
    requires((Subsystem) lightSystem);
}
项目:BadRobot2013    文件:DriveWithController.java   
public DriveWithController()
{
    requires((Subsystem) driveTrain);
}
项目:BadRobot2013    文件:ShootWithController.java   
public ShootWithController()
{
    requires((Subsystem) shooter);
}
项目:BadRobot2013    文件:DriveStraightBackwards.java   
/**
 * Runs the command for the default time length.
 */
public DriveStraightBackwards()
{
    requires((Subsystem) driveTrain);
    driveTime = 5*1000000;
}
项目:BadRobot2013    文件:DriveStraightForward.java   
/**
 * Runs the command for the default time length.
 */
public DriveStraightForward()
{
    requires((Subsystem) driveTrain);
    driveTime = 5*1000000;
}
项目:BadRobot2013    文件:ArticulateShooter.java   
public ArticulateShooter()
{
    requires ((Subsystem) shooterArticulator);
}
项目:BadRobot2013    文件:DriveForward.java   
/**
 * Drive forward the default amount of time (DRIVE_TIME).
 */
public DriveForward()
{
    requires( (Subsystem) driveTrain);
}
项目:BadRobot2013    文件:RunLights.java   
public RunLights(int color)
{
    this.color = color;
    requires((Subsystem) lightSystem);
}
项目:BadRobot2013    文件:Turn.java   
/**
 * 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;
}
项目:CK_16_Java    文件:Wait.java   
public Wait(double timeInSeconds, Subsystem s){
    requires(s); // Subsystem to interupt.
    setTimeout(timeInSeconds); // Time to wait.
    setInterruptible(false); // Button pressed won't override this.
}