DYNAMIXEL Driver 0.1.0
API reference
Loading...
Searching...
No Matches
dynamixel_types.hpp
Go to the documentation of this file.
1
13#ifndef DYNAMIXEL_TYPES_HPP
14#define DYNAMIXEL_TYPES_HPP
15
16#include <cstddef>
17#include <cstdint>
18#include <span>
19
20#include "dynamixel_detail.hpp"
21#include "dynamixel_tables.hpp"
22#include "dynamixel_version.h"
23
25namespace dynamixel {
26
39enum class [[nodiscard]] Error : uint8_t {
40 // Base set: the same names and values in every driver of the org (standards/driver.md).
41 Ok = 0,
42 NotInitialized = 1,
43 InvalidArgument = 2,
44 Bus = 3,
45 Timeout = 4,
47 5,
48 Crc = 6,
49 Busy = 7,
50 DeviceFault = 8,
51 Unsupported = 9,
52 // Bus-specific values start at 16; each one is returned by some call (tests/test_faults.cpp).
54 16,
56 17,
57 EchoMismatch = 18,
58 LineFault = 19,
59 NotPermitted = 22,
60};
61
67constexpr const char* ToString(Error error) noexcept {
68 switch (error) {
69 case Error::Ok:
70 return "Ok";
72 return "NotInitialized";
74 return "InvalidArgument";
75 case Error::Bus:
76 return "Bus";
77 case Error::Timeout:
78 return "Timeout";
80 return "DeviceIdMismatch";
81 case Error::Crc:
82 return "Crc";
83 case Error::Busy:
84 return "Busy";
86 return "DeviceFault";
88 return "Unsupported";
90 return "DeviceError";
92 return "InvalidReply";
94 return "EchoMismatch";
96 return "LineFault";
98 return "NotPermitted";
99 default:
100 break;
101 }
102 return "Unknown";
103}
104
112template <typename T>
113struct [[nodiscard]] Result {
114 T value{};
115 Error error{Error::Ok};
116
118 [[nodiscard]] constexpr bool ok() const noexcept {
119 return error == Error::Ok;
120 }
122 constexpr explicit operator bool() const noexcept {
123 return ok();
124 }
125
131 static constexpr Result Success(T v) noexcept {
132 return {v, Error::Ok};
133 }
139 static constexpr Result Failure(Error e) noexcept {
140 return {T{}, e};
141 }
142};
143
145template <>
146struct [[nodiscard]] Result<void> {
147 Error error{Error::Ok};
148
150 [[nodiscard]] constexpr bool ok() const noexcept {
151 return error == Error::Ok;
152 }
154 constexpr explicit operator bool() const noexcept {
155 return ok();
156 }
157
159 static constexpr Result Success() noexcept {
160 return {Error::Ok};
161 }
167 static constexpr Result Failure(Error e) noexcept {
168 return {e};
169 }
170};
171
173enum class LogLevel : uint8_t {
174 Error = 0,
175 Warning,
176 Info,
177 Debug,
178};
179
182enum class Protocol : uint8_t {
183 V1 = 0,
184 V2 = 1,
186};
187
189enum class EchoMode : uint8_t {
190 None = 0,
191 Loopback = 1,
192};
193
195enum class AlertPolicy : uint8_t {
196 Report = 0,
198 Fail = 1,
199};
200
202enum class StatusReturn : uint8_t {
203 PingOnly = 0,
204 ReadOnly = 1,
205 All = 2,
206};
207
209enum class ResetOption : uint8_t {
210 KeepIdAndBaud = 0x02,
211 KeepId = 0x01,
212 All = 0xFF,
213};
214
216enum class ClearOption : uint8_t {
217 MultiTurn = 0x01,
218 Errors = 0x02,
219};
220
222enum class BackupOption : uint8_t {
223 Store = 0x01,
224 Restore = 0x02,
225};
226
228enum class [[nodiscard]] Protocol2Error : uint8_t {
229 None = 0,
230 ResultFail = 1,
231 InstructionError = 2,
232 CrcError = 3,
233 DataRangeError = 4,
234 DataLengthError = 5,
235 DataLimitError = 6,
237 7,
238};
239
241namespace p1_error {
242inline constexpr uint8_t kInputVoltage =
243 0x01;
244inline constexpr uint8_t kAngleLimit =
245 0x02;
246inline constexpr uint8_t kOverheating = 0x04;
247inline constexpr uint8_t kRange = 0x08;
248inline constexpr uint8_t kChecksum =
249 0x10;
250inline constexpr uint8_t kOverload =
251 0x20;
252inline constexpr uint8_t kInstruction =
253 0x40;
255inline constexpr uint8_t kCommandFaults = static_cast<uint8_t>(
256 uint32_t{kAngleLimit} | uint32_t{kRange} | uint32_t{kChecksum} | uint32_t{kInstruction});
258inline constexpr uint8_t kConditions =
259 static_cast<uint8_t>(uint32_t{kInputVoltage} | uint32_t{kOverheating} | uint32_t{kOverload});
260} // namespace p1_error
261
263inline constexpr uint8_t kAlertBit = 0x80;
264
267namespace hw_error {
268inline constexpr uint8_t kInputVoltage = 0x01;
269inline constexpr uint8_t kOverheating = 0x04;
270inline constexpr uint8_t kMotorEncoder = 0x08;
271inline constexpr uint8_t kElectricalShock = 0x10;
272inline constexpr uint8_t kOverload = 0x20;
273} // namespace hw_error
274
282struct ReplyInfo {
283 uint8_t id{0};
284 uint8_t error_byte{0};
285 bool alert{false};
286 bool rejected{false};
288};
289
291struct PingInfo {
292 uint8_t id{0};
293 uint16_t model{0};
294 uint8_t firmware{0};
297};
298
300struct ServoRef {
301 uint8_t id{1};
304};
305
308 uint8_t id{0};
310 uint8_t error_byte{0};
311 bool alert{false};
312};
313
316 uint8_t id{0};
317 uint16_t address{0};
318 uint16_t length{0};
319};
320
323 uint8_t id{0};
324 uint16_t address{0};
325 std::span<const uint8_t> data;
326};
327
329struct Feedback {
331 enum class EffortKind : uint8_t {
332 None = 0,
334 1,
335 CurrentCounts = 2,
336 };
337 int32_t position{0};
338 int32_t velocity{0};
339 int32_t effort{0};
341 uint16_t voltage_dv{0};
342 uint8_t temperature_c{0};
343};
344
346struct Stats {
347 uint32_t transactions{0};
348 uint32_t retries{0};
349 uint32_t timeouts{0};
350 uint32_t crc_errors{0};
351 uint32_t garbage_bytes{0};
352 uint32_t line_faults{0};
353 uint32_t echo_errors{0};
354 uint32_t device_errors{0};
355 uint32_t alerts{0};
356};
357
359inline constexpr uint8_t kBroadcastId = 0xFE;
361inline constexpr uint8_t kMaxIdV2 = 252;
363inline constexpr uint8_t kMaxIdV1 = 253;
364
366inline constexpr uint32_t kMinTimeoutUs = 100;
368inline constexpr uint32_t kMaxTimeoutUs = 1'000'000;
370inline constexpr uint32_t kMaxSettleUs = 10'000'000;
372inline constexpr uint32_t kMinBaud = 9'600;
375inline constexpr uint32_t kMaxBaud = 10'500'000;
377inline constexpr uint8_t kMaxRetries = 5;
378
385struct Config {
387 uint32_t baud{
388 57'600};
390 20'000};
391 uint32_t gap_timeout_us{5'000};
392 uint32_t reboot_wait_us{500'000};
394 uint32_t baud_change_wait_us{10'000};
395 uint8_t retries{
396 1};
403 100'000};
405 false};
406};
407
412constexpr Config FastBusPreset() noexcept {
413 Config c{};
414 c.reply_timeout_us = 10'000;
415 c.gap_timeout_us = 2'000;
416 return c;
417}
418
423constexpr Config UsbAdapterPreset() noexcept {
424 Config c{};
425 c.reply_timeout_us = 60'000;
426 c.gap_timeout_us = 40'000;
427 return c;
428}
429
435constexpr Config LegacyBusPreset() noexcept {
436 Config c{};
438 c.baud = 1'000'000;
439 return c;
440}
441
442namespace detail {
444template <>
445struct EnumLast<Protocol> {
446 static constexpr Protocol kValue = Protocol::V2;
447};
449template <>
450struct EnumLast<EchoMode> {
451 static constexpr EchoMode kValue = EchoMode::Loopback;
452};
454template <>
455struct EnumLast<AlertPolicy> {
456 static constexpr AlertPolicy kValue = AlertPolicy::Fail;
457};
459template <>
460struct EnumLast<StatusReturn> {
461 static constexpr StatusReturn kValue = StatusReturn::All;
462};
463} // namespace detail
464
475constexpr Error Validate(const Config& config) noexcept {
476 const bool enums_ok =
477 detail::IsEnumerator(config.protocol) && detail::IsEnumerator(config.echo) &&
478 detail::IsEnumerator(config.alert_policy) && detail::IsEnumerator(config.status_return);
479 const bool baud_ok = (config.baud >= kMinBaud) && (config.baud <= kMaxBaud);
480 const bool timeouts_ok =
481 detail::InRange(config.reply_timeout_us, kMinTimeoutUs, kMaxTimeoutUs) &&
482 detail::InRange(config.gap_timeout_us, kMinTimeoutUs, kMaxTimeoutUs) &&
483 detail::InRange(config.broadcast_timeout_us, kMinTimeoutUs, kMaxTimeoutUs);
484 const bool waits_ok =
485 (config.reboot_wait_us <= kMaxSettleUs) && (config.baud_change_wait_us <= kMaxSettleUs);
486 const bool retries_ok = config.retries <= kMaxRetries;
487 return (enums_ok && baud_ok && timeouts_ok && waits_ok && retries_ok) ? Error::Ok
489}
490
491// Every preset is valid, proved at build time (KB-CPP20-012).
492static_assert(Validate(Config{}) == Error::Ok);
493static_assert(Validate(FastBusPreset()) == Error::Ok);
494static_assert(Validate(UsbAdapterPreset()) == Error::Ok);
495static_assert(Validate(LegacyBusPreset()) == Error::Ok);
496
504constexpr ReplyInfo Classify(Protocol protocol, uint8_t id, uint8_t error_byte) noexcept {
505 ReplyInfo info{};
506 info.id = id;
507 info.error_byte = error_byte;
508 const auto bits = static_cast<uint32_t>(error_byte);
509 if (protocol == Protocol::V2) {
510 info.alert = (bits & kAlertBit) != 0U;
511 info.rejected = (bits & 0x7FU) != 0U;
512 } else {
513 info.alert = (bits & p1_error::kConditions) != 0U;
514 info.rejected = (bits & p1_error::kCommandFaults) != 0U;
515 }
516 return info;
517}
518
525constexpr Protocol2Error ErrorNumber(uint8_t error_byte) noexcept {
526 const uint32_t number = static_cast<uint32_t>(error_byte) & 0x7FU;
527 return (number <= 7U) ? static_cast<Protocol2Error>(number) : Protocol2Error::ResultFail;
528}
529
530static_assert(!Classify(Protocol::V2, 1_u8, 0x80_u8).rejected &&
531 Classify(Protocol::V2, 1_u8, 0x80_u8).alert);
532static_assert(Classify(Protocol::V2, 1_u8, 0x04_u8).rejected);
533static_assert(Classify(Protocol::V1, 1_u8, 0x24_u8).alert &&
534 !Classify(Protocol::V1, 1_u8, 0x24_u8).rejected);
535static_assert(Classify(Protocol::V1, 1_u8, 0x40_u8).rejected);
536
541void ConfigIsInvalid() noexcept;
542
551public:
556 consteval explicit CheckedConfig(const Config& config) noexcept : config_(config) {
557 if (Validate(config) != Error::Ok) {
559 }
560 }
562 [[nodiscard]] constexpr const Config& Get() const& noexcept {
563 return config_;
564 }
566 void Get() const&& = delete;
567
568private:
569 Config config_;
570};
571
573constexpr const char* GetDriverVersion() noexcept {
574 return DYNAMIXEL_VERSION_STRING;
575}
577constexpr uint32_t GetDriverVersionMajor() noexcept {
578 return DYNAMIXEL_VERSION_MAJOR;
579}
581constexpr uint32_t GetDriverVersionMinor() noexcept {
582 return DYNAMIXEL_VERSION_MINOR;
583}
585constexpr uint32_t GetDriverVersionPatch() noexcept {
586 return DYNAMIXEL_VERSION_PATCH;
587}
588
591} // namespace dynamixel
592
593#endif // DYNAMIXEL_TYPES_HPP
A configuration proven valid at build time.
Definition dynamixel_types.hpp:550
consteval CheckedConfig(const Config &config) noexcept
Check config at build time.
Definition dynamixel_types.hpp:556
constexpr const Config & Get() const &noexcept
Definition dynamixel_types.hpp:562
void Get() const &&=delete
Not on a temporary: the reference would dangle (KB-CPP20-044).
Compile-time helpers of the DYNAMIXEL driver: typed integer literals, exact hook matching,...
Control tables of the DYNAMIXEL servo families, the model catalogue and the unit scales.
constexpr uint8_t kMaxIdV1
The largest valid servo ID of protocol 1.0.
Definition dynamixel_types.hpp:363
constexpr uint32_t kMaxSettleUs
Longest settle time after a reboot or factory reset the driver accepts: 10 seconds.
Definition dynamixel_types.hpp:370
constexpr Error Validate(const Config &config) noexcept
Check a configuration without touching the bus.
Definition dynamixel_types.hpp:475
void ConfigIsInvalid() noexcept
Reached only when a CheckedConfig is built from an invalid configuration: it is never defined,...
constexpr const char * ToString(Error error) noexcept
The name of an error, for logs.
Definition dynamixel_types.hpp:67
ClearOption
The option of a Clear instruction (protocol 2.0).
Definition dynamixel_types.hpp:216
constexpr uint32_t GetDriverVersionMinor() noexcept
Definition dynamixel_types.hpp:581
constexpr const char * GetDriverVersion() noexcept
Definition dynamixel_types.hpp:573
constexpr uint8_t kMaxRetries
The most repeats of an idempotent instruction Config::retries allows.
Definition dynamixel_types.hpp:377
constexpr uint32_t kMaxBaud
Highest bit rate the driver accepts (the e-Manual lists up to 4.5 Mbit/s, the P series 10....
Definition dynamixel_types.hpp:375
constexpr Protocol2Error ErrorNumber(uint8_t error_byte) noexcept
The protocol 2.0 error number of an error byte.
Definition dynamixel_types.hpp:525
constexpr Config LegacyBusPreset() noexcept
The legacy bus: protocol 1.0 at 1 Mbit/s with the single-wire loopback of a half-duplex adapter.
Definition dynamixel_types.hpp:435
Protocol2Error
Protocol 2.0 error numbers (bits 6..0 of the error byte of a status packet).
Definition dynamixel_types.hpp:228
Protocol
The packet format of the bus: one per DYNAMIXEL object, because every servo on a bus shares it.
Definition dynamixel_types.hpp:182
constexpr uint32_t kMinTimeoutUs
Shortest and longest reply wait the driver accepts, microseconds (KB-CPP20-058).
Definition dynamixel_types.hpp:366
StatusReturn
How much a servo answers (the Status Return Level register, values 0 to 2).
Definition dynamixel_types.hpp:202
Error
Why a call failed. Every call of the driver returns one of these in its Result.
Definition dynamixel_types.hpp:39
constexpr uint32_t GetDriverVersionMajor() noexcept
Definition dynamixel_types.hpp:577
ResetOption
The option byte of a Factory Reset instruction (protocol 2.0).
Definition dynamixel_types.hpp:209
constexpr Config FastBusPreset() noexcept
Calls on a bus of servos that all answer: the shortest sensible setup for a first test.
Definition dynamixel_types.hpp:412
LogLevel
Severity passed to the optional Log() hook.
Definition dynamixel_types.hpp:173
constexpr uint8_t kAlertBit
Protocol 2.0 alert bit of the error byte.
Definition dynamixel_types.hpp:263
constexpr uint32_t kMaxTimeoutUs
Longest timeout the driver accepts: one second.
Definition dynamixel_types.hpp:368
EchoMode
Whether the transmitted bytes come back on the receive line (a single-wire loopback).
Definition dynamixel_types.hpp:189
constexpr uint32_t GetDriverVersionPatch() noexcept
Definition dynamixel_types.hpp:585
constexpr uint8_t kMaxIdV2
The largest valid servo ID of protocol 2.0.
Definition dynamixel_types.hpp:361
constexpr uint8_t kBroadcastId
The broadcast ID: an instruction to it reaches every servo and none answers.
Definition dynamixel_types.hpp:359
BackupOption
The option of a Control Table Backup instruction (protocol 2.0).
Definition dynamixel_types.hpp:222
constexpr Config UsbAdapterPreset() noexcept
A bus on a USB adapter whose receive buffer is flushed in 16 ms steps.
Definition dynamixel_types.hpp:423
constexpr uint32_t kMinBaud
Lowest and highest bit rate the driver accepts for Config::baud.
Definition dynamixel_types.hpp:372
constexpr ReplyInfo Classify(Protocol protocol, uint8_t id, uint8_t error_byte) noexcept
Decode the error byte of a status packet.
Definition dynamixel_types.hpp:504
AlertPolicy
What a reply with a hardware alert means for the call.
Definition dynamixel_types.hpp:195
@ Errors
Clear registered errors (Y series only in the e-Manual).
@ MultiTurn
Reset the present position to one turn (0 to 4095); only while stopped.
@ DataLimitError
The value is outside a configured limit.
@ ResultFail
The instruction could not be processed.
@ DataRangeError
The value is outside the register's range.
@ CrcError
The servo's CRC check of the instruction failed.
@ DataLengthError
The data is shorter than the register.
@ InstructionError
Undefined instruction, or Action without a Reg Write.
@ AccessError
Read-only, write-only or undefined address, or an EEPROM write with torque on.
@ V1
Protocol 1.0: header FF FF, one-byte length, additive checksum, error flags.
@ PingOnly
Only ping instructions are answered.
@ All
Every instruction addressed to one servo is answered. Factory default.
@ InvalidArgument
An argument or a Config field is out of range; nothing was sent.
@ DeviceIdMismatch
The reply came from another ID than the one addressed, or the model differs.
@ Crc
The CRC-16 (protocol 2.0) or checksum (protocol 1.0) of a reply did not match.
@ Bus
A port hook returned false.
@ InvalidReply
A reply the protocol refuses: header, length, instruction or parameter count.
@ DeviceFault
The servo reported a hardware alert and AlertPolicy::Fail is set.
@ NotInitialized
EnsureInitialized() has not succeeded, or Deinitialize() ran since.
@ EchoMismatch
The transmitted bytes were not read back as sent (collision or wiring).
@ Ok
The call succeeded.
@ Unsupported
The hook, protocol or family does not offer this call.
@ NotPermitted
A destructive instruction without Config::allow_destructive.
@ DeviceError
The servo rejected the instruction: see GetLastReply() for the error number.
@ Timeout
No complete reply within the deadline (nothing, or a truncated packet).
@ LineFault
The line carried only 0x00 or only 0xFF: stuck low, stuck high or floating.
@ Busy
Reserved by the shared set; this driver has no pending state.
@ KeepIdAndBaud
Reset all except ID and baud rate.
@ KeepId
Reset all except ID.
@ Warning
Something unexpected that the driver recovered from.
@ Info
Lifecycle events: initialised, resynchronised.
@ Debug
Detail for bring-up.
@ Loopback
TX and RX are tied: every sent byte is read back and compared.
@ None
Separate lines or a direction-controlled transceiver: nothing is echoed.
@ Restore
Restore the EEPROM from the backup; the servo reboots.
@ Store
Store the control table in the backup area (torque must be off).
@ Fail
The call returns DeviceFault and discards the data; the alert is latched too.
constexpr uint8_t kInputVoltage
Input voltage out of range.
Definition dynamixel_types.hpp:268
constexpr uint8_t kOverheating
Temperature above the limit.
Definition dynamixel_types.hpp:269
constexpr uint8_t kMotorEncoder
Motor encoder malfunction (X430, X540, MX(2.0)).
Definition dynamixel_types.hpp:270
constexpr uint8_t kOverload
Persistent load above the maximum output.
Definition dynamixel_types.hpp:272
constexpr uint8_t kElectricalShock
Electrical shock or too little power.
Definition dynamixel_types.hpp:271
constexpr uint8_t kAngleLimit
Goal position outside the angle limits (command fault).
Definition dynamixel_types.hpp:244
constexpr uint8_t kRange
An instruction value out of range (command fault).
Definition dynamixel_types.hpp:247
constexpr uint8_t kChecksum
The instruction's checksum was wrong (command fault).
Definition dynamixel_types.hpp:248
constexpr uint8_t kOverload
Load beyond what the torque limit controls (condition).
Definition dynamixel_types.hpp:250
constexpr uint8_t kInputVoltage
Input voltage out of the configured range (condition).
Definition dynamixel_types.hpp:242
constexpr uint8_t kCommandFaults
Flags that mean the instruction was not carried out.
Definition dynamixel_types.hpp:255
constexpr uint8_t kOverheating
Internal temperature above the limit (condition).
Definition dynamixel_types.hpp:246
constexpr uint8_t kInstruction
Definition dynamixel_types.hpp:252
constexpr uint8_t kConditions
Flags that report the servo's condition, not the instruction.
Definition dynamixel_types.hpp:258
The DYNAMIXEL driver: everything it declares lives here; internals in detail.
Definition dynamixel.hpp:35
@ ReadOnly
R: a write is an access error.
Family
A servo family: one control table layout (several models share it).
Definition dynamixel_tables.hpp:30
@ Generic
Unknown or unlisted model: raw addresses only.
@ None
No baud register in the table (generic).
One device of a Bulk Read request.
Definition dynamixel_types.hpp:315
uint16_t address
First control-table address.
Definition dynamixel_types.hpp:317
uint16_t length
Bytes to read.
Definition dynamixel_types.hpp:318
One device of a Bulk Write request.
Definition dynamixel_types.hpp:322
uint16_t address
First control-table address.
Definition dynamixel_types.hpp:324
std::span< const uint8_t > data
The bytes to write there (at least one).
Definition dynamixel_types.hpp:325
Everything the driver needs to know about the bus.
Definition dynamixel_types.hpp:385
uint32_t baud
Bit rate of the UART; applied through SetBaudRate() when the port has it.
Definition dynamixel_types.hpp:387
bool allow_destructive
Permit Factory Reset, Backup Restore and writes to the ID with broadcast.
Definition dynamixel_types.hpp:404
uint32_t baud_change_wait_us
Wait after a servo's baud rate changed.
Definition dynamixel_types.hpp:394
EchoMode echo
Single-wire loopback verification.
Definition dynamixel_types.hpp:397
AlertPolicy alert_policy
What a hardware alert in a reply does to the call.
Definition dynamixel_types.hpp:398
uint8_t retries
Repeats of a ping or read after a bad or missing reply, 0 to kMaxRetries.
Definition dynamixel_types.hpp:395
uint32_t reboot_wait_us
Definition dynamixel_types.hpp:392
Protocol protocol
Packet format of every servo on the bus.
Definition dynamixel_types.hpp:386
uint32_t reply_timeout_us
Longest wait for the first byte of a reply (kMinTimeoutUs to kMaxTimeoutUs).
Definition dynamixel_types.hpp:389
StatusReturn status_return
How much the servos answer (applies to the whole bus).
Definition dynamixel_types.hpp:400
uint32_t broadcast_timeout_us
Wait for each reply of a broadcast ping (the servos answer in ID order).
Definition dynamixel_types.hpp:402
uint32_t gap_timeout_us
Longest wait for the next byte inside a packet.
Definition dynamixel_types.hpp:391
The per-device outcome of a Sync Read, Bulk Read or Fast read.
Definition dynamixel_types.hpp:307
bool alert
The alert or condition flag of this device's error byte.
Definition dynamixel_types.hpp:311
uint8_t error_byte
The raw error byte when a packet arrived.
Definition dynamixel_types.hpp:310
Error result
Ok, or why this device's data is not valid.
Definition dynamixel_types.hpp:309
Position, velocity, effort, voltage and temperature of a servo, read in one transfer.
Definition dynamixel_types.hpp:329
uint16_t voltage_dv
Input voltage in 0.1 V.
Definition dynamixel_types.hpp:341
int32_t velocity
Present Velocity (or Speed) in counts (Info(family).mrpm_per_count).
Definition dynamixel_types.hpp:338
EffortKind
What effort holds.
Definition dynamixel_types.hpp:331
@ LoadPermille
Present Load in 0.1 percent of the maximum torque (signed: negative is clockwise).
@ None
The family has neither load nor current.
@ CurrentCounts
Present Current in the model's unit (ModelInfo::current_ua).
EffortKind effort_kind
Meaning of effort.
Definition dynamixel_types.hpp:340
int32_t effort
Present Load or Present Current, see effort_kind.
Definition dynamixel_types.hpp:339
int32_t position
Present Position in counts.
Definition dynamixel_types.hpp:337
uint8_t temperature_c
Internal temperature in degrees Celsius.
Definition dynamixel_types.hpp:342
The identity a ping returns.
Definition dynamixel_types.hpp:291
uint8_t firmware
Firmware Version register.
Definition dynamixel_types.hpp:294
Family family
The control table family of model (Generic when unlisted).
Definition dynamixel_types.hpp:295
uint16_t model
Model Number register.
Definition dynamixel_types.hpp:293
An error byte, decoded.
Definition dynamixel_types.hpp:282
bool rejected
Definition dynamixel_types.hpp:286
bool alert
Protocol 2.0 alert bit, or a protocol 1.0 condition flag.
Definition dynamixel_types.hpp:285
uint8_t error_byte
The raw error byte of the status packet.
Definition dynamixel_types.hpp:284
uint8_t id
The ID the reply came from; the first device for a broadcast ping.
Definition dynamixel_types.hpp:283
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition dynamixel_types.hpp:167
static constexpr Result Success() noexcept
Definition dynamixel_types.hpp:159
constexpr bool ok() const noexcept
Definition dynamixel_types.hpp:150
The value of a call, or why there is none.
Definition dynamixel_types.hpp:113
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition dynamixel_types.hpp:139
static constexpr Result Success(T v) noexcept
A successful result.
Definition dynamixel_types.hpp:131
constexpr bool ok() const noexcept
Definition dynamixel_types.hpp:118
A servo on the bus: its ID and its control-table family.
Definition dynamixel_types.hpp:300
Family family
Selects the typed registers; Generic allows raw addresses only.
Definition dynamixel_types.hpp:302
What the driver counted since ResetStats().
Definition dynamixel_types.hpp:346
uint32_t timeouts
Replies that did not arrive in time.
Definition dynamixel_types.hpp:349
uint32_t retries
Repeats of an idempotent instruction after a bad or missing reply.
Definition dynamixel_types.hpp:348
uint32_t transactions
Instruction packets sent.
Definition dynamixel_types.hpp:347
uint32_t device_errors
Status packets with a rejecting error byte.
Definition dynamixel_types.hpp:354
uint32_t crc_errors
Packets dropped for a wrong CRC or checksum.
Definition dynamixel_types.hpp:350
uint32_t echo_errors
Loopback echoes that differed.
Definition dynamixel_types.hpp:353
uint32_t alerts
Status packets with an alert or condition flag.
Definition dynamixel_types.hpp:355
uint32_t garbage_bytes
Received bytes skipped while looking for a header.
Definition dynamixel_types.hpp:351
uint32_t line_faults
Stuck or floating line detections.
Definition dynamixel_types.hpp:352