WPILibC++ 2024.3.2
frc::RobotController Class Reference

#include <frc/RobotController.h>

Public Member Functions

 RobotController ()=delete
 

Static Public Member Functions

static int GetFPGAVersion ()
 Return the FPGA Version number. More...
 
static int64_t GetFPGARevision ()
 Return the FPGA Revision number. More...
 
static std::string GetSerialNumber ()
 Return the serial number of the roboRIO. More...
 
static std::string GetComments ()
 Return the comments from the roboRIO web interface. More...
 
static int32_t GetTeamNumber ()
 Returns the team number configured for the robot controller. More...
 
static uint64_t GetFPGATime ()
 Read the microsecond-resolution timer on the FPGA. More...
 
static bool GetUserButton ()
 Get the state of the "USER" button on the roboRIO. More...
 
static units::volt_t GetBatteryVoltage ()
 Read the battery voltage. More...
 
static bool IsSysActive ()
 Check if the FPGA outputs are enabled. More...
 
static bool IsBrownedOut ()
 Check if the system is browned out. More...
 
static bool GetRSLState ()
 Gets the current state of the Robot Signal Light (RSL) More...
 
static bool IsSystemTimeValid ()
 Gets if the system time is valid. More...
 
static double GetInputVoltage ()
 Get the input voltage to the robot controller. More...
 
static double GetInputCurrent ()
 Get the input current to the robot controller. More...
 
static double GetVoltage3V3 ()
 Get the voltage of the 3.3V rail. More...
 
static double GetCurrent3V3 ()
 Get the current output of the 3.3V rail. More...
 
static void SetEnabled3V3 (bool enabled)
 Enables or disables the 3.3V rail. More...
 
static bool GetEnabled3V3 ()
 Get the enabled state of the 3.3V rail. More...
 
static int GetFaultCount3V3 ()
 Get the count of the total current faults on the 3.3V rail since the controller has booted. More...
 
static double GetVoltage5V ()
 Get the voltage of the 5V rail. More...
 
static double GetCurrent5V ()
 Get the current output of the 5V rail. More...
 
static void SetEnabled5V (bool enabled)
 Enables or disables the 5V rail. More...
 
static bool GetEnabled5V ()
 Get the enabled state of the 5V rail. More...
 
static int GetFaultCount5V ()
 Get the count of the total current faults on the 5V rail since the controller has booted. More...
 
static double GetVoltage6V ()
 Get the voltage of the 6V rail. More...
 
static double GetCurrent6V ()
 Get the current output of the 6V rail. More...
 
static void SetEnabled6V (bool enabled)
 Enables or disables the 6V rail. More...
 
static bool GetEnabled6V ()
 Get the enabled state of the 6V rail. More...
 
static int GetFaultCount6V ()
 Get the count of the total current faults on the 6V rail since the controller has booted. More...
 
static units::volt_t GetBrownoutVoltage ()
 Get the current brownout voltage setting. More...
 
static void SetBrownoutVoltage (units::volt_t brownoutVoltage)
 Set the voltage the roboRIO will brownout and disable all outputs. More...
 
static units::celsius_t GetCPUTemp ()
 Get the current CPU temperature. More...
 
static void SetRadioLEDState (RadioLEDState state)
 Set the state of the "Radio" LED. More...
 
static RadioLEDState GetRadioLEDState ()
 Get the state of the "Radio" LED. More...
 
static CANStatus GetCANStatus ()
 Get the current status of the CAN bus. More...
 

Constructor & Destructor Documentation

◆ RobotController()

frc::RobotController::RobotController ( )
delete

Member Function Documentation

◆ GetBatteryVoltage()

static units::volt_t frc::RobotController::GetBatteryVoltage ( )
static

Read the battery voltage.

Returns
The battery voltage in Volts.

◆ GetBrownoutVoltage()

static units::volt_t frc::RobotController::GetBrownoutVoltage ( )
static

Get the current brownout voltage setting.

Returns
The brownout voltage

◆ GetCANStatus()

static CANStatus frc::RobotController::GetCANStatus ( )
static

Get the current status of the CAN bus.

Returns
The status of the CAN bus

◆ GetComments()

static std::string frc::RobotController::GetComments ( )
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.

Returns
The comments from the roboRIO web interface.

◆ GetCPUTemp()

static units::celsius_t frc::RobotController::GetCPUTemp ( )
static

Get the current CPU temperature.

Returns
current CPU temperature

◆ GetCurrent3V3()

static double frc::RobotController::GetCurrent3V3 ( )
static

Get the current output of the 3.3V rail.

Returns
The controller 3.3V rail output current value in Amps

◆ GetCurrent5V()

static double frc::RobotController::GetCurrent5V ( )
static

Get the current output of the 5V rail.

Returns
The controller 5V rail output current value in Amps

◆ GetCurrent6V()

static double frc::RobotController::GetCurrent6V ( )
static

Get the current output of the 6V rail.

Returns
The controller 6V rail output current value in Amps

◆ GetEnabled3V3()

static bool frc::RobotController::GetEnabled3V3 ( )
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.

Returns
The controller 3.3V rail enabled value. True for enabled.

◆ GetEnabled5V()

static bool frc::RobotController::GetEnabled5V ( )
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.

Returns
The controller 5V rail enabled value. True for enabled.

◆ GetEnabled6V()

static bool frc::RobotController::GetEnabled6V ( )
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.

Returns
The controller 6V rail enabled value. True for enabled.

◆ GetFaultCount3V3()

static int frc::RobotController::GetFaultCount3V3 ( )
static

Get the count of the total current faults on the 3.3V rail since the controller has booted.

Returns
The number of faults

◆ GetFaultCount5V()

static int frc::RobotController::GetFaultCount5V ( )
static

Get the count of the total current faults on the 5V rail since the controller has booted.

Returns
The number of faults

◆ GetFaultCount6V()

static int frc::RobotController::GetFaultCount6V ( )
static

Get the count of the total current faults on the 6V rail since the controller has booted.

Returns
The number of faults.

◆ GetFPGARevision()

static int64_t frc::RobotController::GetFPGARevision ( )
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.

Returns
FPGA Revision number.

◆ GetFPGATime()

static uint64_t frc::RobotController::GetFPGATime ( )
static

Read the microsecond-resolution timer on the FPGA.

Returns
The current time in microseconds according to the FPGA (since FPGA reset).

◆ GetFPGAVersion()

static int frc::RobotController::GetFPGAVersion ( )
static

Return the FPGA Version number.

For now, expect this to be competition year.

Returns
FPGA Version number.

◆ GetInputCurrent()

static double frc::RobotController::GetInputCurrent ( )
static

Get the input current to the robot controller.

Returns
The controller input current value in Amps

◆ GetInputVoltage()

static double frc::RobotController::GetInputVoltage ( )
static

Get the input voltage to the robot controller.

Returns
The controller input voltage value in Volts

◆ GetRadioLEDState()

static RadioLEDState frc::RobotController::GetRadioLEDState ( )
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.

Returns
The state of the LED.

◆ GetRSLState()

static bool frc::RobotController::GetRSLState ( )
static

Gets the current state of the Robot Signal Light (RSL)

Returns
The current state of the RSL- true if on, false if off

◆ GetSerialNumber()

static std::string frc::RobotController::GetSerialNumber ( )
static

Return the serial number of the roboRIO.

Returns
The serial number of the roboRIO.

◆ GetTeamNumber()

static int32_t frc::RobotController::GetTeamNumber ( )
static

Returns the team number configured for the robot controller.

Returns
team number, or 0 if not found.

◆ GetUserButton()

static bool frc::RobotController::GetUserButton ( )
static

Get the state of the "USER" button on the roboRIO.

Warning
the User Button is used to stop user programs from automatically loading if it is held for more then 5 seconds. Because of this, it's not recommended to be used by teams for any other purpose.
Returns
True if the button is currently pressed down

◆ GetVoltage3V3()

static double frc::RobotController::GetVoltage3V3 ( )
static

Get the voltage of the 3.3V rail.

Returns
The controller 3.3V rail voltage value in Volts

◆ GetVoltage5V()

static double frc::RobotController::GetVoltage5V ( )
static

Get the voltage of the 5V rail.

Returns
The controller 5V rail voltage value in Volts

◆ GetVoltage6V()

static double frc::RobotController::GetVoltage6V ( )
static

Get the voltage of the 6V rail.

Returns
The controller 6V rail voltage value in Volts

◆ IsBrownedOut()

static bool frc::RobotController::IsBrownedOut ( )
static

Check if the system is browned out.

Returns
True if the system is browned out

◆ IsSysActive()

static bool frc::RobotController::IsSysActive ( )
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.

Returns
True if the FPGA outputs are enabled.

◆ IsSystemTimeValid()

static bool frc::RobotController::IsSystemTimeValid ( )
static

Gets if the system time is valid.

Returns
True if the system time is valid, false otherwise

◆ SetBrownoutVoltage()

static void frc::RobotController::SetBrownoutVoltage ( units::volt_t  brownoutVoltage)
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.

Parameters
brownoutVoltageThe brownout voltage

◆ SetEnabled3V3()

static void frc::RobotController::SetEnabled3V3 ( bool  enabled)
static

Enables or disables the 3.3V rail.

Parameters
enabledwhether to enable the 3.3V rail.

◆ SetEnabled5V()

static void frc::RobotController::SetEnabled5V ( bool  enabled)
static

Enables or disables the 5V rail.

Parameters
enabledwhether to enable the 5V rail.

◆ SetEnabled6V()

static void frc::RobotController::SetEnabled6V ( bool  enabled)
static

Enables or disables the 6V rail.

Parameters
enabledwhether to enable the 6V rail.

◆ SetRadioLEDState()

static void frc::RobotController::SetRadioLEDState ( RadioLEDState  state)
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.

Parameters
stateThe state to set the LED to.

The documentation for this class was generated from the following file: