RoboRioSim
- class wpilib.simulation.RoboRioSim
Bases:
pybind11_objectA 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 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 getUserCurrent3V3() wpimath.units.amperes
Measure the 3.3V rail current.
- Returns:
the 3.3V rail current
- static getUserFaults3V3() int
Get the 3.3V 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 getVInVoltage() wpimath.units.volts
Measure the Vin voltage.
- Returns:
the Vin voltage
- static registerBrownoutVoltageCallback(callback: collections.abc.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: collections.abc.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 registerTeamNumberCallback(callback: collections.abc.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: collections.abc.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 registerUserCurrent3V3Callback(callback: collections.abc.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 registerUserFaults3V3Callback(callback: collections.abc.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 registerUserVoltage3V3Callback(callback: collections.abc.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 registerVInVoltageCallback(callback: collections.abc.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 setSerialNumber(serialNumber: str) None
Set the serial number.
- Parameters:
serialNumber – The serial number.
- static setTeamNumber(teamNumber: SupportsInt | SupportsIndex) 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 setUserCurrent3V3(userCurrent3V3: wpimath.units.amperes) None
Define the 3.3V rail current.
- Parameters:
userCurrent3V3 – the new current
- static setUserFaults3V3(userFaults3V3: SupportsInt | SupportsIndex) None
Set the 3.3V rail number of faults.
- Parameters:
userFaults3V3 – number of faults
- static setUserVoltage3V3(userVoltage3V3: wpimath.units.volts) None
Define the 3.3V rail voltage.
- Parameters:
userVoltage3V3 – the new voltage
- static setVInVoltage(vInVoltage: wpimath.units.volts) None
Define the Vin voltage.
- Parameters:
vInVoltage – the new voltage