當前位置: 首頁>>代碼示例>>Java>>正文


Java Subsystem類代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:2729StormRobotics,項目名稱:Storm2014,代碼行數:22,代碼來源:Conditional.java

示例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));
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:19,代碼來源:AimWithCamera.java

示例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);
}
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:8,代碼來源:WaitUntilSpeed.java

示例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);
		}
	}
}
 
開發者ID:cyborgs3335,項目名稱:STEAMworks,代碼行數:12,代碼來源:Robot.java

示例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);
	}
}
 
開發者ID:frc-4931,項目名稱:2014-Robot,代碼行數:10,代碼來源:Toggle.java

示例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);
	}
}
 
開發者ID:frc-4931,項目名稱:2014-Robot,代碼行數:11,代碼來源:SetState.java

示例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;
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:9,代碼來源:Shoot.java

示例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"));
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:9,代碼來源:SafeShoot.java

示例9: initialize

import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
protected void initialize() 
{
    requires ((Subsystem) lightSystem);
    red = 0;
    blue = 0;
    green = 0;
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:8,代碼來源:AllColors.java

示例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);
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:9,代碼來源:ControlLighting.java

示例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());
    }
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:13,代碼來源:RobotMain.java

示例12: CommandInterruptSubsystem

import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public CommandInterruptSubsystem(Subsystem sub) {
	super(null);
	subsystem = sub;
}
 
開發者ID:FRC5800,項目名稱:FRC-5800-Stronghold,代碼行數:5,代碼來源:CommandInterruptSubsystem.java

示例13: WaitUntilTime

import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public WaitUntilTime(long length, Subsystem sub) {
	this.length = length;
	requires(sub);
}
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:5,代碼來源:WaitUntilTime.java

示例14: DoNothingBase

import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public DoNothingBase(Subsystem subsystem) {
    requires(subsystem);
}
 
開發者ID:FIRSTTeam3189,項目名稱:Robot2014,代碼行數:4,代碼來源:DoNothingBase.java

示例15: TriggerToShoot

import edu.wpi.first.wpilibj.command.Subsystem; //導入依賴的package包/類
public TriggerToShoot()
{
    requires((Subsystem) shooter);
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:5,代碼來源:TriggerToShoot.java


注:本文中的edu.wpi.first.wpilibj.command.Subsystem類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。