YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
yams::telemetry Namespace Reference

Classes

class  MechanismTelemetry
struct  UnsupportedTelemetryFields
class  DoubleTelemetry
class  BooleanTelemetry
class  SmartMotorControllerTelemetry
class  SmartMotorControllerTelemetryConfig
class  StringTelemetry
class  StructArrayTelemetry
class  StructTelemetry
class  SwerveDriveTelemetry
class  SwerveDriveTelemetryConfig
class  SwerveModuleTelemetry
class  SwerveModuleTelemetryConfig

Enumerations

enum class  DoubleTelemetryField {
  ExponentialProfileKV , ExponentialProfileKA , ExponentialProfileMaxInput , TrapezoidalProfileMaxVelocity ,
  TrapezoidalProfileMaxAcceleration , TrapezoidalProfileMaxJerk , TunableClosedLoopControllerSlot , ActiveClosedLoopControllerSlot ,
  kS , kV , kA , kG ,
  kP , kI , kD , LQRQelmsPosition ,
  LQRQelmsVelocity , LQRRelms , LQRModelPosition , LQRModelVelocity ,
  LQREncoderPosition , LQREncoderVelocity , LQRMaxVoltage , ADRCDisturbance ,
  ADRCBandwidth , ADRCObserverBandwidth , ADRCSystemOrder , ADRCB0 ,
  ADRCSettlingTime , ADRCBandwidthScale , TunableSetpointPosition , SetpointPosition ,
  TunableSetpointVelocity , SetpointVelocity , SetpointForce , ClosedLoopPeriod ,
  VelocityMeasurementDelay , TunableVoltage , OutputVoltage , StatorCurrent ,
  StatorCurrentLimit , SupplyCurrent , SupplyCurrentLimit , MotorTemperature ,
  MeasurementPosition , MeasurementCircumference , MeasurementVelocity , MeasurementAcceleration ,
  MeasurementLowerLimit , MeasurementUpperLimit , MechanismPosition , MechanismVelocity ,
  MechanismAcceleration , MechanismLowerLimit , MechanismUpperLimit , RotorPosition ,
  RotorVelocity , RotorGearRatio , ExternalEncoderPosition , ExternalEncoderVelocity ,
  ClosedloopRampRate , OpenloopRampRate
}
enum class  BooleanTelemetryField {
  MechanismUpperLimit , MechanismLowerLimit , TemperatureLimit , VelocityControl ,
  ElevatorFeedForward , ArmFeedForward , SimpleMotorFeedForward , MotionProfile ,
  MotorInversion , EncoderInversion , TunableVoltageEnabled
}

Functions

double LQRToSI (math::LQRConfig::LQRType type, bool position, double value)
double LQRFromSI (math::LQRConfig::LQRType type, bool position, double value)
void EnsureMechanismsTelemetryBackend ()
void EnsureMechanismsTunableBackend ()
void EnsureTuningTunableBackend ()

Enumeration Type Documentation

◆ BooleanTelemetryField

Identifies a boolean-valued telemetry field published by a SmartMotorController.

Enumerator
MechanismUpperLimit 

true when the mechanism is at or past its upper angular limit.

MechanismLowerLimit 

true when the mechanism is at or past its lower angular limit.

TemperatureLimit 

true when the motor temperature has reached the cutoff threshold.

VelocityControl 

true when a velocity setpoint is active.

ElevatorFeedForward 

true when an elevator feedforward model is configured.

ArmFeedForward 

true when an arm feedforward model is configured.

SimpleMotorFeedForward 

true when a simple motor feedforward model is configured.

MotionProfile 

true when a motion profile (trapezoidal or exponential) is active.

MotorInversion 

true when the motor output direction is inverted (tunable).

EncoderInversion 

true when the encoder count direction is inverted (tunable).

TunableVoltageEnabled 

Drive the motor and its loosely coupled followers at TunableVoltage instead of the closed-loop controller while on (tunable).

◆ DoubleTelemetryField

Identifies a double-valued telemetry field published by a SmartMotorController.

Enumerator
ExponentialProfileKV 

Exponential profile kV constant (tunable).

ExponentialProfileKA 

Exponential profile kA constant (tunable).

ExponentialProfileMaxInput 

Exponential profile maximum input voltage (tunable).

TrapezoidalProfileMaxVelocity 

Trapezoidal profile max velocity RPM or m/s (tunable).

TrapezoidalProfileMaxAcceleration 

Trapezoidal profile max acceleration RPM/s or m/s² (tunable).

TrapezoidalProfileMaxJerk 

Trapezoidal profile max jerk RPM/s² (tunable).

TunableClosedLoopControllerSlot 

Live-tunable closed-loop gain slot selector.

ActiveClosedLoopControllerSlot 

Currently active closed-loop gain slot (read-only).

kS 

Static friction feedforward gain kS (tunable).

kV 

Velocity feedforward gain kV (tunable).

kA 

Acceleration feedforward gain kA (tunable).

kG 

Gravity feedforward gain kG (tunable).

kP 

Proportional feedback gain kP (tunable).

kI 

Integral feedback gain kI (tunable).

kD 

Derivative feedback gain kD (tunable).

LQRQelmsPosition 

LQR position error tolerance, degrees or meters. Arm or elevator LQR only (tunable).

LQRQelmsVelocity 

LQR velocity error tolerance, RPM or m/s (tunable).

LQRRelms 

LQR control effort (voltage) tolerance, V (tunable).

LQRModelPosition 

LQR model position std dev, degrees or meters. Arm or elevator LQR only (tunable).

LQRModelVelocity 

LQR model velocity std dev, RPM or m/s (tunable).

LQREncoderPosition 

LQR encoder position std dev, degrees or meters. Arm or elevator LQR only (tunable).

LQREncoderVelocity 

LQR encoder velocity std dev, RPM. Flywheel LQR only (tunable).

LQRMaxVoltage 

LQR maximum output voltage, V (tunable).

ADRCDisturbance 

ADRC estimated total disturbance. ADRC only.

ADRCBandwidth 

ADRC closed-loop bandwidth, rad/s. ADRC only.

ADRCObserverBandwidth 

ADRC observer bandwidth, rad/s. ADRC only.

ADRCSystemOrder 

ADRC plant order. ADRC only.

ADRCB0 

ADRC input gain (tunable). ADRC only.

ADRCSettlingTime 

ADRC settling time, s (tunable). ADRC only.

ADRCBandwidthScale 

ADRC bandwidth scale (tunable). ADRC only.

TunableSetpointPosition 

Live-tunable position setpoint degrees or meters.

SetpointPosition 

Read-only position setpoint rotations or meters.

TunableSetpointVelocity 

Live-tunable velocity setpoint RPM or m/s.

SetpointVelocity 

Read-only velocity setpoint RPS or m/s.

SetpointForce 

Feedforward force applied on the velocity setpoint (N).

ClosedLoopPeriod 

Period the closed-loop controller runs at (s).

VelocityMeasurementDelay 

How far behind the measured velocity is, when known (s).

TunableVoltage 

Voltage applied to the motor and its loosely coupled followers, without the closed-loop controller, while TunableVoltageEnabled is on (V, tunable).

OutputVoltage 

Voltage currently applied to the motor (V).

StatorCurrent 

Stator (output) current draw (A).

StatorCurrentLimit 

Configured stator current limit (A, tunable).

SupplyCurrent 

Supply (input) current draw (A).

SupplyCurrentLimit 

Configured supply current limit (A, tunable).

MotorTemperature 

Motor controller temperature (°F).

MeasurementPosition 

Linear measurement position (m).

MeasurementCircumference 

The mechanism's circumference (m per mechanism rotation), if it has one.

MeasurementVelocity 

Linear measurement velocity (m/s).

MeasurementAcceleration 

Linear measurement acceleration (m/s²).

MeasurementLowerLimit 

Configured lower linear soft limit (m, tunable).

MeasurementUpperLimit 

Configured upper linear soft limit (m, tunable).

MechanismPosition 

Mechanism position in rotations.

MechanismVelocity 

Mechanism velocity in rotations per second.

MechanismAcceleration 

Mechanism acceleration in rotations per second squared.

MechanismLowerLimit 

Configured lower angular soft limit (degrees, tunable).

MechanismUpperLimit 

Configured upper angular soft limit (degrees, tunable).

RotorPosition 

Raw rotor position in rotations.

RotorVelocity 

Raw rotor velocity in rotations per second.

RotorGearRatio 

Rotor rotations per mechanism rotation: 60 for a 60:1 arm.

ExternalEncoderPosition 

External encoder's mechanism position in rotations, only with an external encoder.

ExternalEncoderVelocity 

External encoder's mechanism velocity in rotations per second, only with an external encoder.

ClosedloopRampRate 

Closed-loop duty-cycle ramp rate (s, tunable).

OpenloopRampRate 

Open-loop duty-cycle ramp rate (s, tunable).

Function Documentation

◆ EnsureMechanismsTelemetryBackend()

void yams::telemetry::EnsureMechanismsTelemetryBackend ( )
inline

Registers TelemetryRegistry and TunableRegistry backends that publish directly under the Mechanisms and Tuning NetworkTables roots – the same roots MechanismTelemetry and SmartMotorControllerTelemetry already publish raw NetworkTables data to – instead of the default /Telemetry and /Tunables roots. This keeps dashboard-facing widgets (Mechanism2d, Field2d, on-dashboard commands) in the same NetworkTables subtree as the rest of a mechanism's telemetry/tuning data. Ensure a TelemetryRegistry backend is registered at /Mechanisms that publishes directly to that NetworkTables root, for TelemetryLoggable objects such as Mechanism2d.

◆ EnsureMechanismsTunableBackend()

void yams::telemetry::EnsureMechanismsTunableBackend ( )
inline

Ensure a TunableRegistry backend is registered at /Mechanisms that publishes directly to that NetworkTables root, for ComplexTunable objects such as Field2d or on-dashboard Commands.

◆ EnsureTuningTunableBackend()

void yams::telemetry::EnsureTuningTunableBackend ( )
inline

Ensure a TunableRegistry backend is registered at /Tuning that publishes directly to that NetworkTables root, for ComplexTunable on-dashboard Commands such as the Live Tuning command.

◆ LQRFromSI()

double yams::telemetry::LQRFromSI ( math::LQRConfig::LQRType type,
bool position,
double value )
inline

An LQR tolerance or standard deviation from SI units to the telemetry field's units, the inverse of LQRToSI().

Parameters
typeLQRType of the LQR.
positionTrue for a position, false for a velocity.
valueValue in SI units.
Returns
Value in the telemetry field's units.

◆ LQRToSI()

double yams::telemetry::LQRToSI ( math::LQRConfig::LQRType type,
bool position,
double value )
inline

An LQR tolerance or standard deviation from the telemetry field's units to the SI units LQRConfig keeps: degrees to radians and RPM to rad/s for an arm or flywheel; an elevator's meters and m/s are unchanged.

Parameters
typeLQRType of the LQR.
positionTrue for a position, false for a velocity.
valueValue in the telemetry field's units.
Returns
Value in SI units.