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

Conditional.java 文件源码 项目:Storm2014 阅读 24 收藏 0 点赞 0 评论 0
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;
    }
}
AimWithCamera.java 文件源码 项目:BadRobot2013 阅读 23 收藏 0 点赞 0 评论 0
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));
}
WaitUntilSpeed.java 文件源码 项目:Robot_2017 阅读 18 收藏 0 点赞 0 评论 0
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);
}
Robot.java 文件源码 项目:STEAMworks 阅读 19 收藏 0 点赞 0 评论 0
/**
 * 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);
        }
    }
}
Toggle.java 文件源码 项目:2014-Robot 阅读 21 收藏 0 点赞 0 评论 0
public Toggle(TwoState object, double speed, boolean continuous){
    super(continuous);
    this.object = object;
    this.speed = speed;

    if(object instanceof Subsystem){
        requires((Subsystem)object);
    }
}
SetState.java 文件源码 项目:2014-Robot 阅读 17 收藏 0 点赞 0 评论 0
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);
    }
}
Shoot.java 文件源码 项目:BadRobot2013 阅读 26 收藏 0 点赞 0 评论 0
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;
}
Shoot.java 文件源码 项目:BadRobot2013 阅读 22 收藏 0 点赞 0 评论 0
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;
}
SafeShoot.java 文件源码 项目:BadRobot2013 阅读 19 收藏 0 点赞 0 评论 0
public SafeShoot()
{
    requires((Subsystem) frisbeePusher);
    requires((Subsystem) shooter);
    //requires((Subsystem) lightSystem);

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


问题


面经


文章

微信
公众号

扫码关注公众号