YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
SmartMotorControllerTelemetry.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Yet Another Software Suite
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#pragma once
5
6#include <memory>
7#include <optional>
8#include <string>
9#include <unordered_map>
10#include <utility>
11#include <vector>
12#include <wpi/datalog/DataLog.hpp>
13#include <wpi/nt/BooleanTopic.hpp>
14#include <wpi/nt/DoubleTopic.hpp>
15#include <wpi/nt/NetworkTable.hpp>
16#include <wpi/system/DataLogManager.hpp>
17#include <wpi/util/json.hpp>
18
19// DoubleTelemetry<F>::TransformUnit() calls SmartMotorControllerConfig methods directly in its
20// (header-only, template) body; since SmartMotorControllerConfig is not a dependent type there,
21// two-phase lookup requires it to be complete at this point, not just forward-declared.
23
24namespace yams::motorcontrollers {
26} // namespace yams::motorcontrollers
27
28namespace yams::telemetry {
29
30// ---- Field enums ------------------------------------------------------------
31
99
115
116// ---- UnsupportedTelemetryFields ---------------------------------------------
117
125 std::optional<std::vector<BooleanTelemetryField>> boolFields;
126 std::optional<std::vector<DoubleTelemetryField>> doubleFields;
127};
128
129// ---- DoubleTelemetry --------------------------------------------------------
130
144template <typename F>
146 public:
156 DoubleTelemetry(std::string key, double defaultVal, F field, bool tunable, std::string unit)
157 : m_field{field},
158 m_key{std::move(key)},
159 m_tunable{tunable},
160 m_unit{std::move(unit)},
161 m_defaultValue{defaultVal},
162 m_cachedValue{defaultVal} {}
163
169 void SetDefaultValue(double value) { m_cachedValue = m_defaultValue = value; }
170
177 void SetupNetworkTables(std::shared_ptr<wpi::nt::NetworkTable> dataTable,
178 std::shared_ptr<wpi::nt::NetworkTable> tuningTable) {
179 m_dataTable = dataTable;
180 m_tuningTable = tuningTable;
181 if (!m_enabled) return;
182
183 if (tuningTable && m_tunable) {
184 auto topic = tuningTable->GetDoubleTopic(m_key);
185 if (m_unit != "none") {
186 topic.SetProperties(wpi::util::json{{"units", m_unit}});
187 }
188 m_subPublisher = topic.Publish();
189 m_subPublisher->SetDefault(m_defaultValue);
190 m_subscriber = topic.Subscribe(m_defaultValue);
191 } else if (dataTable) {
192 auto topic = dataTable->GetDoubleTopic(m_key);
193 if (m_unit != "none") {
194 topic.SetProperties(wpi::util::json{{"units", m_unit}});
195 }
196 m_publisher = topic.Publish();
197 m_publisher->SetDefault(m_defaultValue);
198 }
199 }
200
206 void SetupNetworkTable(std::shared_ptr<wpi::nt::NetworkTable> dataTable) {
207 SetupNetworkTables(dataTable, nullptr);
208 }
209
215 void SetupDataLog(const std::string& prefix) {
216 if (m_tunable) return;
217 std::string path = prefix;
218 if (!path.empty() && path.back() != '/') path += '/';
219 path += m_unit + '/' + m_key;
220 m_dataLogEntry = wpi::log::DoubleLogEntry{wpi::DataLogManager::GetLog(), path};
221 }
222
230 bool linear = cfg.GetLinearClosedLoopControllerUse();
231 if (m_unit == "tunable_position") {
232 m_unit = linear ? "meter" : "degrees";
233 } else if (m_unit == "position") {
234 m_unit = linear ? "meter" : "rotations";
235 } else if (m_unit == "tunable_velocity") {
236 m_unit = linear ? "meter_per_second" : "rotations_per_minute";
237 } else if (m_unit == "velocity") {
238 m_unit = linear ? "meter_per_second" : "rotation_per_second";
239 } else if (m_unit == "tunable_acceleration") {
240 m_unit = linear ? "meter_per_second_per_second" : "rotations_per_minute_per_second";
241 } else if (m_unit == "acceleration") {
242 m_unit = linear ? "meter_per_second_per_second" : "rotation_per_second_per_second";
243 }
244 }
245
253 void ForceSet(double value) {
254 if (m_subPublisher) {
255 m_subPublisher->Set(value);
256 } else if (m_publisher) {
257 m_publisher->Set(value);
258 }
259 }
260
267 bool Set(double value) {
268 if (!m_enabled) return false;
269 if (m_dataLogEntry) {
270 m_dataLogEntry->Append(value);
271 }
272 if (m_subscriber) {
273 double tuningValue = m_subscriber->Get(m_defaultValue);
274 if (tuningValue != value) return false;
275 }
276 if (m_publisher) {
277 m_publisher->Set(value);
278 }
279 return true;
280 }
281
287 double Get() const {
288 if (!m_enabled) return m_defaultValue;
289 if (m_subscriber) {
290 return m_subscriber->Get(m_defaultValue);
291 }
292 throw std::runtime_error("Tuning table not configured for " + m_key + "!");
293 }
294
300 bool IsTunable() {
301 if (m_subscriber && m_tunable && m_enabled) {
302 double current = m_subscriber->Get(m_defaultValue);
303 if (current != m_cachedValue) {
304 m_cachedValue = current;
305 return true;
306 }
307 }
308 return false;
309 }
310
312 void Enable() { m_enabled = true; }
314 void Disable() { m_enabled = false; }
320 void Display(bool state) { m_enabled = state; }
322 F GetField() const { return m_field; }
324 bool IsEnabled() const { return m_enabled; }
325
327 void Close() {
328 m_subscriber.reset();
329 m_subPublisher.reset();
330 m_publisher.reset();
331 if (m_dataTable) {
332 m_dataTable->GetEntry(m_key).Unpublish();
333 }
334 if (m_tuningTable) {
335 m_tuningTable->GetEntry(m_key).Unpublish();
336 }
337 }
338
339 private:
340 F m_field;
341 std::string m_key;
342 bool m_tunable;
343 bool m_enabled{false};
344 std::string m_unit;
345 double m_defaultValue;
346 double m_cachedValue;
347
348 std::optional<wpi::nt::DoublePublisher> m_publisher;
349 std::optional<wpi::nt::DoubleSubscriber> m_subscriber;
350 std::optional<wpi::nt::DoublePublisher> m_subPublisher; // tunable: publish + subscribe
351 std::optional<wpi::log::DoubleLogEntry> m_dataLogEntry;
352
353 std::shared_ptr<wpi::nt::NetworkTable> m_tuningTable;
354 std::shared_ptr<wpi::nt::NetworkTable> m_dataTable;
355};
356
357// ---- BooleanTelemetry -------------------------------------------------------
358
369template <typename F>
371 public:
380 BooleanTelemetry(std::string key, bool defaultVal, F field, bool tunable)
381 : m_field{field},
382 m_key{std::move(key)},
383 m_tunable{tunable},
384 m_defaultValue{defaultVal},
385 m_cachedValue{defaultVal} {}
386
392 void SetDefaultValue(bool value) { m_cachedValue = m_defaultValue = value; }
393
400 void SetupNetworkTables(std::shared_ptr<wpi::nt::NetworkTable> dataTable,
401 std::shared_ptr<wpi::nt::NetworkTable> tuningTable) {
402 m_dataTable = dataTable;
403 m_tuningTable = tuningTable;
404 if (!m_enabled) return;
405
406 if (tuningTable && m_tunable) {
407 auto topic = tuningTable->GetBooleanTopic(m_key);
408 m_pubSub = topic.Publish();
409 m_pubSub->SetDefault(m_defaultValue);
410 m_subscriber = topic.Subscribe(m_defaultValue);
411 } else if (dataTable) {
412 auto topic = dataTable->GetBooleanTopic(m_key);
413 m_publisher = topic.Publish();
414 m_publisher->SetDefault(m_defaultValue);
415 }
416 }
417
423 void SetupNetworkTable(std::shared_ptr<wpi::nt::NetworkTable> dataTable) {
424 SetupNetworkTables(dataTable, nullptr);
425 }
426
432 void SetupDataLog(const std::string& prefix) {
433 if (m_tunable) return;
434 std::string path = prefix;
435 if (!path.empty() && path.back() != '/') path += '/';
436 path += m_key;
437 m_dataLogEntry = wpi::log::BooleanLogEntry{wpi::DataLogManager::GetLog(), path};
438 }
439
446 bool Set(bool value) {
447 if (!m_enabled) return false;
448 if (m_dataLogEntry) {
449 m_dataLogEntry->Append(value);
450 }
451 if (m_subscriber) {
452 bool tuningValue = m_subscriber->Get(m_defaultValue);
453 if (tuningValue != value) return false;
454 }
455 if (m_publisher) {
456 m_publisher->Set(value);
457 }
458 return true;
459 }
460
466 bool Get() const {
467 if (!m_enabled) return m_defaultValue;
468 if (m_subscriber) {
469 return m_subscriber->Get(m_defaultValue);
470 }
471 throw std::runtime_error("Tuning table not configured for " + m_key + "!");
472 }
473
482 void ForceSet(bool value) {
483 if (m_pubSub) {
484 m_pubSub->Set(value);
485 } else if (m_publisher) {
486 m_publisher->Set(value);
487 }
488 }
489
495 bool IsTunable() {
496 if (m_subscriber && m_tunable && m_enabled) {
497 bool current = m_subscriber->Get(m_defaultValue);
498 if (current != m_cachedValue) {
499 m_cachedValue = current;
500 return true;
501 }
502 }
503 return false;
504 }
505
507 void Enable() { m_enabled = true; }
509 void Disable() { m_enabled = false; }
515 void Display(bool state) { m_enabled = state; }
517 F GetField() const { return m_field; }
519 bool IsEnabled() const { return m_enabled; }
520
522 void Close() {
523 m_subscriber.reset();
524 m_pubSub.reset();
525 m_publisher.reset();
526 if (m_dataTable) {
527 m_dataTable->GetEntry(m_key).Unpublish();
528 }
529 if (m_tuningTable) {
530 m_tuningTable->GetEntry(m_key).Unpublish();
531 }
532 }
533
534 private:
535 F m_field;
536 std::string m_key;
537 bool m_tunable;
538 bool m_enabled{false};
539 bool m_defaultValue;
540 bool m_cachedValue;
541
542 std::optional<wpi::nt::BooleanPublisher> m_publisher;
543 std::optional<wpi::nt::BooleanSubscriber> m_subscriber;
544 std::optional<wpi::nt::BooleanPublisher> m_pubSub; // tunable: publish + subscribe
545 std::optional<wpi::log::BooleanLogEntry> m_dataLogEntry;
546
547 std::shared_ptr<wpi::nt::NetworkTable> m_tuningTable;
548 std::shared_ptr<wpi::nt::NetworkTable> m_dataTable;
549};
550
551// ---- SmartMotorControllerTelemetry ------------------------------------------
552
561 public:
575 std::shared_ptr<wpi::nt::NetworkTable> publishTable,
576 std::shared_ptr<wpi::nt::NetworkTable> tuningTable,
577 std::unordered_map<DoubleTelemetryField, DoubleTelemetry<DoubleTelemetryField>>& doubleFields,
579 boolFields,
580 bool nt4Enabled, std::optional<std::string> dataLogName);
581
588
595
604
606 bool TuningEnabled() const;
607
609 void Close();
610
611 private:
618 void ApplyADRCTuning(math::ADRCConfig& adrcConfig);
619
620 std::shared_ptr<wpi::nt::NetworkTable> m_dataTable;
621 std::shared_ptr<wpi::nt::NetworkTable> m_tuningTable;
622
623 std::unordered_map<DoubleTelemetryField, DoubleTelemetry<DoubleTelemetryField>>* m_doubleFields{
624 nullptr};
625 std::unordered_map<BooleanTelemetryField, BooleanTelemetry<BooleanTelemetryField>>* m_boolFields{
626 nullptr};
627};
628
629} // namespace yams::telemetry
Definition ADRCConfig.hpp:82
Definition SmartMotorControllerConfig.hpp:66
Definition SmartMotorController.hpp:49
Definition SmartMotorControllerTelemetry.hpp:370
void SetDefaultValue(bool value)
Definition SmartMotorControllerTelemetry.hpp:392
void ForceSet(bool value)
Definition SmartMotorControllerTelemetry.hpp:482
bool Get() const
Definition SmartMotorControllerTelemetry.hpp:466
bool Set(bool value)
Definition SmartMotorControllerTelemetry.hpp:446
void SetupDataLog(const std::string &prefix)
Definition SmartMotorControllerTelemetry.hpp:432
void Close()
Definition SmartMotorControllerTelemetry.hpp:522
bool IsEnabled() const
Definition SmartMotorControllerTelemetry.hpp:519
F GetField() const
Definition SmartMotorControllerTelemetry.hpp:517
void Enable()
Definition SmartMotorControllerTelemetry.hpp:507
void SetupNetworkTables(std::shared_ptr< wpi::nt::NetworkTable > dataTable, std::shared_ptr< wpi::nt::NetworkTable > tuningTable)
Definition SmartMotorControllerTelemetry.hpp:400
void Disable()
Definition SmartMotorControllerTelemetry.hpp:509
void Display(bool state)
Definition SmartMotorControllerTelemetry.hpp:515
bool IsTunable()
Definition SmartMotorControllerTelemetry.hpp:495
void SetupNetworkTable(std::shared_ptr< wpi::nt::NetworkTable > dataTable)
Definition SmartMotorControllerTelemetry.hpp:423
BooleanTelemetry(std::string key, bool defaultVal, F field, bool tunable)
Definition SmartMotorControllerTelemetry.hpp:380
Definition SmartMotorControllerTelemetry.hpp:145
void SetupDataLog(const std::string &prefix)
Definition SmartMotorControllerTelemetry.hpp:215
double Get() const
Definition SmartMotorControllerTelemetry.hpp:287
bool IsTunable()
Definition SmartMotorControllerTelemetry.hpp:300
F GetField() const
Definition SmartMotorControllerTelemetry.hpp:322
void TransformUnit(const motorcontrollers::SmartMotorControllerConfig &cfg)
Definition SmartMotorControllerTelemetry.hpp:229
void Enable()
Definition SmartMotorControllerTelemetry.hpp:312
void SetDefaultValue(double value)
Definition SmartMotorControllerTelemetry.hpp:169
void SetupNetworkTables(std::shared_ptr< wpi::nt::NetworkTable > dataTable, std::shared_ptr< wpi::nt::NetworkTable > tuningTable)
Definition SmartMotorControllerTelemetry.hpp:177
void Disable()
Definition SmartMotorControllerTelemetry.hpp:314
bool Set(double value)
Definition SmartMotorControllerTelemetry.hpp:267
void Display(bool state)
Definition SmartMotorControllerTelemetry.hpp:320
DoubleTelemetry(std::string key, double defaultVal, F field, bool tunable, std::string unit)
Definition SmartMotorControllerTelemetry.hpp:156
void SetupNetworkTable(std::shared_ptr< wpi::nt::NetworkTable > dataTable)
Definition SmartMotorControllerTelemetry.hpp:206
void ForceSet(double value)
Definition SmartMotorControllerTelemetry.hpp:253
bool IsEnabled() const
Definition SmartMotorControllerTelemetry.hpp:324
void Close()
Definition SmartMotorControllerTelemetry.hpp:327
Definition SmartMotorControllerTelemetry.hpp:560
void Publish(motorcontrollers::SmartMotorController &smc)
void SetupTelemetry(motorcontrollers::SmartMotorController &smc, std::shared_ptr< wpi::nt::NetworkTable > publishTable, std::shared_ptr< wpi::nt::NetworkTable > tuningTable, std::unordered_map< DoubleTelemetryField, DoubleTelemetry< DoubleTelemetryField > > &doubleFields, std::unordered_map< BooleanTelemetryField, BooleanTelemetry< BooleanTelemetryField > > &boolFields, bool nt4Enabled, std::optional< std::string > dataLogName)
void StopTuning(motorcontrollers::SmartMotorController &smc)
void ApplyTuningValues(motorcontrollers::SmartMotorController &smc)
Definition ADRCConfig.hpp:20
Definition SwerveDrive.hpp:872
DoubleTelemetryField
Definition SmartMotorControllerTelemetry.hpp:33
@ TrapezoidalProfileMaxAcceleration
Definition SmartMotorControllerTelemetry.hpp:38
@ kG
Gravity feedforward gain kG (tunable).
Definition SmartMotorControllerTelemetry.hpp:46
@ kI
Integral feedback gain kI (tunable).
Definition SmartMotorControllerTelemetry.hpp:48
@ MechanismUpperLimit
Configured upper angular soft limit (degrees, tunable).
Definition SmartMotorControllerTelemetry.hpp:90
@ MechanismAcceleration
Mechanism acceleration in rotations per second squared.
Definition SmartMotorControllerTelemetry.hpp:88
@ ADRCBandwidth
ADRC closed-loop bandwidth, rad/s. ADRC only.
Definition SmartMotorControllerTelemetry.hpp:59
@ ExternalEncoderVelocity
External encoder's mechanism velocity in rotations per second, only with an external encoder.
Definition SmartMotorControllerTelemetry.hpp:95
@ kA
Acceleration feedforward gain kA (tunable).
Definition SmartMotorControllerTelemetry.hpp:45
@ TunableClosedLoopControllerSlot
Live-tunable closed-loop gain slot selector.
Definition SmartMotorControllerTelemetry.hpp:41
@ kP
Proportional feedback gain kP (tunable).
Definition SmartMotorControllerTelemetry.hpp:47
@ SupplyCurrent
Supply (input) current draw (A).
Definition SmartMotorControllerTelemetry.hpp:77
@ StatorCurrent
Stator (output) current draw (A).
Definition SmartMotorControllerTelemetry.hpp:75
@ LQRRelms
LQR control effort (voltage) tolerance, V (tunable).
Definition SmartMotorControllerTelemetry.hpp:52
@ OutputVoltage
Voltage currently applied to the motor (V).
Definition SmartMotorControllerTelemetry.hpp:74
@ ADRCObserverBandwidth
ADRC observer bandwidth, rad/s. ADRC only.
Definition SmartMotorControllerTelemetry.hpp:60
@ VelocityMeasurementDelay
How far behind the measured velocity is, when known (s).
Definition SmartMotorControllerTelemetry.hpp:71
@ ExponentialProfileKV
Exponential profile kV constant (tunable).
Definition SmartMotorControllerTelemetry.hpp:34
@ SetpointForce
Feedforward force applied on the velocity setpoint (N).
Definition SmartMotorControllerTelemetry.hpp:69
@ SupplyCurrentLimit
Configured supply current limit (A, tunable).
Definition SmartMotorControllerTelemetry.hpp:78
@ MeasurementVelocity
Linear measurement velocity (m/s).
Definition SmartMotorControllerTelemetry.hpp:82
@ kV
Velocity feedforward gain kV (tunable).
Definition SmartMotorControllerTelemetry.hpp:44
@ kD
Derivative feedback gain kD (tunable).
Definition SmartMotorControllerTelemetry.hpp:49
@ SetpointPosition
Read-only position setpoint rotations or meters.
Definition SmartMotorControllerTelemetry.hpp:66
@ TunableVoltage
Definition SmartMotorControllerTelemetry.hpp:72
@ MeasurementUpperLimit
Configured upper linear soft limit (m, tunable).
Definition SmartMotorControllerTelemetry.hpp:85
@ ClosedLoopPeriod
Period the closed-loop controller runs at (s).
Definition SmartMotorControllerTelemetry.hpp:70
@ ExternalEncoderPosition
External encoder's mechanism position in rotations, only with an external encoder.
Definition SmartMotorControllerTelemetry.hpp:94
@ LQREncoderVelocity
LQR encoder velocity std dev, RPM. Flywheel LQR only (tunable).
Definition SmartMotorControllerTelemetry.hpp:56
@ TunableSetpointPosition
Live-tunable position setpoint degrees or meters.
Definition SmartMotorControllerTelemetry.hpp:65
@ ADRCB0
ADRC input gain (tunable). ADRC only.
Definition SmartMotorControllerTelemetry.hpp:62
@ MechanismPosition
Mechanism position in rotations.
Definition SmartMotorControllerTelemetry.hpp:86
@ RotorVelocity
Raw rotor velocity in rotations per second.
Definition SmartMotorControllerTelemetry.hpp:92
@ ADRCBandwidthScale
ADRC bandwidth scale (tunable). ADRC only.
Definition SmartMotorControllerTelemetry.hpp:64
@ ADRCSystemOrder
ADRC plant order. ADRC only.
Definition SmartMotorControllerTelemetry.hpp:61
@ MeasurementPosition
Linear measurement position (m).
Definition SmartMotorControllerTelemetry.hpp:80
@ ADRCSettlingTime
ADRC settling time, s (tunable). ADRC only.
Definition SmartMotorControllerTelemetry.hpp:63
@ MeasurementAcceleration
Linear measurement acceleration (m/s²).
Definition SmartMotorControllerTelemetry.hpp:83
@ OpenloopRampRate
Open-loop duty-cycle ramp rate (s, tunable).
Definition SmartMotorControllerTelemetry.hpp:97
@ TrapezoidalProfileMaxVelocity
Trapezoidal profile max velocity RPM or m/s (tunable).
Definition SmartMotorControllerTelemetry.hpp:37
@ MeasurementCircumference
The mechanism's circumference (m per mechanism rotation), if it has one.
Definition SmartMotorControllerTelemetry.hpp:81
@ ExponentialProfileKA
Exponential profile kA constant (tunable).
Definition SmartMotorControllerTelemetry.hpp:35
@ TunableSetpointVelocity
Live-tunable velocity setpoint RPM or m/s.
Definition SmartMotorControllerTelemetry.hpp:67
@ MeasurementLowerLimit
Configured lower linear soft limit (m, tunable).
Definition SmartMotorControllerTelemetry.hpp:84
@ SetpointVelocity
Read-only velocity setpoint RPS or m/s.
Definition SmartMotorControllerTelemetry.hpp:68
@ ClosedloopRampRate
Closed-loop duty-cycle ramp rate (s, tunable).
Definition SmartMotorControllerTelemetry.hpp:96
@ kS
Static friction feedforward gain kS (tunable).
Definition SmartMotorControllerTelemetry.hpp:43
@ StatorCurrentLimit
Configured stator current limit (A, tunable).
Definition SmartMotorControllerTelemetry.hpp:76
@ ExponentialProfileMaxInput
Exponential profile maximum input voltage (tunable).
Definition SmartMotorControllerTelemetry.hpp:36
@ ADRCDisturbance
ADRC estimated total disturbance. ADRC only.
Definition SmartMotorControllerTelemetry.hpp:58
@ ActiveClosedLoopControllerSlot
Currently active closed-loop gain slot (read-only).
Definition SmartMotorControllerTelemetry.hpp:42
@ RotorGearRatio
Rotor rotations per mechanism rotation: 60 for a 60:1 arm.
Definition SmartMotorControllerTelemetry.hpp:93
@ LQREncoderPosition
LQR encoder position std dev, degrees or meters. Arm or elevator LQR only (tunable).
Definition SmartMotorControllerTelemetry.hpp:55
@ MotorTemperature
Motor controller temperature (°F).
Definition SmartMotorControllerTelemetry.hpp:79
@ LQRModelVelocity
LQR model velocity std dev, RPM or m/s (tunable).
Definition SmartMotorControllerTelemetry.hpp:54
@ MechanismLowerLimit
Configured lower angular soft limit (degrees, tunable).
Definition SmartMotorControllerTelemetry.hpp:89
@ LQRMaxVoltage
LQR maximum output voltage, V (tunable).
Definition SmartMotorControllerTelemetry.hpp:57
@ LQRModelPosition
LQR model position std dev, degrees or meters. Arm or elevator LQR only (tunable).
Definition SmartMotorControllerTelemetry.hpp:53
@ RotorPosition
Raw rotor position in rotations.
Definition SmartMotorControllerTelemetry.hpp:91
@ LQRQelmsVelocity
LQR velocity error tolerance, RPM or m/s (tunable).
Definition SmartMotorControllerTelemetry.hpp:51
@ LQRQelmsPosition
LQR position error tolerance, degrees or meters. Arm or elevator LQR only (tunable).
Definition SmartMotorControllerTelemetry.hpp:50
@ TrapezoidalProfileMaxJerk
Trapezoidal profile max jerk RPM/s² (tunable).
Definition SmartMotorControllerTelemetry.hpp:40
@ MechanismVelocity
Mechanism velocity in rotations per second.
Definition SmartMotorControllerTelemetry.hpp:87
BooleanTelemetryField
Definition SmartMotorControllerTelemetry.hpp:101
@ EncoderInversion
true when the encoder count direction is inverted (tunable).
Definition SmartMotorControllerTelemetry.hpp:111
@ TemperatureLimit
true when the motor temperature has reached the cutoff threshold.
Definition SmartMotorControllerTelemetry.hpp:104
@ SimpleMotorFeedForward
true when a simple motor feedforward model is configured.
Definition SmartMotorControllerTelemetry.hpp:108
@ MotorInversion
true when the motor output direction is inverted (tunable).
Definition SmartMotorControllerTelemetry.hpp:110
@ ElevatorFeedForward
true when an elevator feedforward model is configured.
Definition SmartMotorControllerTelemetry.hpp:106
@ MotionProfile
true when a motion profile (trapezoidal or exponential) is active.
Definition SmartMotorControllerTelemetry.hpp:109
@ TunableVoltageEnabled
Definition SmartMotorControllerTelemetry.hpp:112
@ VelocityControl
true when a velocity setpoint is active.
Definition SmartMotorControllerTelemetry.hpp:105
@ ArmFeedForward
true when an arm feedforward model is configured.
Definition SmartMotorControllerTelemetry.hpp:107
Definition SmartMotorControllerTelemetry.hpp:124
std::optional< std::vector< DoubleTelemetryField > > doubleFields
Unsupported double fields.
Definition SmartMotorControllerTelemetry.hpp:126
std::optional< std::vector< BooleanTelemetryField > > boolFields
Unsupported boolean fields.
Definition SmartMotorControllerTelemetry.hpp:125