Class AbstractConfig
- Direct Known Subclasses:
AbstractSubsystemConfig,DpadTargetConfig,DriverControllerConfig,FeedforwardConfig,MotorConfig,PidConfig,PoseFilterConfig,SetAndSeekMotionConfig,SysIdRoutineConfig,TrenchZoneConfig,TriggerBindingsConfig,VelocityMotionConfig
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDescribes the 3D pivot offset for an articulated component in AdvantageScope. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a config base and derives the default SmartDashboard prefix from the class name. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the current SmartDashboard prefix used for tunable key resolution.voidRecursively sets the SmartDashboard prefix on nestedAbstractConfigfields so their tunable keys appear under the parent's namespace.protected booleanreadTunableBoolean(String key, boolean defaultValue) Reads a tunable boolean backed by AdvantageKit's logged network inputs so tweaks are captured in logs and respected during replay, but still falls back to the default when attached to FMS to avoid match-time latency.protected doublereadTunableDegrees(String key, double fallbackDegrees) Reads a tunable number that represents degrees.protected doublereadTunableDegreesAsRadians(String key, double fallbackDegrees) Reads a tunable number stored in degrees and returns the value in radians.protected doublereadTunableNumber(String key, double defaultValue) Reads a tunable number backed by AdvantageKit's logged network inputs so tweaks are captured in logs and respected during replay, but still falls back to the default when attached to FMS to avoid match-time latency.protected StringreadTunableString(String key, String defaultValue) Reads a tunable string backed by AdvantageKit's logged network inputs so tweaks are captured in logs and respected during replay, but still falls back to the default when attached to FMS to avoid match-time latency.voidsetDashboardPrefix(String prefix) Overrides the SmartDashboard prefix used for tunable key resolution.
-
Constructor Details
-
AbstractConfig
protected AbstractConfig()Creates a config base and derives the default SmartDashboard prefix from the class name.Subclasses should call this implicitly when deserialized from JSON.
-
-
Method Details
-
setDashboardPrefix
Overrides the SmartDashboard prefix used for tunable key resolution.Call this after Jackson deserialization to propagate a parent config's prefix into nested config objects so their tunable keys appear under the parent's namespace (e.g.,
FeederSubsystem/pid/kPinstead ofPid/kP).- Parameters:
prefix- the new dashboard prefix including a trailing slash (e.g.,"FeederSubsystem/pid/")
-
initializeNestedDashboardPrefixes
public void initializeNestedDashboardPrefixes()Recursively sets the SmartDashboard prefix on nestedAbstractConfigfields so their tunable keys appear under the parent's namespace.Call this after Jackson deserialization. For each public field of type
AbstractConfig(that is not anAbstractSubsystemConfig), the method sets the field's prefix toparentPrefix + fieldName + "/"and then recurses into that field. Arrays ofAbstractConfigare also handled: each element receives a prefix ofparentPrefix + fieldName + "/" + index + "/"so that every element has unique tunable keys. Subsystem configs are skipped because they own their own prefix based on their class name. -
getDashboardPrefix
Returns the current SmartDashboard prefix used for tunable key resolution.- Returns:
- the dashboard prefix (includes trailing slash)
-
readTunableNumber
Reads a tunable number backed by AdvantageKit's logged network inputs so tweaks are captured in logs and respected during replay, but still falls back to the default when attached to FMS to avoid match-time latency. Warning: when FMS is attached, this short-circuits to the default and does not create or read any dashboard entry.- Parameters:
key- dashboard key suffix to read (class prefix is applied automatically)defaultValue- fallback value used when FMS is attached or no entry exists- Returns:
- latest tunable number or the provided default when FMS is attached
-
readTunableBoolean
Reads a tunable boolean backed by AdvantageKit's logged network inputs so tweaks are captured in logs and respected during replay, but still falls back to the default when attached to FMS to avoid match-time latency. Warning: when FMS is attached, this short-circuits to the default and does not create or read any dashboard entry.- Parameters:
key- dashboard key suffix to read (class prefix is applied automatically)defaultValue- fallback value used when FMS is attached or no entry exists- Returns:
- latest tunable boolean or the provided default when FMS is attached
-
readTunableString
Reads a tunable string backed by AdvantageKit's logged network inputs so tweaks are captured in logs and respected during replay, but still falls back to the default when attached to FMS to avoid match-time latency. Warning: when FMS is attached, this short-circuits to the default and does not create or read any dashboard entry.- Parameters:
key- dashboard key suffix to read (class prefix is applied automatically)defaultValue- fallback value used when FMS is attached or no entry exists- Returns:
- latest tunable string or the provided default when FMS is attached
-
readTunableDegrees
Reads a tunable number that represents degrees.Use this helper when the stored value is in degrees so all configs share the same conversion pattern.
- Parameters:
key- dashboard key suffix to read (class prefix is applied automatically)fallbackDegrees- fallback value in degrees used when FMS is attached or no entry exists- Returns:
- latest tunable value in degrees, or the provided fallback when FMS is attached
-
readTunableDegreesAsRadians
Reads a tunable number stored in degrees and returns the value in radians.Call this when your config stores angles in degrees but your subsystem expects radians.
- Parameters:
key- dashboard key suffix to read (class prefix is applied automatically)fallbackDegrees- fallback value in degrees used when FMS is attached or no entry exists- Returns:
- latest tunable value in radians, or the provided fallback when FMS is attached
-