|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.command.Subsystem
public abstract class Subsystem
This class defines a major component of the robot.
A good example of a subsystem is the driveline, or a claw if the robot has one.
All motors should be a part of a subsystem. For instance, all the wheel motors should be a part of some kind of "Driveline" subsystem.
Subsystems are used within the command system as requirements for Command
.
Only one command which requires a subsystem can run at a time. Also, subsystems
can have default commands which are started if there is no command running which
requires this subsystem.
Command
Constructor Summary | |
---|---|
Subsystem()
Creates a subsystem. |
|
Subsystem(java.lang.String name)
Creates a subsystem with the given name |
Method Summary | |
---|---|
Command |
getCurrentCommand()
Returns the command which currently claims this subsystem. |
protected Command |
getDefaultCommand()
Returns the default command (or null if there is none). |
java.lang.String |
getName()
Returns the name of this subsystem, which is by default the class name. |
java.lang.String |
getSmartDashboardType()
|
ITable |
getTable()
|
protected abstract void |
initDefaultCommand()
Initialize the default command for a subsystem By default subsystems have no default command, but if they do, the default command is set with this method. |
void |
initTable(ITable table)
Initializes a table for this sendable object. |
protected void |
setDefaultCommand(Command command)
Sets the default command. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Subsystem(java.lang.String name)
name
- the name of the subsystempublic Subsystem()
Method Detail |
---|
protected abstract void initDefaultCommand()
protected void setDefaultCommand(Command command)
WARNING: This should NOT be called in a constructor if the subsystem is a singleton.
command
- the default command (or null if there should be none)
IllegalUseOfCommandException
- if the command does not require the subsystemprotected Command getDefaultCommand()
public Command getCurrentCommand()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
getName
in interface NamedSendable
public java.lang.String getSmartDashboardType()
getSmartDashboardType
in interface Sendable
public void initTable(ITable table)
Sendable
initTable
in interface Sendable
table
- The table to put the values in.public ITable getTable()
getTable
in interface Sendable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |