REVLib - C++
rev::servohub::ServoHubSim Class Reference

#include <ServoHubSim.h>

Public Member Functions

 ServoHubSim (ServoHub *servoHub)
 
double GetDeviceVoltage () const
 
void SetDeviceVoltage (double voltage)
 
double GetDeviceCurrent () const
 
void SetDeviceCurrent (double current)
 
double GetServoVoltage () const
 
void SetServoVoltage (double voltage)
 
int GetBankPulsePeriod (ServoHub::Bank bank) const
 
void SetBankPulsePeriod (ServoHub::Bank bank, int pulsePeriod_us)
 
void enable ()
 
void disable ()
 
void useDriverStationEnable ()
 
ServoHubSimFaultManager GetFaultManager ()
 

Constructor & Destructor Documentation

◆ ServoHubSim()

ServoHubSim::ServoHubSim ( ServoHub servoHub)
explicit

Create a simulated CAN Servo Hub object. This class simulates some of the internal behavior of the device. This class is not required to display to the sim GUI, but is required to interact with it.

Parameters
servoHubThe Servo Hub to simulate

Member Function Documentation

◆ GetDeviceVoltage()

double ServoHubSim::GetDeviceVoltage ( ) const

Get the simulated device voltage output. This matches the value from the ServoHub::GetDeviceVoltage().

Returns
device voltage in volts

◆ SetDeviceVoltage()

void ServoHubSim::SetDeviceVoltage ( double  voltage)

Set the simulated device voltage.

Parameters
voltagedevice voltage in volts

◆ GetDeviceCurrent()

double ServoHubSim::GetDeviceCurrent ( ) const

Get the simulated device current output. This matches the value from the ServoHub::GetDeviceCurrent().

Returns
device current in amps

◆ SetDeviceCurrent()

void ServoHubSim::SetDeviceCurrent ( double  current)

Set the simulated device current.

Parameters
currentdevice current in amps

◆ GetServoVoltage()

double ServoHubSim::GetServoVoltage ( ) const

Get the simulated servo voltage output. This matches the value from the ServoHub::GetServoVoltage().

Returns
servo voltage in volts

◆ SetServoVoltage()

void ServoHubSim::SetServoVoltage ( double  voltage)

Set the simulated device voltage.

Parameters
voltagedevice voltage in volts

◆ GetBankPulsePeriod()

int ServoHubSim::GetBankPulsePeriod ( ServoHub::Bank  bank) const

Get the simulated bank pulse period. This matches the value from the ServoHub::GetBankPulsePeriod().

Parameters
bankthe specific bank (0-2, or 3-5)to get
Returns
pulse period (in microseconds)for the specified bank

◆ SetBankPulsePeriod()

void ServoHubSim::SetBankPulsePeriod ( ServoHub::Bank  bank,
int  pulsePeriod_us 
)

Set the simulated bank pulse period

Parameters
bankthe specific bank (0-2, or 3-5)to get
pulsePeriod_uspulse period (in microseconds)for the specified bank

◆ enable()

void ServoHubSim::enable ( )

Enable the Servo Hub Device.

◆ disable()

void ServoHubSim::disable ( )

Disable the Servo Hub Device

◆ useDriverStationEnable()

void ServoHubSim::useDriverStationEnable ( )

Use the driver station enable as the method to enable/disable the Servo Hub. This is the default, so you do not need to call this unless you previously called enable() or disable().

◆ GetFaultManager()

ServoHubSimFaultManager ServoHubSim::GetFaultManager ( )

Get the ServoHubSimFaultManager object associated with this Servo Hub Device. This will allow you to set simulated faults on your simulated device and view the Fault Manager in the Sim GUI.

Returns
The ServoHubSimFaultManager object associated with this Servo Hub Device

The documentation for this class was generated from the following files: