Class ServoHub
- All Implemented Interfaces:
REVDevice, AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic enumDeprecated, for removal: This API element is subject to removal in a future version.static classNested classes/interfaces inherited from class ServoHubLowLevel
ServoHubLowLevel.FirmwareVersion, ServoHubLowLevel.PeriodicStatus0, ServoHubLowLevel.PeriodicStatus1, ServoHubLowLevel.PeriodicStatus2, ServoHubLowLevel.PeriodicStatus3, ServoHubLowLevel.PeriodicStatus4Nested classes/interfaces inherited from class NativeResourceCleaner
NativeResourceCleaner.OnClean -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ServoHubConfigAccessorAccessor for ServoHub parameter values.Fields inherited from class ServoHubLowLevel
servoHubHandle -
Constructor Summary
ConstructorsConstructorDescriptionServoHub(int busId, int deviceId) Create a new object to control a ServoHub Servo Controller -
Method Summary
Modifier and TypeMethodDescriptionClears all sticky faults.configure(ServoHubConfig config, ResetMode resetMode) Set the configuration for the ServoHub.configure(ServoHubConfig config, ServoHub.ResetMode resetMode) Deprecated, for removal: This API element is subject to removal in a future version.configureAsync(ServoHubConfig config, ServoHub.ResetMode resetMode) Set the configuration for the ServoHub without waiting for a response.Get the active faults that are currently present on the ServoHub.getServoChannel(ServoChannel.ChannelId channelId) Returns an object to control a specific servo channel.Get the sticky faults that were present on the ServoHub at one point since the sticky faults were last cleared.Get the sticky warnings that were present on the ServoHub at one point since the sticky warnings were last cleared.Get the active warnings that are currently present on the ServoHub.Get whether the ServoHub has one or more active faults.Get whether the ServoHub has one or more active warnings.Get whether the ServoHub has one or more sticky faults.Get whether the ServoHub has one or more sticky warnings.setBankPulsePeriod(ServoHub.Bank bank, int pulsePeriod_us) Set the Pulse Period for servo channels 0-2 or servo channels 3-5.Methods inherited from class ServoHubLowLevel
close, createSimFaultManager, GetBusId, getCleanAction, getControlFramePeriodMs, getDeviceId, getFirmwareVersion, getFirmwareVersionString, getPeriodicStatus0, getPeriodicStatus1, getPeriodicStatus2, getPeriodicStatus3, getPeriodicStatus4, setCANMaxRetries, setCANTimeout, setControlFramePeriodMs, setPeriodicFrameTimeout, throwIfClosedMethods inherited from class NativeResourceCleaner
registerCleaner
-
Field Details
-
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, seeServoHubConfigandconfigure(ServoHubConfig, com.revrobotics.ResetMode).NOTE: This uses calls that are blocking to retrieve parameters and should be used infrequently.
-
-
Constructor Details
-
ServoHub
public ServoHub(int busId, int deviceId) Create a new object to control a ServoHub Servo Controller- Parameters:
busId- The CAN bus ID this device will be on.deviceId- The device ID.
-
-
Method Details
-
configure
Set the configuration for the ServoHub.If
resetModeisResetMode.kResetSafeParameters, this method will reset safe writable parameters to their default values before setting the given configuration.- Parameters:
config- The desired ServoHub configurationresetMode- Whether to reset safe parameters before setting the configuration- Returns:
REVLibError.kOkif successful
-
configure
@Deprecated(since="2026", forRemoval=true) public REVLibError configure(ServoHubConfig config, ServoHub.ResetMode resetMode) Deprecated, for removal: This API element is subject to removal in a future version.Useconfigure(ServoHubConfig, com.revrobotics.ResetMode)instead.Set the configuration for the ServoHub.If
resetModeisServoHub.ResetMode.kResetSafeParameters, this method will reset safe writable parameters to their default values before setting the given configuration.- Parameters:
config- The desired ServoHub configurationresetMode- Whether to reset safe parameters before setting the configuration- Returns:
REVLibError.kOkif successful
-
configureAsync
Set the configuration for the ServoHub without waiting for a response.If
resetModeisServoHub.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.kOkand the action will be done in the background. Any errors that occur will be reported to the driver station.- Parameters:
config- The desired ServoHub configurationresetMode- Whether to reset safe parameters before setting the configuration- Returns:
REVLibError.kOk- See Also:
-
hasActiveFault
-
hasStickyFault
-
hasActiveWarning
-
hasStickyWarning
-
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
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
clearFaults().- Returns:
- A struct with each warning and their sticky value
-
clearFaults
-
getDeviceVoltage
-
getDeviceCurrent
-
getServoVoltage
-
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 setpulsePeriod_us- The pulse period in microseconds- Returns:
REVLibError.kOkif successful
-
configure(ServoHubConfig, com.revrobotics.ResetMode)instead.