Class ToFParamsConfigs

java.lang.Object
com.ctre.phoenix6.configs.ToFParamsConfigs
All Implemented Interfaces:
ParentConfiguration, Cloneable

public class ToFParamsConfigs extends Object implements ParentConfiguration, Cloneable
Configs that affect the ToF sensor

Includes Update mode and frequency

  • Field Details

    • UpdateMode

      public UpdateModeValue UpdateMode
      Update mode of the CANrange. The CANrange supports short-range and long-range detection at various update frequencies.
    • UpdateFrequency

      public double UpdateFrequency
      Rate at which the CANrange will take measurements. A lower frequency may provide more stable readings but will reduce the data rate of the sensor.
      • Minimum Value: 5
      • Maximum Value: 50
      • Default Value: 50
      • Units: Hz
  • Constructor Details

    • ToFParamsConfigs

      public ToFParamsConfigs()
  • Method Details

    • withUpdateMode

      public final ToFParamsConfigs withUpdateMode(UpdateModeValue newUpdateMode)
      Modifies this configuration's UpdateMode parameter and returns itself for method-chaining and easier to use config API.

      Update mode of the CANrange. The CANrange supports short-range and long-range detection at various update frequencies.

      Parameters:
      newUpdateMode - Parameter to modify
      Returns:
      Itself
    • withUpdateFrequency

      public final ToFParamsConfigs withUpdateFrequency(double newUpdateFrequency)
      Modifies this configuration's UpdateFrequency parameter and returns itself for method-chaining and easier to use config API.

      Rate at which the CANrange will take measurements. A lower frequency may provide more stable readings but will reduce the data rate of the sensor.

      • Minimum Value: 5
      • Maximum Value: 50
      • Default Value: 50
      • Units: Hz
      Parameters:
      newUpdateFrequency - Parameter to modify
      Returns:
      Itself
    • withUpdateFrequency

      public final ToFParamsConfigs withUpdateFrequency(Frequency newUpdateFrequency)
      Modifies this configuration's UpdateFrequency parameter and returns itself for method-chaining and easier to use config API.

      Rate at which the CANrange will take measurements. A lower frequency may provide more stable readings but will reduce the data rate of the sensor.

      • Minimum Value: 5
      • Maximum Value: 50
      • Default Value: 50
      • Units: Hz
      Parameters:
      newUpdateFrequency - Parameter to modify
      Returns:
      Itself
    • getUpdateFrequencyMeasure

      public final Frequency getUpdateFrequencyMeasure()
      Helper method to get this configuration's UpdateFrequency parameter converted to a unit type. If not using the Java units library, UpdateFrequency can be accessed directly instead.

      Rate at which the CANrange will take measurements. A lower frequency may provide more stable readings but will reduce the data rate of the sensor.

      • Minimum Value: 5
      • Maximum Value: 50
      • Default Value: 50
      • Units: Hz
      Returns:
      UpdateFrequency
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public final String serialize()
      Get the serialized form of this configuration group.
      Specified by:
      serialize in interface ParentConfiguration
      Returns:
      Serialized form of this config group
    • deserialize

      public final StatusCode deserialize(String to_deserialize)
      Take a string and deserialize it to this configuration group.
      Specified by:
      deserialize in interface ParentConfiguration
      Parameters:
      to_deserialize - The serialized configuration
      Returns:
      Return code of the deserialize method
    • clone

      public ToFParamsConfigs clone()
      Overrides:
      clone in class Object