WPILibC++ 2025.2.1
|
#include <frc/RobotController.h>
Public Member Functions | |
RobotController ()=delete | |
Static Public Member Functions | |
static int | GetFPGAVersion () |
Return the FPGA Version number. | |
static int64_t | GetFPGARevision () |
Return the FPGA Revision number. | |
static std::string | GetSerialNumber () |
Return the serial number of the roboRIO. | |
static std::string | GetComments () |
Return the comments from the roboRIO web interface. | |
static int32_t | GetTeamNumber () |
Returns the team number configured for the robot controller. | |
static void | SetTimeSource (std::function< uint64_t()> supplier) |
Sets a new source to provide the clock time in microseconds. | |
static uint64_t | GetTime () |
Read the microsecond timestamp. | |
static uint64_t | GetFPGATime () |
Read the microsecond-resolution timer on the FPGA. | |
static bool | GetUserButton () |
Get the state of the "USER" button on the roboRIO. | |
static units::volt_t | GetBatteryVoltage () |
Read the battery voltage. | |
static bool | IsSysActive () |
Check if the FPGA outputs are enabled. | |
static bool | IsBrownedOut () |
Check if the system is browned out. | |
static int | GetCommsDisableCount () |
Gets the number of times the system has been disabled due to communication errors with the Driver Station. | |
static bool | GetRSLState () |
Gets the current state of the Robot Signal Light (RSL) | |
static bool | IsSystemTimeValid () |
Gets if the system time is valid. | |
static double | GetInputVoltage () |
Get the input voltage to the robot controller. | |
static double | GetInputCurrent () |
Get the input current to the robot controller. | |
static double | GetVoltage3V3 () |
Get the voltage of the 3.3V rail. | |
static double | GetCurrent3V3 () |
Get the current output of the 3.3V rail. | |
static void | SetEnabled3V3 (bool enabled) |
Enables or disables the 3.3V rail. | |
static bool | GetEnabled3V3 () |
Get the enabled state of the 3.3V rail. | |
static int | GetFaultCount3V3 () |
Get the count of the total current faults on the 3.3V rail since the code started. | |
static double | GetVoltage5V () |
Get the voltage of the 5V rail. | |
static double | GetCurrent5V () |
Get the current output of the 5V rail. | |
static void | SetEnabled5V (bool enabled) |
Enables or disables the 5V rail. | |
static bool | GetEnabled5V () |
Get the enabled state of the 5V rail. | |
static int | GetFaultCount5V () |
Get the count of the total current faults on the 5V rail since the code started. | |
static double | GetVoltage6V () |
Get the voltage of the 6V rail. | |
static double | GetCurrent6V () |
Get the current output of the 6V rail. | |
static void | SetEnabled6V (bool enabled) |
Enables or disables the 6V rail. | |
static bool | GetEnabled6V () |
Get the enabled state of the 6V rail. | |
static int | GetFaultCount6V () |
Get the count of the total current faults on the 6V rail since the code started. | |
static void | ResetRailFaultCounts () |
Reset the overcurrent fault counters for all user rails to 0. | |
static units::volt_t | GetBrownoutVoltage () |
Get the current brownout voltage setting. | |
static void | SetBrownoutVoltage (units::volt_t brownoutVoltage) |
Set the voltage the roboRIO will brownout and disable all outputs. | |
static units::celsius_t | GetCPUTemp () |
Get the current CPU temperature. | |
static void | SetRadioLEDState (RadioLEDState state) |
Set the state of the "Radio" LED. | |
static RadioLEDState | GetRadioLEDState () |
Get the state of the "Radio" LED. | |
static CANStatus | GetCANStatus () |
Get the current status of the CAN bus. | |
|
delete |
|
static |
Read the battery voltage.
|
static |
Get the current brownout voltage setting.
|
static |
|
static |
Return the comments from the roboRIO web interface.
The comments string is cached after the first call to this function on the RoboRIO - restart the robot code to reload the comments string after changing it in the web interface.
|
static |
Gets the number of times the system has been disabled due to communication errors with the Driver Station.
|
static |
Get the current CPU temperature.
|
static |
Get the current output of the 3.3V rail.
|
static |
Get the current output of the 5V rail.
|
static |
Get the current output of the 6V rail.
|
static |
Get the enabled state of the 3.3V rail.
The rail may be disabled due to calling SetEnabled3V3(), a controller brownout, a short circuit on the rail, or controller over-voltage.
|
static |
Get the enabled state of the 5V rail.
The rail may be disabled due to calling SetEnabled5V(), a controller brownout, a short circuit on the rail, or controller over-voltage.
|
static |
Get the enabled state of the 6V rail.
The rail may be disabled due to calling SetEnabled6V(), a controller brownout, a short circuit on the rail, or controller over-voltage.
|
static |
Get the count of the total current faults on the 3.3V rail since the code started.
|
static |
Get the count of the total current faults on the 5V rail since the code started.
|
static |
Get the count of the total current faults on the 6V rail since the code started.
|
static |
Return the FPGA Revision number.
The format of the revision is 3 numbers. The 12 most significant bits are the Major Revision. The next 8 bits are the Minor Revision. The 12 least significant bits are the Build Number.
|
static |
Read the microsecond-resolution timer on the FPGA.
|
static |
Return the FPGA Version number.
For now, expect this to be competition year.
|
static |
Get the input current to the robot controller.
|
static |
Get the input voltage to the robot controller.
|
static |
Get the state of the "Radio" LED.
On the RoboRIO, this reads from sysfs, so this function should not be called multiple times per loop cycle to avoid overruns.
|
static |
Gets the current state of the Robot Signal Light (RSL)
|
static |
Return the serial number of the roboRIO.
|
static |
Returns the team number configured for the robot controller.
|
static |
Read the microsecond timestamp.
By default, the time is based on the FPGA hardware clock in microseconds since the FPGA started. However, the return value of this method may be modified to use any time base, including non-monotonic and non-continuous time bases.
|
static |
Get the state of the "USER" button on the roboRIO.
|
static |
Get the voltage of the 3.3V rail.
|
static |
Get the voltage of the 5V rail.
|
static |
Get the voltage of the 6V rail.
|
static |
Check if the system is browned out.
|
static |
Check if the FPGA outputs are enabled.
The outputs may be disabled if the robot is disabled or e-stopped, the watchdog has expired, or if the roboRIO browns out.
|
static |
Gets if the system time is valid.
|
static |
Reset the overcurrent fault counters for all user rails to 0.
|
static |
Set the voltage the roboRIO will brownout and disable all outputs.
Note that this only does anything on the roboRIO 2. On the roboRIO it is a no-op.
brownoutVoltage | The brownout voltage |
|
static |
Enables or disables the 3.3V rail.
enabled | whether to enable the 3.3V rail. |
|
static |
Enables or disables the 5V rail.
enabled | whether to enable the 5V rail. |
|
static |
Enables or disables the 6V rail.
enabled | whether to enable the 6V rail. |
|
static |
Set the state of the "Radio" LED.
On the RoboRIO, this writes to sysfs, so this function should not be called multiple times per loop cycle to avoid overruns.
state | The state to set the LED to. |
|
static |
Sets a new source to provide the clock time in microseconds.
Changing this affects the return value of GetTime
.
supplier | Function to return the time in microseconds. |