Class SignalsConfig

java.lang.Object
com.revrobotics.spark.config.BaseConfig
com.revrobotics.spark.config.SignalsConfig

public class SignalsConfig extends BaseConfig
  • Constructor Details

    • SignalsConfig

      public SignalsConfig()
  • Method Details

    • apply

      public SignalsConfig apply(SignalsConfig config)
      Applies settings from another SignalsConfig to this one.

      Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.

      Parameters:
      config - The SignalsConfig to copy settings from
      Returns:
      The updated SignalsConfig for method chaining
    • appliedOutputPeriodMs

      public SignalsConfig appliedOutputPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by CANSparkBase.getAppliedOutput(). The default period is 10ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      NOTE: Applied output is used by other SPARK devices in follower mode. Setting too long of a period should be avoided if this SPARK device is the leader, as it can degrade follower mode performance.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • appliedOutputAlwaysOn

      @Deprecated public SignalsConfig appliedOutputAlwaysOn(boolean enabled)
      Deprecated.
      Calling this method will have no effect, as status 0 cannot be disabled.
      Set whether to always enable the status frame that provides the signal returned by CANSparkBase.getAppliedOutput().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • busVoltagePeriodMs

      public SignalsConfig busVoltagePeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by CANSparkBase.getBusVoltage(). The default period is 10ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      NOTE: This signal shares a status frame with applied output which is used by other SPARK devices in follower mode. Setting too long of a period should be avoided if this SPARK device is the leader, as it can degrade follower mode performance.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • busVoltageAlwaysOn

      @Deprecated public SignalsConfig busVoltageAlwaysOn(boolean enabled)
      Deprecated.
      Calling this method will have no effect, as status 0 cannot be disabled.
      Set whether to always enable the status frame that provides the signal returned by CANSparkBase.getBusVoltage().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • outputCurrentPeriodMs

      public SignalsConfig outputCurrentPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by CANSparkBase.getOutputCurrent(). The default period is 10ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      NOTE: This signal shares a status frame with applied output which is used by other SPARK devices in follower mode. Setting too long of a period should be avoided if this SPARK device is the leader, as it can degrade follower mode performance.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • outputCurrentAlwaysOn

      @Deprecated public SignalsConfig outputCurrentAlwaysOn(boolean enabled)
      Deprecated.
      Calling this method will have no effect, as status 0 cannot be disabled.
      Set whether to always enable the status frame that provides the signal returned by CANSparkBase.getOutputCurrent().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • motorTemperaturePeriodMs

      public SignalsConfig motorTemperaturePeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by CANSparkBase.getMotorTemperature(). The default period is 10ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      NOTE: This signal shares a status frame with applied output which is used by other SPARK devices in follower mode. Setting too long of a period should be avoided if this SPARK device is the leader, as it can degrade follower mode performance.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • motorTemperatureAlwaysOn

      @Deprecated public SignalsConfig motorTemperatureAlwaysOn(boolean enabled)
      Deprecated.
      Calling this method will have no effect, as status 0 cannot be disabled.
      Set whether to always enable the status frame that provides the signal returned by CANSparkBase.getMotorTemperature().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • limitsPeriodMs

      public SignalsConfig limitsPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkLimitSwitch.isPressed(). The default period is 10ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      NOTE: This signal shares a status frame with applied output which is used by other SPARK devices in follower mode. Setting too long of a period should be avoided if this SPARK device is the leader, as it can degrade follower mode performance.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • limitsAlwaysOn

      @Deprecated public SignalsConfig limitsAlwaysOn(boolean enabled)
      Deprecated.
      Calling this method will have no effect, as status 0 cannot be disabled.
      Set whether to always enable the status frame that provides the signal returned by SparkLimitSwitch.isPressed().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • faultsPeriodMs

      public SignalsConfig faultsPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by CANSparkBase.getFaults() and CANSparkBase.getStickyFaults(). The default period is 250ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • faultsAlwaysOn

      public SignalsConfig faultsAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by CANSparkBase.getFaults() and CANSparkBase.getStickyFaults().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • warningsPeriodMs

      public SignalsConfig warningsPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by CANSparkBase.getWarnings() and CANSparkBase.getStickyWarnings(). The default period is 250ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • warningsAlwaysOn

      public SignalsConfig warningsAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by CANSparkBase.getWarnings() and CANSparkBase.getStickyWarnings().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • primaryEncoderVelocityPeriodMs

      public SignalsConfig primaryEncoderVelocityPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkRelativeEncoder.getVelocity(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • primaryEncoderVelocityAlwaysOn

      public SignalsConfig primaryEncoderVelocityAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkRelativeEncoder.getVelocity().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • primaryEncoderPositionPeriodMs

      public SignalsConfig primaryEncoderPositionPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkRelativeEncoder.getPosition(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • primaryEncoderPositionAlwaysOn

      public SignalsConfig primaryEncoderPositionAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkRelativeEncoder.getPosition().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • analogVoltagePeriodMs

      public SignalsConfig analogVoltagePeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkAnalogSensor.getVoltage(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • analogVoltageAlwaysOn

      public SignalsConfig analogVoltageAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkAnalogSensor.getVoltage().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • analogVelocityPeriodMs

      public SignalsConfig analogVelocityPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkAnalogSensor.getVelocity(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • analogVelocityAlwaysOn

      public SignalsConfig analogVelocityAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkAnalogSensor.getVelocity().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • analogPositionPeriodMs

      public SignalsConfig analogPositionPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkAnalogSensor.getPosition(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • analogPositionAlwaysOn

      public SignalsConfig analogPositionAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkAnalogSensor.getPosition().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • externalOrAltEncoderVelocity

      public SignalsConfig externalOrAltEncoderVelocity(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkFlexExternalEncoder.getVelocity() or SparkMaxAlternateEncoder.getVelocity(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • externalOrAltEncoderVelocityAlwaysOn

      public SignalsConfig externalOrAltEncoderVelocityAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkFlexExternalEncoder.getVelocity() or SparkMaxAlternateEncoder.getVelocity().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • externalOrAltEncoderPosition

      public SignalsConfig externalOrAltEncoderPosition(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkFlexExternalEncoder.getPosition() or SparkMaxAlternateEncoder.getPosition(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • externalOrAltEncoderPositionAlwaysOn

      public SignalsConfig externalOrAltEncoderPositionAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkFlexExternalEncoder.getPosition() or SparkMaxAlternateEncoder.getPosition().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • absoluteEncoderVelocityPeriodMs

      public SignalsConfig absoluteEncoderVelocityPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkAbsoluteEncoder.getVelocity(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • absoluteEncoderVelocityAlwaysOn

      public SignalsConfig absoluteEncoderVelocityAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkAbsoluteEncoder.getVelocity().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • absoluteEncoderPositionPeriodMs

      public SignalsConfig absoluteEncoderPositionPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkAbsoluteEncoder.getPosition(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • absoluteEncoderPositionAlwaysOn

      public SignalsConfig absoluteEncoderPositionAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkAbsoluteEncoder.getPosition().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining
    • iAccumulationPeriodMs

      public SignalsConfig iAccumulationPeriodMs(int periodMs)
      Set the period (ms) of the status frame that provides the signal returned by SparkClosedLoopController.getIAccum(). The default period is 20ms.

      If multiple periods are set for signals within the same status frame, the minimum given value will be used.

      Parameters:
      periodMs - The period in milliseconds
      Returns:
      The modified SignalsConfig object for method chaining
    • iAccumulationAlwaysOn

      public SignalsConfig iAccumulationAlwaysOn(boolean enabled)
      Set whether to always enable the status frame that provides the signal returned by SparkClosedLoopController.getIAccum().

      Status frames are only enabled when a signal is requested via its respective getter method, and there may be a small period of time where the signal's data is unavailable due to waiting for the SPARK to receive the command to enable the status frame. Use this method to enable the status frame at all times.

      If multiple alwaysOn values are set for signals within the same status frame, the result from OR'ing the values will be used.

      Parameters:
      enabled - True to always enable the status frame
      Returns:
      The modified SignalsConfig object for method chaining