75 #ifndef DOXYGEN_OMIT_INTERNAL 76 FloatField(HebiCommandRef&
internal, HebiCommandFloatField field);
77 #endif // DOXYGEN_OMIT_INTERNAL 78 explicit operator bool()
const {
return has(); }
97 void set(
float value);
103 HebiCommandRef& internal_;
104 HebiCommandFloatField
const field_;
114 #ifndef DOXYGEN_OMIT_INTERNAL 116 #endif // DOXYGEN_OMIT_INTERNAL 117 explicit operator bool()
const {
return has(); }
149 void get(int64_t* revolutions,
float* radian_offset)
const;
154 void set(
double radians);
161 void set(int64_t revolutions,
float radian_offset);
167 HebiCommandRef& internal_;
168 HebiCommandHighResAngleField
const field_;
175 #ifndef DOXYGEN_OMIT_INTERNAL 177 #endif // DOXYGEN_OMIT_INTERNAL 178 bool has(
size_t fieldNumber)
const;
189 float get(
size_t fieldNumber)
const;
195 void set(
size_t fieldNumber,
float value);
201 void clear(
size_t fieldNumber);
205 HebiCommandRef& internal_;
206 HebiCommandNumberedFloatField
const field_;
212 #ifndef DOXYGEN_OMIT_INTERNAL 213 BoolField(HebiCommandRef&
internal, HebiCommandBoolField field);
214 #endif // DOXYGEN_OMIT_INTERNAL 221 void set(
bool value);
227 HebiCommandRef& internal_;
228 HebiCommandBoolField
const field_;
234 #ifndef DOXYGEN_OMIT_INTERNAL 235 StringField(HebiCommandPtr
internal, HebiCommandStringField field);
236 #endif // DOXYGEN_OMIT_INTERNAL 237 explicit operator bool()
const {
return has(); }
254 std::string
get()
const;
256 void set(
const std::string& value);
262 HebiCommandPtr
const internal_;
263 HebiCommandStringField
const field_;
269 #ifndef DOXYGEN_OMIT_INTERNAL 270 FlagField(HebiCommandRef&
internal, HebiCommandFlagField field);
271 #endif // DOXYGEN_OMIT_INTERNAL 272 explicit operator bool()
const {
return has(); }
294 HebiCommandRef& internal_;
295 HebiCommandFlagField
const field_;
302 #ifndef DOXYGEN_OMIT_INTERNAL 303 EnumField(HebiCommandRef&
internal, HebiCommandEnumField field) : internal_(
internal), field_(field) {}
304 #endif // DOXYGEN_OMIT_INTERNAL 305 explicit operator bool()
const {
return has(); }
320 return enumGetter(internal_, field_,
nullptr) == HebiStatusSuccess;
327 return static_cast<T>(ret);
331 int32_t value = static_cast<int32_t>(_value);
341 HebiCommandRef& internal_;
342 HebiCommandEnumField
const field_;
348 #ifndef DOXYGEN_OMIT_INTERNAL 349 IoBank(HebiCommandRef&
internal, HebiCommandIoPinBank bank);
350 #endif // DOXYGEN_OMIT_INTERNAL 351 bool hasInt(
size_t pinNumber)
const;
362 bool hasFloat(
size_t pinNumber)
const;
368 int64_t
getInt(
size_t pinNumber)
const;
375 float getFloat(
size_t pinNumber)
const;
381 void setInt(
size_t pinNumber, int64_t value);
387 void setFloat(
size_t pinNumber,
float value);
392 void clear(
size_t pinNumber);
396 HebiCommandRef& internal_;
397 HebiCommandIoPinBank
const bank_;
402 #ifndef DOXYGEN_OMIT_INTERNAL 403 LedField(HebiCommandRef&
internal, HebiCommandLedField field);
404 #endif // DOXYGEN_OMIT_INTERNAL 435 HebiCommandRef& internal_;
436 HebiCommandLedField
const field_;
442 #ifndef DOXYGEN_OMIT_INTERNAL 443 Io(HebiCommandRef&
internal)
444 : internal_(
internal),
445 a_(
internal, HebiCommandIoBankA),
446 b_(
internal, HebiCommandIoBankB),
447 c_(
internal, HebiCommandIoBankC),
448 d_(
internal, HebiCommandIoBankD),
449 e_(
internal, HebiCommandIoBankE),
450 f_(
internal, HebiCommandIoBankF) {}
451 #endif // DOXYGEN_OMIT_INTERNAL 485 HebiCommandRef& internal_;
503 #ifndef DOXYGEN_OMIT_INTERNAL 505 : position_gains_(
internal, HebiCommandFloatPositionKp, HebiCommandBoolPositionDOnError),
506 velocity_gains_(
internal, HebiCommandFloatVelocityKp, HebiCommandBoolVelocityDOnError),
507 effort_gains_(
internal, HebiCommandFloatEffortKp, HebiCommandBoolEffortDOnError),
508 spring_constant_(
internal, HebiCommandFloatSpringConstant),
509 reference_position_(
internal, HebiCommandFloatReferencePosition),
510 reference_effort_(
internal, HebiCommandFloatReferenceEffort),
511 velocity_limit_min_(
internal, HebiCommandFloatVelocityLimitMin),
512 velocity_limit_max_(
internal, HebiCommandFloatVelocityLimitMax),
513 effort_limit_min_(
internal, HebiCommandFloatEffortLimitMin),
514 effort_limit_max_(
internal, HebiCommandFloatEffortLimitMax),
515 position_limit_min_(
internal, HebiCommandHighResAnglePositionLimitMin),
516 position_limit_max_(
internal, HebiCommandHighResAnglePositionLimitMax),
517 control_strategy_(
internal, HebiCommandEnumControlStrategy),
518 mstop_strategy_(
internal, HebiCommandEnumMstopStrategy),
519 min_position_limit_strategy_(
internal, HebiCommandEnumMinPositionLimitStrategy),
520 max_position_limit_strategy_(
internal, HebiCommandEnumMaxPositionLimitStrategy) {}
521 #endif // DOXYGEN_OMIT_INTERNAL 622 #ifndef DOXYGEN_OMIT_INTERNAL 623 Imu(HebiCommandRef&
internal)
624 : internal_(
internal), accel_includes_gravity_(
internal, HebiCommandBoolAccelIncludesGravity) {}
625 #endif // DOXYGEN_OMIT_INTERNAL 639 const HebiCommandRef& internal_;
645 #ifndef DOXYGEN_OMIT_INTERNAL 646 Settings(HebiCommandPtr internal_ptr, HebiCommandRef&
internal)
647 : internal_(internal),
650 name_(internal_ptr, HebiCommandStringName),
651 family_(internal_ptr, HebiCommandStringFamily),
652 save_current_settings_(internal, HebiCommandFlagSaveCurrentSettings) {}
653 #endif // DOXYGEN_OMIT_INTERNAL 691 HebiCommandRef& internal_;
704 #ifndef DOXYGEN_OMIT_INTERNAL 706 : internal_(
internal),
707 velocity_(
internal, HebiCommandFloatVelocity),
708 effort_(
internal, HebiCommandFloatEffort),
709 position_(
internal, HebiCommandHighResAnglePosition) {}
710 #endif // DOXYGEN_OMIT_INTERNAL 732 const HebiCommandRef& internal_;
744 HebiCommandPtr internal_;
745 HebiCommandRef internal_ref_;
748 #ifndef DOXYGEN_OMIT_INTERNAL 754 #endif // DOXYGEN_OMIT_INTERNAL 768 const Io&
io()
const {
return io_; }
780 #ifndef DOXYGEN_OMIT_INTERNAL 781 NumberedFloatField& debug() {
return debug_; }
784 const NumberedFloatField& debug()
const {
return debug_; }
785 #endif // DOXYGEN_OMIT_INTERNAL 786 StringField&
appendLog() {
return append_log_; }
824 NumberedFloatField debug_;
825 StringField append_log_;
828 FlagField stop_boot_;
829 FlagField clear_log_;
const FloatField & referencePosition() const
Definition: command.hpp:552
void clear()
Removes any currently set value for this field.
Definition: command.cpp:108
void set(const Color &color)
Commands a color that overrides the module's control of the LED (if the alpha channel is 255),...
Definition: command.cpp:200
bool has() const
True if (and only if) the field has a value.
Definition: command.hpp:319
void clear()
Removes any currently set value for this field.
Definition: command.cpp:67
const IoBank & a() const
I/O pin bank a (pins 1-8 available)
Definition: command.hpp:461
IoBank & f()
I/O pin bank f (pins 1-8 available)
Definition: command.hpp:479
FlagField & reset()
Restart the module.
Definition: command.hpp:791
FlagField & saveCurrentSettings()
Indicates if the module should save the current values of all of its settings.
Definition: command.hpp:684
IoBank & d()
I/O pin bank d (pins 1-8 available)
Definition: command.hpp:471
const EnumField< PositionLimitStrategy > & minPositionLimitStrategy() const
The position limit strategy (at the minimum position) for the actuator.
Definition: command.hpp:592
MstopStrategy
Definition: command.hpp:51
const FloatField & effortLimitMin() const
The firmware safety limit for the minimum allowed effort.
Definition: command.hpp:568
const FloatField & velocityLimitMin() const
The firmware safety limit for the minimum allowed velocity.
Definition: command.hpp:560
HighResAngleField & positionLimitMax()
The firmware safety limit for the maximum allowed position.
Definition: command.hpp:578
#define HEBI_DISABLE_COPY(Class)
Definition: util.hpp:16
void clear()
Removes any currently set value for this field.
Definition: command.cpp:27
A message field representable by a bool value.
Definition: command.hpp:210
Actuator & actuator()
Actuator-specific commands.
Definition: command.hpp:774
Actuator-specific commands.
Definition: command.hpp:702
void hebiCommandSetEnum(HebiCommandRef &command, HebiCommandEnumField field, const int32_t *value)
Definition: message_helpers.cpp:388
Io & io()
Any available digital or analog output pins on the device.
Definition: command.hpp:766
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:724
Triggering the M-Stop results in the control strategy being set to 'off'. Remains 'off' until changed...
Settings & settings()
Module settings that are typically changed at a slower rate.
Definition: command.hpp:770
const Io & io() const
Any available digital or analog output pins on the device.
Definition: command.hpp:768
FloatField & springConstant()
The spring constant of the module.
Definition: command.hpp:544
bool get() const
If the field has a value, returns that value; otherwise, returns false.
Definition: command.cpp:97
FloatField & effortLimitMin()
The firmware safety limit for the minimum allowed effort.
Definition: command.hpp:566
bool has() const
True if (and only if) the field has a value.
Definition: command.cpp:95
A message field for interfacing with a bank of I/O pins.
Definition: command.hpp:346
Triggering the M-Stop results in the motor holding the motor position. Operations resume to normal on...
FlagField & boot()
Boot the module from bootloader into application.
Definition: command.hpp:795
Actuator & actuator()
Actuator-specific settings, such as controller gains.
Definition: command.hpp:661
const HighResAngleField & position() const
Position of the module output (post-spring), in radians.
Definition: command.hpp:728
const IoBank & d() const
I/O pin bank d (pins 1-8 available)
Definition: command.hpp:473
void setInt(size_t pinNumber, int64_t value)
Sets the particular pin to a integer value (representing a digital output).
Definition: command.cpp:170
StringField & family()
Definition: command.hpp:679
Command objects have various fields that can be set; when sent to the module, these fields control in...
Definition: command.hpp:33
const BoolField & accelIncludesGravity() const
Whether to include acceleration due to gravity in acceleration feedback.
Definition: command.hpp:635
IoBank & a()
I/O pin bank a (pins 1-8 available)
Definition: command.hpp:459
A message field representable by a std::string.
Definition: command.hpp:232
BoolField & accelIncludesGravity()
Whether to include acceleration due to gravity in acceleration feedback.
Definition: command.hpp:633
void clear(size_t fieldNumber)
Removes any currently set value for the numbered subvalue of this field.
Definition: command.cpp:88
void set(size_t fieldNumber, float value)
Sets the particular numbered subvalue of this field to a given value.
Definition: command.cpp:84
std::string get() const
If the field has a value, returns a copy of that value; otherwise, returns a default.
Definition: command.cpp:117
void set()
Sets this flag.
Definition: command.cpp:144
A message field for interfacing with an LED.
Definition: command.hpp:400
const FlagField & clearLog() const
Clears the log message on the module.
Definition: command.hpp:805
Exceeding the position limit results in the actuator holding the position. Needs to be manually set t...
const FloatField & effortLimitMax() const
The firmware safety limit for the maximum allowed effort.
Definition: command.hpp:572
The motor is not given power (equivalent to a 0 PWM value)
const StringField & name() const
Definition: command.hpp:676
CommandGains & effortGains()
Controller gains for the effort PID loop.
Definition: command.hpp:537
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:6
const FlagField & reset() const
Restart the module.
Definition: command.hpp:793
const IoBank & c() const
I/O pin bank c (pins 1-8 available)
Definition: command.hpp:469
IoBank & c()
I/O pin bank c (pins 1-8 available)
Definition: command.hpp:467
const CommandGains & effortGains() const
Controller gains for the effort PID loop.
Definition: command.hpp:539
HighResAngleField & position()
Position of the module output (post-spring), in radians.
Definition: command.hpp:726
const FloatField & springConstant() const
The spring constant of the module.
Definition: command.hpp:546
Exceeding the position limit results in the control strategy being set to 'off'. Remains 'off' until ...
const EnumField< ControlStrategy > & controlStrategy() const
How the position, velocity, and effort PID loops are connected in order to control motor PWM.
Definition: command.hpp:584
CommandGains & velocityGains()
Controller gains for the velocity PID loop.
Definition: command.hpp:533
const IoBank & b() const
I/O pin bank b (pins 1-8 available)
Definition: command.hpp:465
Actuator-specific settings, such as controller gains.
Definition: command.hpp:501
Module settings that are typically changed at a slower rate.
Definition: command.hpp:498
const CommandGains & positionGains() const
Controller gains for the position PID loop.
Definition: command.hpp:531
FloatField & referencePosition()
Definition: command.hpp:549
bool has() const
True if (and only if) the field has a value.
Definition: command.cpp:32
const Settings & settings() const
Module settings that are typically changed at a slower rate.
Definition: command.hpp:772
A two-state message field (either set/true or cleared/false).
Definition: command.hpp:267
void set(T _value)
Sets the field to a given value.
Definition: command.hpp:330
bool has() const
Returns true if the flag is set, false if it is cleared.
Definition: command.cpp:142
StringField & appendLog()
Appends to the current log message on the module.
Definition: command.hpp:787
const Actuator & actuator() const
Actuator-specific settings, such as controller gains.
Definition: command.hpp:663
IoBank & b()
I/O pin bank b (pins 1-8 available)
Definition: command.hpp:463
const IoBank & e() const
I/O pin bank e (pins 1-8 available)
Definition: command.hpp:477
A message field containing a numbered set of single-precision floating point values.
Definition: command.hpp:173
Triggering the M-Stop has no effect.
HebiStatusCode enumGetter(const RefT &ref, MetadataT &metadata, int field, int32_t *value)
Definition: message_helpers.cpp:298
const StringField & family() const
Definition: command.hpp:682
Color get() const
Returns the current LED command.
Definition: command.cpp:189
int64_t getInt(size_t pinNumber) const
If this numbered pin in this bank has an integer (e.g., digital) value, returns that value; otherwise...
Definition: command.cpp:158
double get() const
If the field has a value, returns that value as a double; otherwise, returns a default.
Definition: command.cpp:36
const FlagField & boot() const
Boot the module from bootloader into application.
Definition: command.hpp:797
FloatField & effortLimitMax()
The firmware safety limit for the maximum allowed effort.
Definition: command.hpp:570
EnumField< ControlStrategy > & controlStrategy()
How the position, velocity, and effort PID loops are connected in order to control motor PWM.
Definition: command.hpp:582
const LedField & led() const
The module's LED.
Definition: command.hpp:809
HighResAngleField & positionLimitMin()
The firmware safety limit for the minimum allowed position.
Definition: command.hpp:574
float getFloat(size_t pinNumber) const
If this numbered pin in this bank has an floating point (e.g., analog or PWM) value,...
Definition: command.cpp:164
FloatField & velocity()
Velocity of the module output (post-spring), in radians/second.
Definition: command.hpp:718
Exceeding the position limit results in a virtual spring that pushes the actuator back to within the ...
Any available digital or analog output pins on the device.
Definition: command.hpp:440
const HighResAngleField & positionLimitMin() const
The firmware safety limit for the minimum allowed position.
Definition: command.hpp:576
float get() const
If the field has a value, returns that value; otherwise, returns a default.
Definition: command.cpp:17
FloatField & referenceEffort()
The internal effort reference offset (setting this matches the current effort to the given reference ...
Definition: command.hpp:554
ControlStrategy
Definition: command.hpp:35
const EnumField< PositionLimitStrategy > & maxPositionLimitStrategy() const
The position limit strategy (at the maximum position) for the actuator.
Definition: command.hpp:596
const HighResAngleField & positionLimitMax() const
The firmware safety limit for the maximum allowed position.
Definition: command.hpp:580
const Imu & imu() const
IMU-specific settings.
Definition: command.hpp:667
const FloatField & referenceEffort() const
The internal effort reference offset (setting this matches the current effort to the given reference ...
Definition: command.hpp:556
const FlagField & saveCurrentSettings() const
Indicates if the module should save the current values of all of its settings.
Definition: command.hpp:686
void clear()
Removes any currently set value for this field.
Definition: command.hpp:335
IoBank & e()
I/O pin bank e (pins 1-8 available)
Definition: command.hpp:475
FlagField & clearLog()
Clears the log message on the module.
Definition: command.hpp:803
EnumField< PositionLimitStrategy > & maxPositionLimitStrategy()
The position limit strategy (at the maximum position) for the actuator.
Definition: command.hpp:594
const EnumField< MstopStrategy > & mstopStrategy() const
The motion stop strategy for the actuator.
Definition: command.hpp:588
T get() const
If the field has a value, returns that value; otherwise, returns a default.
Definition: command.hpp:324
void clear()
Removes any currently set value for this field, so that the module maintains its previous state of LE...
Definition: command.cpp:204
Command(Command &&other)
Move constructor (necessary for containment in STL template classes)
Definition: command.cpp:208
A message field for an angle measurement which does not lose precision at very high angles.
Definition: command.hpp:112
void set(double radians)
Sets the field to a given double value (in radians). Note that double precision floating point number...
Definition: command.cpp:52
Imu & imu()
IMU-specific settings.
Definition: command.hpp:665
const FlagField & stopBoot() const
Stop the module from automatically booting into application.
Definition: command.hpp:801
void clear()
Removes any currently set value for this field.
Definition: command.cpp:137
EnumField< MstopStrategy > & mstopStrategy()
The motion stop strategy for the actuator.
Definition: command.hpp:586
void set(float value)
Sets the field to a given value.
Definition: command.cpp:25
bool has() const
True if (and only if) the field has a value.
Definition: command.cpp:113
void set(bool value)
Sets the field to a given value.
Definition: command.cpp:103
const FloatField & velocity() const
Velocity of the module output (post-spring), in radians/second.
Definition: command.hpp:720
const Actuator & actuator() const
Actuator-specific commands.
Definition: command.hpp:776
float get(size_t fieldNumber) const
If the particular numbered subvalue of this field has a value, returns that value; otherwise returns ...
Definition: command.cpp:76
FloatField & velocityLimitMax()
The firmware safety limit for the maximum allowed velocity.
Definition: command.hpp:562
const StringField & appendLog() const
Appends to the current log message on the module.
Definition: command.hpp:789
const FloatField & velocityLimitMax() const
The firmware safety limit for the maximum allowed velocity.
Definition: command.hpp:564
IMU-specific settings.
Definition: command.hpp:620
StringField & name()
Definition: command.hpp:673
LedField & led()
The module's LED.
Definition: command.hpp:807
void setFloat(size_t pinNumber, float value)
Sets the particular pin to a floating point value (representing a PWM output).
Definition: command.cpp:174
Exceeding the position limit has no effect.
bool has() const
Returns true if the LED command has been set, and false otherwise.
Definition: command.cpp:185
bool hasFloat(size_t pinNumber) const
True if (and only if) the particular numbered pin in this bank has an floating point (e....
Definition: command.cpp:154
const CommandGains & velocityGains() const
Controller gains for the velocity PID loop.
Definition: command.hpp:535
bool hasInt(size_t pinNumber) const
True if (and only if) the particular numbered pin in this bank has an integer (e.g....
Definition: command.cpp:150
const IoBank & f() const
I/O pin bank f (pins 1-8 available)
Definition: command.hpp:481
A direct PWM value (-1 to 1) can be sent to the motor (subject to onboard safety limiting).
Structure to describe an RGB color.
Definition: color.hpp:8
CommandGains & positionGains()
Controller gains for the position PID loop.
Definition: command.hpp:529
A message field representable by a single-precision floating point value.
Definition: command.hpp:73
bool has(size_t fieldNumber) const
True if (and only if) the particular numbered subvalue of this field has a value.
Definition: command.cpp:72
void clear()
Clears this flag (e.g., sets it to false/off).
Definition: command.cpp:146
Command & operator=(Command &&other)=delete
PositionLimitStrategy
Definition: command.hpp:60
bool has() const
True if (and only if) the field has a value.
Definition: command.cpp:15
FloatField & velocityLimitMin()
The firmware safety limit for the minimum allowed velocity.
Definition: command.hpp:558
void clear(size_t pinNumber)
Removes any currently set value for this pin.
Definition: command.cpp:178
void set(const std::string &value)
Sets the field to a given value.
Definition: command.cpp:131
EnumField< PositionLimitStrategy > & minPositionLimitStrategy()
The position limit strategy (at the minimum position) for the actuator.
Definition: command.hpp:590
FlagField & stopBoot()
Stop the module from automatically booting into application.
Definition: command.hpp:799
A message field representable by an enum of a given type.
Definition: command.hpp:300
FloatField & effort()
Effort at the module output; units vary (e.g., N * m for rotational joints and N for linear stages).
Definition: command.hpp:722