|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.DriverStation
public class DriverStation
Provide access to the network communication data to / from the Driver Station.
Nested Class Summary | |
---|---|
static class |
DriverStation.Alliance
The robot alliance that the robot is a part of |
Field Summary | |
---|---|
static int |
kBatteryChannel
Analog channel to read the battery |
static int |
kBatterySlot
Slot for the analog module to read the battery |
static int |
kJoystickAxes
Number of Joystick Axes |
static int |
kJoystickPorts
Number of Joystick Ports |
static int |
USER_CONTROL_DATA_SIZE
The size of the user control data |
static int |
USER_STATUS_DATA_SIZE
The size of the user status data |
Constructor Summary | |
---|---|
protected |
DriverStation()
DriverStation contructor. |
Method Summary | |
---|---|
DriverStation.Alliance |
getAlliance()
Get the current alliance from the FMS |
double |
getAnalogIn(int channel)
Get an analog voltage from the Driver Station. |
double |
getBatteryVoltage()
Read the battery voltage from the specified AnalogChannel. |
Dashboard |
getDashboardPackerHigh()
Get the dashboard packer for sending high user data to a dashboard program |
Dashboard |
getDashboardPackerLow()
Get the dashboard packer for sending low priority user data to a dashboard program |
protected void |
getData()
Copy data from the DS task for the user. |
boolean |
getDigitalIn(int channel)
Get values from the digital inputs on the Driver Station. |
boolean |
getDigitalOut(int channel)
Get a value that was set for the digital outputs on the Driver Station. |
DriverStationEnhancedIO |
getEnhancedIO()
Get the interface to the enhanced IO of the new driver station. |
static DriverStation |
getInstance()
Gets an instance of the DriverStation |
int |
getLocation()
Get the location of the controls |
int |
getPacketNumber()
Return the DS packet number. |
double |
getStickAxis(int stick,
int axis)
Get the value of the axis on a joystick. |
int |
getStickButtons(int stick)
The state of the buttons on the joystick. 12 buttons (4 msb are unused) from the joystick. |
boolean |
isAutonomous()
Gets a value indicating whether the Driver Station requires the robot to be running in autonomous mode. |
boolean |
isDisabled()
Gets a value indicating whether the Driver Station requires the robot to be disabled. |
boolean |
isEnabled()
Gets a value indicating whether the Driver Station requires the robot to be enabled. |
boolean |
isOperatorControl()
Gets a value indicating whether the Driver Station requires the robot to be running in operator-controlled mode. |
void |
release()
Kill the thread |
protected void |
setData()
Copy status data from the DS task for the user. |
void |
setDigitalOut(int channel,
boolean value)
Set a value for the digital outputs on the Driver Station. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int USER_CONTROL_DATA_SIZE
public static final int USER_STATUS_DATA_SIZE
public static final int kBatterySlot
public static final int kBatteryChannel
public static final int kJoystickPorts
public static final int kJoystickAxes
Constructor Detail |
---|
protected DriverStation()
Method Detail |
---|
public static DriverStation getInstance()
public void release()
protected void getData()
protected void setData()
public double getBatteryVoltage()
public double getStickAxis(int stick, int axis)
stick
- The joystick to read.axis
- The analog axis value to read from the joystick.
public int getStickButtons(int stick)
stick
- The joystick to read.
public double getAnalogIn(int channel)
channel
- The analog input channel on the driver station to read from. Valid range is 1 - 4.
public boolean getDigitalIn(int channel)
channel
- The digital input to get. Valid range is 1 - 8.
public void setDigitalOut(int channel, boolean value)
channel
- The digital output to set. Valid range is 1 - 8.value
- The state to set the digital output.public boolean getDigitalOut(int channel)
channel
- The digital ouput to monitor. Valid range is 1 through 8.
public boolean isEnabled()
public boolean isDisabled()
public boolean isAutonomous()
public boolean isOperatorControl()
public int getPacketNumber()
public DriverStation.Alliance getAlliance()
public int getLocation()
public Dashboard getDashboardPackerHigh()
public Dashboard getDashboardPackerLow()
public DriverStationEnhancedIO getEnhancedIO()
|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |