|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| default Scheduler | getRegisteredScheduler () |
| default boolean | controllableDuringDisabled () |
| default String | getName () |
| default void | setDefaultCommand (Command defaultCommand) |
| default Command | getDefaultCommand () |
| default NeedsNameBuilderStage | run (Consumer< Coroutine > commandBody) |
| default NeedsNameBuilderStage | runRepeatedly (Runnable loopBody) |
| default Command | idle () |
| default Command | idleFor (Time duration) |
| default List< Command > | getRunningCommands () |
Generic interface to represent mechanisms on a robot. Commands can require sole ownership of a mechanism; when a command that requires a mechanism is running, no other commands may use it at the same time.
Even though this interface is named "Mechanism", it may be used to represent other physical hardware on a robot that should be controlled with commands - for example, an LED strip or a vision processor that can switch between different pipelines could be represented as mechanisms.
Definition at line 21 of file Mechanism.java.
| default boolean org.wpilib.command3.Mechanism.controllableDuringDisabled | ( | ) |
Marks this mechanism as being controllable when the robot is in a disabled mode. If a mechanism is not controllable, commands that require it cannot be scheduled when the robot is disabled and will be canceled when the robot enters a disabled mode.
By default, mechanisms are not controllable during disabled. Override this method to return true if the mechanism should be controllable during disabled modes.
Definition at line 42 of file Mechanism.java.
| default Command org.wpilib.command3.Mechanism.getDefaultCommand | ( | ) |
Gets the default command that was set by the latest call to setDefaultCommand(Command).
Definition at line 78 of file Mechanism.java.
| default String org.wpilib.command3.Mechanism.getName | ( | ) |
Gets the name of this mechanism. This will default to the name of this mechanism's class.
Definition at line 52 of file Mechanism.java.
| default Scheduler org.wpilib.command3.Mechanism.getRegisteredScheduler | ( | ) |
Returns the scheduler under which this subsystem and its default commands are registered. The scheduler is also used to fetch running commands for the subsystem.
Definition at line 28 of file Mechanism.java.
| default List< Command > org.wpilib.command3.Mechanism.getRunningCommands | ( | ) |
Gets all running commands that require this mechanism. Commands are returned in the order in which they were scheduled. The returned list is read-only. Every command in the list will have been scheduled by the previous entry in the list or by intermediate commands that do not require the mechanism.
Definition at line 143 of file Mechanism.java.
| default Command org.wpilib.command3.Mechanism.idle | ( | ) |
Returns a command that idles this mechanism until another command claims it. The idle command has the lowest priority and can be interrupted by any other command.
The default command for every mechanism is an idle command unless a different default command has been configured.
Definition at line 120 of file Mechanism.java.
| default Command org.wpilib.command3.Mechanism.idleFor | ( | Time | duration | ) |
Returns a command that idles this mechanism for the given duration of time.
| duration | How long the mechanism should idle for. |
Definition at line 130 of file Mechanism.java.
| default NeedsNameBuilderStage org.wpilib.command3.Mechanism.run | ( | Consumer< Coroutine > | commandBody | ) |
Starts building a command that requires this mechanism.
| commandBody | The main function body of the command. |
Definition at line 88 of file Mechanism.java.
| default NeedsNameBuilderStage org.wpilib.command3.Mechanism.runRepeatedly | ( | Runnable | loopBody | ) |
Starts building a command that requires this mechanism. The given function will be called repeatedly in an infinite loop. Useful for building commands that don't need state or multiple stages of logic.
| loopBody | The body of the infinite loop. |
Definition at line 100 of file Mechanism.java.
| default void org.wpilib.command3.Mechanism.setDefaultCommand | ( | Command | defaultCommand | ) |
Sets the default command to run on the mechanism when no other command is scheduled. The default command's priority is effectively the minimum allowable priority for any command requiring a mechanism. For this reason, it's recommended that a default command have a priority less than Command#DEFAULT_PRIORITY so it doesn't prevent low-priority commands from running.
The default command is initially an idle command that only owns the mechanism without doing anything. This command has the lowest possible priority to allow any other command to run.
| defaultCommand | the new default command |
Definition at line 68 of file Mechanism.java.