#include <ServoHub.h>
Inherits rev::servohub::ServoHubLowLevel.
◆ ResetMode
Enumerator |
---|
kNoResetSafeParameters | |
kResetSafeParameters | |
◆ Bank
Enumerator |
---|
kBank0_2 | |
kBank3_5 | |
◆ ServoHub()
ServoHub::ServoHub |
( |
int |
deviceID | ) |
|
|
explicit |
Create a new object to control a ServoHub Servo Controller
- Parameters
-
◆ ~ServoHub()
◆ Configure()
Set the configuration for the ServoHub.
If resetMode
is ResetMode::kResetSafeParameters, this method will reset safe writable parameters to their default values before setting the given configuration.
- Parameters
-
config | The desired ServoHub configuration |
resetMode | Whether to reset safe parameters before setting the configuration |
- Returns
- REVLibError::kOk if successful
◆ ConfigureAsync()
Set the configuration for the ServoHub without waiting for a response.
If resetMode
is ResetMode::kResetSafeParameters, this method will reset safe writable parameters to their default values before setting the given configuration.
NOTE: This method will immediately return REVLibError::kOk and the action will be done in the background. Any errors that occur will be reported to the driver station.
- Parameters
-
config | The desired ServoHub configuration |
resetMode | Whether to reset safe parameters before setting the configuration |
- Returns
- REVLibError::kOk
- See also
- Configure()
◆ HasActiveFault()
bool ServoHub::HasActiveFault |
( |
| ) |
const |
Get whether the ServoHub has one or more active faults.
- Returns
- true if there is an active fault
- See also
- GetFaults()
◆ HasStickyFault()
bool ServoHub::HasStickyFault |
( |
| ) |
const |
◆ HasActiveWarning()
bool ServoHub::HasActiveWarning |
( |
| ) |
const |
Get whether the ServoHub has one or more active warnings.
- Returns
- true if there is an active warning
- See also
- GetWarnings()
◆ HasStickyWarning()
bool ServoHub::HasStickyWarning |
( |
| ) |
const |
◆ GetFaults()
Get the active faults that are currently present on the ServoHub. Faults are fatal errors that prevent the motor from running.
- Returns
- A struct with each fault and their active value
◆ GetStickyFaults()
Get the sticky faults that were present on the ServoHub at one point since the sticky faults were last cleared. Faults are fatal errors that prevent the motor from running.
Sticky faults can be cleared with ServoHub::ClearFaults().
- Returns
- A struct with each fault and their sticky value
◆ GetWarnings()
Get the active warnings that are currently present on the ServoHub. Warnings are non-fatal errors.
- Returns
- A struct with each warning and their active value
◆ GetStickyWarnings()
Get the sticky warnings that were present on the ServoHub at one point since the sticky warnings were last cleared. Warnings are non-fatal errors.
Sticky warnings can be cleared with ServoHub::clearFaults().
- Returns
- A struct with each warning and their sticky value
◆ ClearFaults()
Clears all non-sticky faults.
Sticky faults must be cleared by resetting the motor controller.
◆ GetDeviceVoltage()
double ServoHub::GetDeviceVoltage |
( |
| ) |
const |
- Returns
- The voltage fed into the servo controller.
◆ GetDeviceCurrent()
double ServoHub::GetDeviceCurrent |
( |
| ) |
const |
- Returns
- The servo controller's output current in Amps.
◆ GetServoVoltage()
double ServoHub::GetServoVoltage |
( |
| ) |
const |
- Returns
- The voltage fed to the actual servos.
◆ GetServoChannel()
Returns an object to control a specific servo channel.
- Parameters
-
channelId | The specific servo channel to get |
- Returns
- The specified ServoChannel
◆ SetBankPulsePeriod()
Set the Pulse Period for servo channels 0-2 or servo channels 3-5.
- Parameters
-
bank | The bank of channels (0-2 or 3-5) to set |
pulsePeriod_us | The pulse period in microseconds |
- Returns
- REVLibError::kOk if successful
◆ ServoHubSim
◆ configAccessor
Accessor for ServoHub parameter values. This object contains fields and methods to retrieve parameters that have been applied to the device. To set parameters, see ServoHubConfig and ServoHub::Configure().
NOTE: This uses calls that are blocking to retrieve parameters and should be used infrequently.
The documentation for this class was generated from the following files: