52 #ifndef DOXYGEN_OMIT_INTERNAL 53 FloatField(HebiCommandPtr
internal, HebiCommandFloatField field);
54 #endif // DOXYGEN_OMIT_INTERNAL 55 explicit operator bool()
const;
74 void set(
float value);
79 HebiCommandPtr
const internal_;
80 HebiCommandFloatField
const field_;
92 #ifndef DOXYGEN_OMIT_INTERNAL 94 #endif // DOXYGEN_OMIT_INTERNAL 95 explicit operator bool()
const;
127 void get(int64_t* revolutions,
float* radian_offset)
const;
132 void set(
double radians);
139 void set(int64_t revolutions,
float radian_offset);
144 HebiCommandPtr
const internal_;
145 HebiCommandHighResAngleField
const field_;
155 #ifndef DOXYGEN_OMIT_INTERNAL 157 #endif // DOXYGEN_OMIT_INTERNAL 158 bool has(
size_t fieldNumber)
const;
169 float get(
size_t fieldNumber)
const;
175 void set(
size_t fieldNumber,
float value);
181 void clear(
size_t fieldNumber);
184 HebiCommandPtr
const internal_;
185 HebiCommandNumberedFloatField
const field_;
194 #ifndef DOXYGEN_OMIT_INTERNAL 195 BoolField(HebiCommandPtr
internal, HebiCommandBoolField field);
196 #endif // DOXYGEN_OMIT_INTERNAL 203 void set(
bool value);
208 HebiCommandPtr
const internal_;
209 HebiCommandBoolField
const field_;
218 #ifndef DOXYGEN_OMIT_INTERNAL 219 StringField(HebiCommandPtr
internal, HebiCommandStringField field);
220 #endif // DOXYGEN_OMIT_INTERNAL 221 explicit operator bool()
const;
238 std::string
get()
const;
240 void set(
const std::string& value);
245 HebiCommandPtr
const internal_;
246 HebiCommandStringField
const field_;
255 #ifndef DOXYGEN_OMIT_INTERNAL 256 FlagField(HebiCommandPtr
internal, HebiCommandFlagField field);
257 #endif // DOXYGEN_OMIT_INTERNAL 258 explicit operator bool()
const;
279 HebiCommandPtr
const internal_;
280 HebiCommandFlagField
const field_;
286 template <
typename T>
290 #ifndef DOXYGEN_OMIT_INTERNAL 291 EnumField(HebiCommandPtr
internal, HebiCommandEnumField field)
292 : internal_(
internal), field_(field) {}
293 #endif // DOXYGEN_OMIT_INTERNAL 294 explicit operator bool()
const {
return has(); }
308 bool has()
const {
return (hebiCommandGetEnum(internal_, field_,
nullptr) == HebiStatusSuccess); }
311 T
get()
const { int32_t ret{}; hebiCommandGetEnum(internal_, field_, &ret);
return static_cast<T
>(ret); }
313 void set(T _value) { int32_t value =
static_cast<int32_t
>(_value); hebiCommandSetEnum(internal_, field_, &value); }
315 void clear() { hebiCommandSetEnum(internal_, field_,
nullptr); }
318 HebiCommandPtr
const internal_;
319 HebiCommandEnumField
const field_;
328 #ifndef DOXYGEN_OMIT_INTERNAL 329 IoBank(HebiCommandPtr
internal, HebiCommandIoPinBank bank);
330 #endif // DOXYGEN_OMIT_INTERNAL 331 bool hasInt(
size_t pinNumber)
const;
342 bool hasFloat(
size_t pinNumber)
const;
348 int64_t getInt(
size_t pinNumber)
const;
355 float getFloat(
size_t pinNumber)
const;
361 void setInt(
size_t pinNumber, int64_t value);
367 void setFloat(
size_t pinNumber,
float value);
372 void clear(
size_t pinNumber);
375 HebiCommandPtr
const internal_;
376 HebiCommandIoPinBank
const bank_;
384 #ifndef DOXYGEN_OMIT_INTERNAL 385 LedField(HebiCommandPtr
internal, HebiCommandLedField field);
386 #endif // DOXYGEN_OMIT_INTERNAL 408 void set(
const Color& color);
416 HebiCommandPtr
const internal_;
417 HebiCommandLedField
const field_;
426 #ifndef DOXYGEN_OMIT_INTERNAL 427 Io(HebiCommandPtr
internal)
428 : internal_(
internal),
429 a_(
internal, HebiCommandIoBankA),
430 b_(
internal, HebiCommandIoBankB),
431 c_(
internal, HebiCommandIoBankC),
432 d_(
internal, HebiCommandIoBankD),
433 e_(
internal, HebiCommandIoBankE),
434 f_(
internal, HebiCommandIoBankF)
437 #endif // DOXYGEN_OMIT_INTERNAL 470 HebiCommandPtr
const internal_;
493 #ifndef DOXYGEN_OMIT_INTERNAL 495 : internal_(
internal),
496 position_gains_(
internal, HebiCommandFloatPositionKp, HebiCommandBoolPositionDOnError),
497 velocity_gains_(
internal, HebiCommandFloatVelocityKp, HebiCommandBoolVelocityDOnError),
498 effort_gains_(
internal, HebiCommandFloatEffortKp, HebiCommandBoolEffortDOnError),
499 spring_constant_(
internal, HebiCommandFloatSpringConstant),
500 reference_position_(
internal, HebiCommandFloatReferencePosition),
501 reference_effort_(
internal, HebiCommandFloatReferenceEffort),
502 control_strategy_(
internal, HebiCommandEnumControlStrategy)
505 #endif // DOXYGEN_OMIT_INTERNAL 545 HebiCommandPtr
const internal_;
560 #ifndef DOXYGEN_OMIT_INTERNAL 562 : internal_(
internal),
564 name_(
internal, HebiCommandStringName),
565 family_(
internal, HebiCommandStringFamily),
566 save_current_settings_(
internal, HebiCommandFlagSaveCurrentSettings)
569 #endif // DOXYGEN_OMIT_INTERNAL 597 HebiCommandPtr
const internal_;
612 #ifndef DOXYGEN_OMIT_INTERNAL 614 : internal_(
internal),
615 velocity_(
internal, HebiCommandFloatVelocity),
616 effort_(
internal, HebiCommandFloatEffort),
617 position_(
internal, HebiCommandHighResAnglePosition)
620 #endif // DOXYGEN_OMIT_INTERNAL 641 HebiCommandPtr
const internal_;
655 HebiCommandPtr internal_;
658 #ifndef DOXYGEN_OMIT_INTERNAL 664 #endif // DOXYGEN_OMIT_INTERNAL 682 const Io&
io()
const {
return io_; }
694 #ifndef DOXYGEN_OMIT_INTERNAL 699 #endif // DOXYGEN_OMIT_INTERNAL IoBank & f()
I/O pin bank f (pins 1-8 available)
Definition: command.hpp:465
const CommandGains & velocityGains() const
Controller gains for the velocity PID loop.
Definition: command.hpp:519
FlagField & saveCurrentSettings()
Indicates if the module should save the current values of all of its settings.
Definition: command.hpp:592
IoBank & d()
I/O pin bank d (pins 1-8 available)
Definition: command.hpp:457
const FloatField & velocity() const
Velocity of the module output (post-spring), in radians/second.
Definition: command.hpp:630
const FloatField & effort() const
Effort at the module output; units vary (e.g., N * m for rotational joints and N for linear stages)...
Definition: command.hpp:634
#define HEBI_DISABLE_COPY(Class)
Definition: util.hpp:17
const FloatField & springConstant() const
The spring constant of the module.
Definition: command.hpp:530
A message field representable by a bool value.
Definition: command.hpp:191
Actuator & actuator()
Actuator-specific commands.
Definition: command.hpp:688
Actuator-specific commands.
Definition: command.hpp:609
Io & io()
Any available digital or analog output pins on the device.
Definition: command.hpp:680
Settings & settings()
Module settings that are typically changed at a slower rate.
Definition: command.hpp:684
const StringField & name() const
Sets the name for this module. Name must be null-terminated character string for the name; must be <=...
Definition: command.hpp:586
FloatField & springConstant()
The spring constant of the module.
Definition: command.hpp:528
A message field for interfacing with a bank of I/O pins.
Definition: command.hpp:325
const Actuator & actuator() const
Actuator-specific commands.
Definition: command.hpp:690
Actuator & actuator()
Actuator-specific settings, such as controller gains.
Definition: command.hpp:577
StringField & family()
Sets the family for this module. Name must be null-terminated character string for the family; must b...
Definition: command.hpp:588
Command objects have various fields that can be set; when sent to the module, these fields control in...
Definition: command.hpp:30
~Command() noexcept
Cleans up command object as necessary.
Definition: command.cpp:327
IoBank & a()
I/O pin bank a (pins 1-8 available)
Definition: command.hpp:445
A message field representable by a std::string.
Definition: command.hpp:215
A combination of the position, velocity, and effort loops with P feeding to T and V feeding to PWM; d...
A message field for interfacing with an LED.
Definition: command.hpp:381
The motor is not given power (equivalent to a 0 PWM value)
bool has() const
True if (and only if) the field has a value.
Definition: command.hpp:308
CommandGains & effortGains()
Controller gains for the effort PID loop.
Definition: command.hpp:521
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:7
IoBank & c()
I/O pin bank c (pins 1-8 available)
Definition: command.hpp:453
HighResAngleField & position()
Position of the module output (post-spring), in radians.
Definition: command.hpp:636
CommandGains & velocityGains()
Controller gains for the velocity PID loop.
Definition: command.hpp:517
Actuator-specific settings, such as controller gains.
Definition: command.hpp:490
const Io & io() const
Any available digital or analog output pins on the device.
Definition: command.hpp:682
Module settings that are typically changed at a slower rate.
Definition: command.hpp:485
FloatField & referencePosition()
The internal encoder reference offset (setting this matches the current position to the given referen...
Definition: command.hpp:532
A combination of the position, velocity, and effort loops with P and V feeding to T; documented on do...
A two-state message field (either set/true or cleared/false).
Definition: command.hpp:252
const FloatField & referenceEffort() const
The internal effort reference offset (setting this matches the current effort to the given reference ...
Definition: command.hpp:538
const IoBank & e() const
I/O pin bank e (pins 1-8 available)
Definition: command.hpp:463
IoBank & b()
I/O pin bank b (pins 1-8 available)
Definition: command.hpp:449
A message field containing a numbered set of single-precision floating point values.
Definition: command.hpp:152
const Settings & settings() const
Module settings that are typically changed at a slower rate.
Definition: command.hpp:686
const IoBank & c() const
I/O pin bank c (pins 1-8 available)
Definition: command.hpp:455
const IoBank & b() const
I/O pin bank b (pins 1-8 available)
Definition: command.hpp:451
EnumField< ControlStrategy > & controlStrategy()
How the position, velocity, and effort PID loops are connected in order to control motor PWM...
Definition: command.hpp:540
FloatField & velocity()
Velocity of the module output (post-spring), in radians/second.
Definition: command.hpp:628
Any available digital or analog output pins on the device.
Definition: command.hpp:423
const IoBank & d() const
I/O pin bank d (pins 1-8 available)
Definition: command.hpp:459
FloatField & referenceEffort()
The internal effort reference offset (setting this matches the current effort to the given reference ...
Definition: command.hpp:536
ControlStrategy
Definition: command.hpp:33
const FloatField & referencePosition() const
The internal encoder reference offset (setting this matches the current position to the given referen...
Definition: command.hpp:534
void clear()
Removes any currently set value for this field.
Definition: command.hpp:315
A combination of the position, velocity, and effort loops with P, V, and T feeding to PWM; documented...
IoBank & e()
I/O pin bank e (pins 1-8 available)
Definition: command.hpp:461
Command(Command &&other)
Move constructor (necessary for containment in STL template classes)
Definition: command.cpp:318
A message field for an angle measurement which does not lose precision at very high angles...
Definition: command.hpp:89
const CommandGains & positionGains() const
Controller gains for the position PID loop.
Definition: command.hpp:515
StringField & name()
Sets the name for this module. Name must be null-terminated character string for the name; must be <=...
Definition: command.hpp:584
const IoBank & f() const
I/O pin bank f (pins 1-8 available)
Definition: command.hpp:467
const FlagField & saveCurrentSettings() const
Indicates if the module should save the current values of all of its settings.
Definition: command.hpp:594
const IoBank & a() const
I/O pin bank a (pins 1-8 available)
Definition: command.hpp:447
const EnumField< ControlStrategy > & controlStrategy() const
How the position, velocity, and effort PID loops are connected in order to control motor PWM...
Definition: command.hpp:542
const Actuator & actuator() const
Actuator-specific settings, such as controller gains.
Definition: command.hpp:579
A direct PWM value (-1 to 1) can be sent to the motor (subject to onboard safety limiting).
const CommandGains & effortGains() const
Controller gains for the effort PID loop.
Definition: command.hpp:523
Structure to describe an RGB color.
Definition: color.hpp:8
CommandGains & positionGains()
Controller gains for the position PID loop.
Definition: command.hpp:513
const StringField & family() const
Sets the family for this module. Name must be null-terminated character string for the family; must b...
Definition: command.hpp:590
A message field representable by a single-precision floating point value.
Definition: command.hpp:49
const HighResAngleField & position() const
Position of the module output (post-spring), in radians.
Definition: command.hpp:638
A message field representable by an enum of a given type.
Definition: command.hpp:287
FloatField & effort()
Effort at the module output; units vary (e.g., N * m for rotational joints and N for linear stages)...
Definition: command.hpp:632
LedField & led()
The module's LED.
Definition: command.cpp:347