|
YAMS
Yet Another Mechanism System
|
#include <SwerveInputStreamTelemetry.hpp>
Public Types | |
| enum class | DoubleTelemetryField { Deadband , TranslationScale , RotationScale , MaxLinearVelocity , MaxAngularVelocity , RotationControllerMeasurement , RotationControllerSetpoint , TunableDeadband , TunableTranslationScale , TunableRotationScale , TunableMaxLinearVelocity , TunableMaxAngularVelocity } |
| enum class | BooleanTelemetryField { TranslationCube , RotationCube , AllianceRelative , RobotRelative , TunableTranslationCube , TunableRotationCube , TunableAllianceRelative , TunableRobotRelative } |
| enum class | StringTelemetryField { Mode } |
| using | TelemetryVerbosity = SwerveDriveConfig::TelemetryVerbosity |
Public Member Functions | |
| SwerveInputStreamTelemetry (SwerveInputStream< NumModules > &stream, std::string_view name, TelemetryVerbosity verbosity) | |
| SwerveInputStreamTelemetry (const SwerveInputStreamTelemetry &)=delete | |
| SwerveInputStreamTelemetry & | operator= (const SwerveInputStreamTelemetry &)=delete |
| ~SwerveInputStreamTelemetry () | |
| void | UpdateTelemetry () |
| void | ApplyTuningValues () |
| std::optional< std::reference_wrapper< wpi::cmd::Command > > | GetLiveTuningCommand () |
Telemetry and live tuning for a SwerveInputStream, created by SwerveInputStream::WithTelemetry(name, verbosity) and published every time the stream is read.
Each value is a DoubleTelemetryField, BooleanTelemetryField or StringTelemetryField, which gives its key and whether it is tunable.
While live tuning, values stay in sync both ways: a dashboard edit is applied to the stream, and a change made in code, e.g. a binding that changes the translation scale, is published to the dashboard. Invalid dashboard values are replaced with the stream's current value.
The stream owns its telemetry and creates it when first read, so the telemetry never outlives the stream or follows it to a new address.
| using yams::mechanisms::swerve::utility::SwerveInputStreamTelemetry< NumModules >::TelemetryVerbosity = SwerveDriveConfig::TelemetryVerbosity |
|
strong |
Boolean telemetry field for a SwerveInputStream.
|
strong |
Double telemetry field for a SwerveInputStream.
|
strong |
String telemetry field for a SwerveInputStream.
| Enumerator | |
|---|---|
| Mode | Name of the stream's current drive mode. |
|
inline |
Publish telemetry for a SwerveInputStream. Use SwerveInputStream::WithTelemetry rather than creating this directly.
| stream | The SwerveInputStream to monitor and tune. Must outlive this object. |
| name | Name of the stream in NetworkTables (e.g., "drive"). |
| verbosity | TelemetryVerbosity to publish at. |
|
delete |
|
inline |
Stop publishing, canceling and removing the "Live Tuning" command.
|
inline |
Apply values edited on the dashboard to the stream, and publish changes made to the stream in code. The "Live Tuning" command calls this every loop. Does nothing below HIGH.
|
inline |
The "Live Tuning" command published to the dashboard, which applies dashboard edits while it runs.
|
delete |
|
inline |
Publish the stream's current mode and, at MEDIUM and above, its configuration. Called by SwerveInputStream::Get().