RoboRioSim

class wpilib.simulation.RoboRioSim

Bases: pybind11_object

A utility class to control a simulated RoboRIO.

static getBrownoutVoltage() wpimath.units.volts

Measure the brownout voltage.

Returns:

the brownout voltage

static getCPUTemp() wpimath.units.celsius

Get the cpu temp.

Returns:

the cpu temp.

static getComments() str

Get the comments.

Returns:

The comments.

static getFPGAButton() bool

Query the state of the FPGA button.

Returns:

the FPGA button state

static getRadioLEDState() wpilib._wpilib.RadioLEDState

Get the state of the radio led.

Returns:

The state of the radio led.

static getSerialNumber() str

Get the serial number.

Returns:

The serial number.

static getTeamNumber() int

Get the team number.

Returns:

the team number.

static getUserActive3V3() bool

Get the 3.3V rail active state.

Returns:

true if the 3.3V rail is active

static getUserActive5V() bool

Get the 5V rail active state.

Returns:

true if the 5V rail is active

static getUserActive6V() bool

Get the 6V rail active state.

Returns:

true if the 6V rail is active

static getUserCurrent3V3() wpimath.units.amperes

Measure the 3.3V rail current.

Returns:

the 3.3V rail current

static getUserCurrent5V() wpimath.units.amperes

Measure the 5V rail current.

Returns:

the 5V rail current

static getUserCurrent6V() wpimath.units.amperes

Measure the 6V rail current.

Returns:

the 6V rail current

static getUserFaults3V3() int

Get the 3.3V rail number of faults.

Returns:

number of faults

static getUserFaults5V() int

Get the 5V rail number of faults.

Returns:

number of faults

static getUserFaults6V() int

Get the 6V rail number of faults.

Returns:

number of faults

static getUserVoltage3V3() wpimath.units.volts

Measure the 3.3V rail voltage.

Returns:

the 3.3V rail voltage

static getUserVoltage5V() wpimath.units.volts

Measure the 5V rail voltage.

Returns:

the 5V rail voltage

static getUserVoltage6V() wpimath.units.volts

Measure the 6V rail voltage.

Returns:

the 6V rail voltage

static getVInCurrent() wpimath.units.amperes

Measure the Vin current.

Returns:

the Vin current

static getVInVoltage() wpimath.units.volts

Measure the Vin voltage.

Returns:

the Vin voltage

static registerBrownoutVoltageCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the brownout voltage changes.

Parameters:
  • callback – the callback

  • initialNotify – whether to call the callback with the initial state

Returns:

the CallbackStore object associated with this callback

static registerCPUTempCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the cpu temp changes.

Parameters:
  • callback – the callback

  • initialNotify – whether to call the callback with the initial state

Returns:

the CallbackStore object associated with this callback

static registerFPGAButtonCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run when the FPGA button state changes.

Parameters:
  • callback – the callback

  • initialNotify – whether to run the callback with the initial state

Returns:

the CallbackStore object associated with this callback

static registerRadioLEDStateCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the Radio led state changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerTeamNumberCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the team number changes.

Parameters:
  • callback – the callback

  • initialNotify – whether to call the callback with the initial state

Returns:

the CallbackStore object associated with this callback

static registerUserActive3V3Callback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 3.3V rail active state changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial state

Returns:

the CallbackStore object associated with this callback

static registerUserActive5VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 5V rail active state changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial state

Returns:

the CallbackStore object associated with this callback

static registerUserActive6VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 6V rail active state changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial state

Returns:

the CallbackStore object associated with this callback

static registerUserCurrent3V3Callback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 3.3V rail current changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserCurrent5VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 5V rail current changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserCurrent6VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 6V rail current changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserFaults3V3Callback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 3.3V rail number of faults changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserFaults5VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 5V rail number of faults changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserFaults6VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 6V rail number of faults changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserVoltage3V3Callback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 3.3V rail voltage changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserVoltage5VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 5V rail voltage changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerUserVoltage6VCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the 6V rail voltage changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerVInCurrentCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the Vin current changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

static registerVInVoltageCallback(callback: Callable[[str, hal._wpiHal.Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the Vin voltage changes.

Parameters:
  • callback – the callback

  • initialNotify – whether to call the callback with the initial state

Returns:

the CallbackStore object associated with this callback

static resetData() None

Reset all simulation data.

static setBrownoutVoltage(brownoutVoltage: wpimath.units.volts) None

Define the brownout voltage.

Parameters:

brownoutVoltage – the new voltage

static setCPUTemp(cpuTemp: wpimath.units.celsius) None

Define the cpu temp.

Parameters:

cpuTemp – the new cpu temp.

static setComments(comments: str) None

Set the comments.

Parameters:

comments – The comments.

static setFPGAButton(fPGAButton: bool) None

Define the state of the FPGA button.

Parameters:

fPGAButton – the new state

static setRadioLEDState(state: wpilib._wpilib.RadioLEDState) None

Set the state of the radio led.

Parameters:

state – The state of the radio led.

static setSerialNumber(serialNumber: str) None

Set the serial number.

Parameters:

serialNumber – The serial number.

static setTeamNumber(teamNumber: int) None

Set the team number.

Parameters:

teamNumber – the new team number.

static setUserActive3V3(userActive3V3: bool) None

Set the 3.3V rail active state.

Parameters:

userActive3V3 – true to make rail active

static setUserActive5V(userActive5V: bool) None

Set the 5V rail active state.

Parameters:

userActive5V – true to make rail active

static setUserActive6V(userActive6V: bool) None

Set the 6V rail active state.

Parameters:

userActive6V – true to make rail active

static setUserCurrent3V3(userCurrent3V3: wpimath.units.amperes) None

Define the 3.3V rail current.

Parameters:

userCurrent3V3 – the new current

static setUserCurrent5V(userCurrent5V: wpimath.units.amperes) None

Define the 5V rail current.

Parameters:

userCurrent5V – the new current

static setUserCurrent6V(userCurrent6V: wpimath.units.amperes) None

Define the 6V rail current.

Parameters:

userCurrent6V – the new current

static setUserFaults3V3(userFaults3V3: int) None

Set the 3.3V rail number of faults.

Parameters:

userFaults3V3 – number of faults

static setUserFaults5V(userFaults5V: int) None

Set the 5V rail number of faults.

Parameters:

userFaults5V – number of faults

static setUserFaults6V(userFaults6V: int) None

Set the 6V rail number of faults.

Parameters:

userFaults6V – number of faults

static setUserVoltage3V3(userVoltage3V3: wpimath.units.volts) None

Define the 3.3V rail voltage.

Parameters:

userVoltage3V3 – the new voltage

static setUserVoltage5V(userVoltage5V: wpimath.units.volts) None

Define the 5V rail voltage.

Parameters:

userVoltage5V – the new voltage

static setUserVoltage6V(userVoltage6V: wpimath.units.volts) None

Define the 6V rail voltage.

Parameters:

userVoltage6V – the new voltage

static setVInCurrent(vInCurrent: wpimath.units.amperes) None

Define the Vin current.

Parameters:

vInCurrent – the new current

static setVInVoltage(vInVoltage: wpimath.units.volts) None

Define the Vin voltage.

Parameters:

vInVoltage – the new voltage