#include <SwerveModuleTelemetryConfig.hpp>
Swerve module telemetry configuration.
Use this builder to select exactly which fields are published to NetworkTables and/or DataLog. Every field is disabled by default; call the individual With*() methods to opt in, or use WithTelemetryVerbosity() to enable a predefined set.
Example
Definition SwerveModuleTelemetryConfig.hpp:37
SwerveModuleTelemetryConfig()
SwerveModuleTelemetryConfig & WithState()
SwerveModuleTelemetryConfig & WithTelemetryVerbosity(TelemetryVerbosity verbosity)
SwerveModuleTelemetryConfig & WithAbsoluteEncoder()
SwerveModuleTelemetryConfig & WithoutNetworkTables()
SwerveModuleTelemetryConfig & WithDataLogName(const std::string &dataLogName)
◆ TelemetryVerbosity
◆ DoubleTelemetryField
Double telemetry field for a SwerveModule.
| Enumerator |
|---|
| AbsoluteEncoder | Absolute encoder angle, without offsets applied, in degrees.
|
◆ StructTelemetryField
Struct telemetry field for a SwerveModule, backed by wpi::math::SwerveModuleVelocity.
| Enumerator |
|---|
| State | Measured SwerveModuleState of the module.
|
◆ SwerveModuleTelemetryConfig() [1/2]
| yams::telemetry::SwerveModuleTelemetryConfig::SwerveModuleTelemetryConfig |
( |
| ) |
|
◆ SwerveModuleTelemetryConfig() [2/2]
| yams::telemetry::SwerveModuleTelemetryConfig::SwerveModuleTelemetryConfig |
( |
TelemetryVerbosity |
verbosity | ) |
|
|
explicit |
Construct with a verbosity preset.
- Parameters
-
| verbosity | TelemetryVerbosity to use by default. |
◆ GetDataLogName()
| std::optional< std::string > yams::telemetry::SwerveModuleTelemetryConfig::GetDataLogName |
( |
| ) |
const |
- Returns
- Optional DataLog entry name.
◆ GetDoubleFields()
◆ GetNT4Enabled()
| bool yams::telemetry::SwerveModuleTelemetryConfig::GetNT4Enabled |
( |
| ) |
const |
- Returns
- true if NT4 output is enabled.
◆ GetStructFields()
- Returns
- Configured StructTelemetry<SwerveModuleState> for each StructTelemetryField.
◆ WithAbsoluteEncoder()
Enables the absolute encoder angle logging.
- Returns
- *this for chaining.
◆ WithCustom() [1/4]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ WithCustom() [2/4]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ WithCustom() [3/4]
Escape hatch for unimplemented fields which should be enabled or disabled.
- Parameters
-
| field | Field to configure. |
| value | Enable on true, disable on false. |
- Returns
- *this for chaining.
◆ WithCustom() [4/4]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ WithDataLogName()
Set up a DataLog entry for this module.
- Parameters
-
| dataLogName | DataLog entry name. |
- Returns
- *this for chaining.
◆ WithNetworkTables()
Enable or disable NT4 telemetry. This will not create NT4 entries and is generally only advisable during competition matches.
- Parameters
-
| enabled | true to enable NT4 output. |
- Returns
- *this for chaining.
◆ WithoutNetworkTables()
Disable NetworkTable output.
- Returns
- *this for chaining.
◆ WithState()
Enables the SwerveModuleState logging.
- Returns
- *this for chaining.
◆ WithTelemetryVerbosity()
Enable a preset bundle of fields based on verbosity level.
- Parameters
-
| verbosity | Verbosity level to apply. |
- Returns
- *this for chaining.
The documentation for this class was generated from the following file: