RoboRioSim

class wpilib.simulation.RoboRioSim

Bases: pybind11_object

A utility class to control a simulated RoboRIO.

static get_brownout_voltage() wpimath.units.volts

Measure the brownout voltage.

Returns:

the brownout voltage

static get_comments() str

Get the comments.

Returns:

The comments.

static get_cpu_temp() wpimath.units.celsius

Get the cpu temp.

Returns:

the cpu temp.

static get_serial_number() str

Get the serial number.

Returns:

The serial number.

static get_team_number() int

Get the team number.

Returns:

the team number.

static get_user_active_3v3() bool

Get the 3.3V rail active state.

Returns:

true if the 3.3V rail is active

static get_user_current_3v3() wpimath.units.amperes

Measure the 3.3V rail current.

Returns:

the 3.3V rail current

static get_user_faults_3v3() int

Get the 3.3V rail number of faults.

Returns:

number of faults

static get_user_voltage_3v3() wpimath.units.volts

Measure the 3.3V rail voltage.

Returns:

the 3.3V rail voltage

static get_vin_voltage() wpimath.units.volts

Measure the Vin voltage.

Returns:

the Vin voltage

static register_brownout_voltage_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static register_cpu_temp_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static register_team_number_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static register_user_active_3v3_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static register_user_current_3v3_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static register_user_faults_3v3_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static register_user_voltage_3v3_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static register_vin_voltage_callback(callback: collections.abc.Callable[[str, hal._wpi_hal.Value], None], initial_notify: bool) wpilib.simulation._simulation.CallbackStore

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

Parameters:
  • callback – the callback

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

Returns:

the CallbackStore object associated with this callback

static reset_data() None

Reset all simulation data.

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

Define the brownout voltage.

Parameters:

brownout_voltage – the new voltage

static set_comments(comments: str) None

Set the comments.

Parameters:

comments – The comments.

static set_cpu_temp(cpu_temp: wpimath.units.celsius) None

Define the cpu temp.

Parameters:

cpu_temp – the new cpu temp.

static set_serial_number(serial_number: str) None

Set the serial number.

Parameters:

serial_number – The serial number.

static set_team_number(team_number: SupportsInt | SupportsIndex) None

Set the team number.

Parameters:

team_number – the new team number.

static set_user_active_3v3(user_active_3v3: bool) None

Set the 3.3V rail active state.

Parameters:

user_active_3v3 – true to make rail active

static set_user_current_3v3(user_current_3v3: wpimath.units.amperes) None

Define the 3.3V rail current.

Parameters:

user_current_3v3 – the new current

static set_user_faults_3v3(user_faults_3v3: SupportsInt | SupportsIndex) None

Set the 3.3V rail number of faults.

Parameters:

user_faults_3v3 – number of faults

static set_user_voltage_3v3(user_voltage_3v3: wpimath.units.volts) None

Define the 3.3V rail voltage.

Parameters:

user_voltage_3v3 – the new voltage

static set_vin_voltage(v_in_voltage: wpimath.units.volts) None

Define the Vin voltage.

Parameters:

v_in_voltage – the new voltage