RobotController

class wpilib.RobotController

Bases: pybind11_object

static get_battery_voltage() wpimath.units.volts

Read the battery voltage.

Returns:

The battery voltage in Volts.

static get_brownout_voltage() wpimath.units.volts

Get the current brownout voltage setting.

Returns:

The brownout voltage

static get_can_status(bus_id: SupportsInt | SupportsIndex) wpilib._wpilib.CANStatus

Get the current status of the CAN bus.

Parameters:

bus_id – The bus ID.

Returns:

The status of the CAN bus

static get_comments() str

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.

static get_comms_disable_count() int

Gets the number of times the system has been disabled due to communication errors with the Driver Station.

Returns:

number of disables due to communication errors.

static get_cpu_temp() wpimath.units.celsius

Get the current CPU temperature.

Returns:

current CPU temperature

static get_current_3v3() float

Get the current output of the 3.3V rail.

Returns:

The controller 3.3V rail output current value in Amps

static get_enabled_3v3() bool

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.

static get_fault_count_3v3() int

Get the count of the total current faults on the 3.3V rail since the code started.

Returns:

The number of faults

static get_input_voltage() float

Get the input voltage to the robot controller.

Returns:

The controller input voltage value in Volts

static get_monotonic_time() int

Read the microsecond-resolution monotonic timer.

Returns:

The current monotonic time in microseconds.

static get_rsl_state() bool

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

Returns:

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

static get_serial_number() str

Return the serial number of the roboRIO.

Returns:

The serial number of the roboRIO.

static get_team_number() int

Returns the team number configured for the robot controller.

Returns:

team number, or 0 if not found.

static get_time() int

Read the microsecond timestamp. By default, the time is based on the monotonic clock. However, the return value of this method may be modified to use any time base, including non-monotonic and non-continuous time bases.

Returns:

The current time in microseconds.

static get_voltage_3v3() float

Get the voltage of the 3.3V rail.

Returns:

The controller 3.3V rail voltage value in Volts

static is_browned_out() bool

Check if the system is browned out.

Returns:

True if the system is browned out

static is_sys_active() bool

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.

static is_system_time_valid() bool

Gets if the system time is valid.

Returns:

True if the system time is valid, false otherwise

static reset_rail_fault_counts() None

Reset the overcurrent fault counters for all user rails to 0.

static set_brownout_voltage(brownout_voltage: wpimath.units.volts) None

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:

brownout_voltage – The brownout voltage

static set_enabled_3v3(enabled: bool) None

Enables or disables the 3.3V rail.

Parameters:

enabled – whether to enable the 3.3V rail.

static set_time_source(supplier: collections.abc.Callable[[], int]) None

Sets a new source to provide the clock time in microseconds. Changing this affects the return value of GetTime.

Parameters:

supplier – Function to return the time in microseconds.