YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
yams::telemetry::SmartMotorControllerTelemetryConfig Class Reference

#include <SmartMotorControllerTelemetryConfig.hpp>

Public Types

using TelemetryVerbosity = motorcontrollers::SmartMotorControllerConfig::TelemetryVerbosity
 

Public Member Functions

 SmartMotorControllerTelemetryConfig ()
 
SmartMotorControllerTelemetryConfig & WithDataLogName (const std::string &dataLogName)
 
SmartMotorControllerTelemetryConfig & WithNetworkTables (bool enabled)
 
SmartMotorControllerTelemetryConfig & WithoutNetworkTables ()
 
SmartMotorControllerTelemetryConfig & WithTelemetryVerbosity (TelemetryVerbosity verbosity)
 
SmartMotorControllerTelemetryConfig & WithMechanismLowerLimit ()
 
SmartMotorControllerTelemetryConfig & WithMechanismUpperLimit ()
 
SmartMotorControllerTelemetryConfig & WithTemperatureLimit ()
 
SmartMotorControllerTelemetryConfig & WithVelocityControl ()
 
SmartMotorControllerTelemetryConfig & WithElevatorFeedforward ()
 
SmartMotorControllerTelemetryConfig & WithArmFeedforward ()
 
SmartMotorControllerTelemetryConfig & WithSimpleFeedforward ()
 
SmartMotorControllerTelemetryConfig & WithMotionProfile ()
 
SmartMotorControllerTelemetryConfig & WithSetpointPosition ()
 
SmartMotorControllerTelemetryConfig & WithSetpointVelocity ()
 
SmartMotorControllerTelemetryConfig & WithSetpointForce ()
 
SmartMotorControllerTelemetryConfig & WithCustom (DoubleTelemetryField field, bool enabled)
 
SmartMotorControllerTelemetryConfig & WithCustom (BooleanTelemetryField field, bool enabled)
 
SmartMotorControllerTelemetryConfig & WithCustom (const std::vector< DoubleTelemetryField > &fields, bool enabled)
 
SmartMotorControllerTelemetryConfig & WithCustom (const std::vector< BooleanTelemetryField > &fields, bool enabled)
 
SmartMotorControllerTelemetryConfig & WithVelocityMeasurementDelay ()
 
SmartMotorControllerTelemetryConfig & WithClosedLoopPeriod ()
 
SmartMotorControllerTelemetryConfig & WithOutputVoltage ()
 
SmartMotorControllerTelemetryConfig & WithStatorCurrent ()
 
SmartMotorControllerTelemetryConfig & WithTemperature ()
 
SmartMotorControllerTelemetryConfig & WithMeasurementPosition ()
 
SmartMotorControllerTelemetryConfig & WithMeasurementVelocity ()
 
SmartMotorControllerTelemetryConfig & WithMechanismPosition ()
 
SmartMotorControllerTelemetryConfig & WithMechanismVelocity ()
 
SmartMotorControllerTelemetryConfig & WithRotorPosition ()
 
SmartMotorControllerTelemetryConfig & WithRotorVelocity ()
 
std::optional< std::string > GetDataLogName () const
 
bool GetNT4Enabled () const
 
std::unordered_map< DoubleTelemetryField, DoubleTelemetry< DoubleTelemetryField > > & GetDoubleFields (motorcontrollers::SmartMotorController &smc)
 
std::unordered_map< BooleanTelemetryField, BooleanTelemetry< BooleanTelemetryField > > & GetBoolFields (motorcontrollers::SmartMotorController &smc)
 

Detailed Description

Configures which telemetry fields are published for a SmartMotorController.

Use WithTelemetryVerbosity() for a preset bundle of fields, or enable individual fields with the With*() methods. Pass to SmartMotorController::WithTelemetry().

Quick preset via SmartMotorControllerConfig

// The simplest approach: name the motor in SmartMotorControllerConfig.
// This enables HIGH-verbosity telemetry automatically.
SmartMotorControllerConfig cfg;
cfg.WithTelemetry("ArmMotor"); // HIGH verbosity (default)
cfg.WithTelemetry("ArmMotor", Cfg::TelemetryVerbosity::MID); // or choose a level

Fine-grained override via SmartMotorController::WithTelemetry()

// After constructing the SmartMotorController, supply an explicit config
// to override the preset chosen by SmartMotorControllerConfig::WithTelemetry().
ctre::phoenix6::hardware::TalonFX talon{1};
TalonFXWrapper smc{talon, wpi::math::DCMotor::KrakenX60(1), cfg};
smc.WithTelemetry(
TelCfg{}
.WithTelemetryVerbosity(Cfg::TelemetryVerbosity::MID)
.WithDataLogName("/Robot/Arm/Motor")
.WithoutNetworkTables()); // suppress NT4 during matches
Definition SmartMotorControllerConfig.hpp:65
Definition SmartMotorControllerTelemetryConfig.hpp:63
SmartMotorControllerTelemetryConfig & WithStatorCurrent()
SmartMotorControllerTelemetryConfig & WithMechanismVelocity()
SmartMotorControllerTelemetryConfig & WithOutputVoltage()
SmartMotorControllerTelemetryConfig & WithMechanismPosition()
SmartMotorControllerTelemetryConfig & WithoutNetworkTables()
SmartMotorControllerTelemetryConfig & WithDataLogName(const std::string &dataLogName)

Logging-only (no NT4) with a custom field selection

smc.WithTelemetry(
TelCfg{}
.WithRotorPosition()
.WithDataLogName("/Robot/Shooter/Motor")
SmartMotorControllerTelemetryConfig & WithRotorVelocity()
SmartMotorControllerTelemetryConfig & WithTemperature()

Member Typedef Documentation

◆ TelemetryVerbosity

Constructor & Destructor Documentation

◆ SmartMotorControllerTelemetryConfig()

yams::telemetry::SmartMotorControllerTelemetryConfig::SmartMotorControllerTelemetryConfig ( )

Member Function Documentation

◆ GetBoolFields()

std::unordered_map< BooleanTelemetryField, BooleanTelemetry< BooleanTelemetryField > > & yams::telemetry::SmartMotorControllerTelemetryConfig::GetBoolFields ( motorcontrollers::SmartMotorController &  smc)

◆ GetDataLogName()

std::optional< std::string > yams::telemetry::SmartMotorControllerTelemetryConfig::GetDataLogName ( ) const
Returns
Optional DataLog prefix path if configured.

◆ GetDoubleFields()

std::unordered_map< DoubleTelemetryField, DoubleTelemetry< DoubleTelemetryField > > & yams::telemetry::SmartMotorControllerTelemetryConfig::GetDoubleFields ( motorcontrollers::SmartMotorController &  smc)

Apply motor-controller-specific constraints (disable unsupported fields, set default values from config) and return the configured field maps.

Parameters
smcMotor controller to configure for.

◆ GetNT4Enabled()

bool yams::telemetry::SmartMotorControllerTelemetryConfig::GetNT4Enabled ( ) const
Returns
true if NT4 output is enabled.

◆ WithArmFeedforward()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithArmFeedforward ( )

Enable arm feedforward active flag logging.

Returns
*this for chaining.

◆ WithClosedLoopPeriod()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithClosedLoopPeriod ( )

Enables logging the period the closed-loop controller runs at.

◆ WithCustom() [1/4]

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithCustom ( BooleanTelemetryField  field,
bool  enabled 
)

Escape hatch to enable or disable any boolean field.

Parameters
fieldField to configure.
enabledtrue to enable, false to disable.
Returns
*this for chaining.

◆ WithCustom() [2/4]

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithCustom ( const std::vector< BooleanTelemetryField > &  fields,
bool  enabled 
)

Escape hatch to enable or disable several boolean fields.

Parameters
fieldsFields to configure.
enabledtrue to enable, false to disable.
Returns
*this for chaining.

◆ WithCustom() [3/4]

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithCustom ( const std::vector< DoubleTelemetryField > &  fields,
bool  enabled 
)

Escape hatch to enable or disable several double fields.

Parameters
fieldsFields to configure.
enabledtrue to enable, false to disable.
Returns
*this for chaining.

◆ WithCustom() [4/4]

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithCustom ( DoubleTelemetryField  field,
bool  enabled 
)

Escape hatch to enable or disable any double field.

Parameters
fieldField to configure.
enabledtrue to enable, false to disable.
Returns
*this for chaining.

◆ WithDataLogName()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithDataLogName ( const std::string &  dataLogName)

Set the DataLog prefix for offline recording.

Parameters
dataLogNamePrefix path inside the log.
Returns
*this for chaining.

◆ WithElevatorFeedforward()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithElevatorFeedforward ( )

Enable elevator feedforward active flag logging.

Returns
*this for chaining.

◆ WithMeasurementPosition()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithMeasurementPosition ( )

Enable linear measurement position logging.

Returns
*this for chaining.

◆ WithMeasurementVelocity()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithMeasurementVelocity ( )

Enable linear measurement velocity logging.

Returns
*this for chaining.

◆ WithMechanismLowerLimit()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithMechanismLowerLimit ( )

Enable mechanism lower-limit logging.

Returns
*this for chaining.

◆ WithMechanismPosition()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithMechanismPosition ( )

Enable mechanism angular position logging.

Returns
*this for chaining.

◆ WithMechanismUpperLimit()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithMechanismUpperLimit ( )

Enable mechanism upper-limit logging.

Returns
*this for chaining.

◆ WithMechanismVelocity()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithMechanismVelocity ( )

Enable mechanism angular velocity logging.

Returns
*this for chaining.

◆ WithMotionProfile()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithMotionProfile ( )

Enable motion profile active flag logging.

Returns
*this for chaining.

◆ WithNetworkTables()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithNetworkTables ( bool  enabled)

Enable or disable NT4 output.

Parameters
enabledfalse to suppress NT4 publishing (e.g. during matches).
Returns
*this for chaining.

◆ WithoutNetworkTables()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithoutNetworkTables ( )

Disable NT4 output.

Returns
*this for chaining.

◆ WithOutputVoltage()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithOutputVoltage ( )

Enable output voltage logging.

Returns
*this for chaining.

◆ WithRotorPosition()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithRotorPosition ( )

Enable raw rotor position logging.

Returns
*this for chaining.

◆ WithRotorVelocity()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithRotorVelocity ( )

Enable raw rotor velocity logging.

Returns
*this for chaining.

◆ WithSetpointForce()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithSetpointForce ( )

Enable the feedforward force applied on top of the velocity setpoint.

Returns
*this for chaining.

◆ WithSetpointPosition()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithSetpointPosition ( )

Enable setpoint position logging (read-only).

Returns
*this for chaining.

◆ WithSetpointVelocity()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithSetpointVelocity ( )

Enable setpoint velocity logging (read-only).

Returns
*this for chaining.

◆ WithSimpleFeedforward()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithSimpleFeedforward ( )

Enable simple motor feedforward active flag logging.

Returns
*this for chaining.

◆ WithStatorCurrent()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithStatorCurrent ( )

Enable stator current logging.

Returns
*this for chaining.

◆ WithTelemetryVerbosity()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithTelemetryVerbosity ( TelemetryVerbosity  verbosity)

Enable a preset bundle of fields based on verbosity level.

HIGH includes all MID and LOW fields plus tunable gain entries. MID adds voltage and current fields. LOW enables the core position/velocity/setpoint fields.

Parameters
verbosityVerbosity level to apply.
Returns
*this for chaining.

◆ WithTemperature()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithTemperature ( )

Enable motor temperature logging.

Returns
*this for chaining.

◆ WithTemperatureLimit()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithTemperatureLimit ( )

Enable temperature-limit (over-temp flag) logging.

Returns
*this for chaining.

◆ WithVelocityControl()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithVelocityControl ( )

Enable velocity-control active flag logging.

Returns
*this for chaining.

◆ WithVelocityMeasurementDelay()

SmartMotorControllerTelemetryConfig & yams::telemetry::SmartMotorControllerTelemetryConfig::WithVelocityMeasurementDelay ( )

Enables logging how far behind the measured velocity is, when it is known.


The documentation for this class was generated from the following file: