RoboRioSim¶
- class wpilib.simulation.RoboRioSim¶
Bases:
pybind11_object
A utility class to control a simulated RoboRIO.
- static getBrownoutVoltage() volts ¶
Measure the brownout voltage.
- Returns:
the brownout voltage
- 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 getSerialNumber() str ¶
Get the serial number.
- Returns:
The serial 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() amperes ¶
Measure the 3.3V rail current.
- Returns:
the 3.3V rail current
- static getUserCurrent5V() amperes ¶
Measure the 5V rail current.
- Returns:
the 5V rail current
- static getUserCurrent6V() 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() volts ¶
Measure the 3.3V rail voltage.
- Returns:
the 3.3V rail voltage
- static getUserVoltage5V() volts ¶
Measure the 5V rail voltage.
- Returns:
the 5V rail voltage
- static getUserVoltage6V() volts ¶
Measure the 6V rail voltage.
- Returns:
the 6V rail voltage
- static getVInCurrent() amperes ¶
Measure the Vin current.
- Returns:
the Vin current
- static getVInVoltage() volts ¶
Measure the Vin voltage.
- Returns:
the Vin voltage
- static registerBrownoutVoltageCallback(callback: Callable[[str, HAL_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 registerFPGAButtonCallback(callback: Callable[[str, HAL_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 registerUserActive3V3Callback(callback: Callable[[str, HAL_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_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_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_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_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_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_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_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_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_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_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_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_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_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: volts) None ¶
Define the brownout voltage.
- Parameters:
brownoutVoltage – the new voltage
- 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 setSerialNumber(serialNumber: str) None ¶
Set the serial number.
- Parameters:
serialNumber – The serial 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: amperes) None ¶
Define the 3.3V rail current.
- Parameters:
userCurrent3V3 – the new current
- static setUserCurrent5V(userCurrent5V: amperes) None ¶
Define the 5V rail current.
- Parameters:
userCurrent5V – the new current
- static setUserCurrent6V(userCurrent6V: 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: volts) None ¶
Define the 3.3V rail voltage.
- Parameters:
userVoltage3V3 – the new voltage
- static setUserVoltage5V(userVoltage5V: volts) None ¶
Define the 5V rail voltage.
- Parameters:
userVoltage5V – the new voltage
- static setUserVoltage6V(userVoltage6V: volts) None ¶
Define the 6V rail voltage.
- Parameters:
userVoltage6V – the new voltage
- static setVInCurrent(vInCurrent: amperes) None ¶
Define the Vin current.
- Parameters:
vInCurrent – the new current
- static setVInVoltage(vInVoltage: volts) None ¶
Define the Vin voltage.
- Parameters:
vInVoltage – the new voltage