87 #ifndef DOXYGEN_OMIT_INTERNAL 88 FloatField(
const HebiInfoRef&
internal, HebiInfoFloatField field);
89 #endif // DOXYGEN_OMIT_INTERNAL 90 explicit operator bool()
const {
return has(); }
111 const HebiInfoRef& internal_;
112 HebiInfoFloatField
const field_;
122 #ifndef DOXYGEN_OMIT_INTERNAL 124 #endif // DOXYGEN_OMIT_INTERNAL 125 explicit operator bool()
const {
return has(); }
157 void get(int64_t* revolutions,
float* radian_offset)
const;
161 const HebiInfoRef& internal_;
162 HebiInfoHighResAngleField
const field_;
168 #ifndef DOXYGEN_OMIT_INTERNAL 169 IpAddressField(
const HebiInfoRef&
internal, HebiInfoUInt64Field field);
170 #endif // DOXYGEN_OMIT_INTERNAL 171 explicit operator bool()
const {
return has(); }
192 const HebiInfoRef& internal_;
193 HebiInfoUInt64Field
const field_;
199 #ifndef DOXYGEN_OMIT_INTERNAL 200 BoolField(
const HebiInfoRef&
internal, HebiInfoBoolField field);
201 #endif // DOXYGEN_OMIT_INTERNAL 210 const HebiInfoRef& internal_;
211 HebiInfoBoolField
const field_;
217 #ifndef DOXYGEN_OMIT_INTERNAL 218 StringField(HebiInfoPtr
internal, HebiInfoStringField field);
219 #endif // DOXYGEN_OMIT_INTERNAL 220 explicit operator bool()
const {
return has(); }
237 std::string
get()
const;
241 HebiInfoPtr
const internal_;
242 HebiInfoStringField
const field_;
248 #ifndef DOXYGEN_OMIT_INTERNAL 249 FlagField(
const HebiInfoRef&
internal, HebiInfoFlagField field);
250 #endif // DOXYGEN_OMIT_INTERNAL 251 explicit operator bool()
const {
return has(); }
269 const HebiInfoRef& internal_;
270 HebiInfoFlagField
const field_;
277 #ifndef DOXYGEN_OMIT_INTERNAL 278 EnumField(
const HebiInfoRef&
internal, HebiInfoEnumField field) : internal_(
internal), field_(field) {}
279 #endif // DOXYGEN_OMIT_INTERNAL 280 explicit operator bool()
const {
return has(); }
295 return (
enumGetter(internal_, field_,
nullptr) == HebiStatusSuccess);
302 return static_cast<T>(ret);
307 const HebiInfoRef& internal_;
308 HebiInfoEnumField
const field_;
314 #ifndef DOXYGEN_OMIT_INTERNAL 315 IoBank(HebiInfoPtr
internal, HebiInfoRef& internal_ref, HebiInfoIoPinBank bank);
316 #endif // DOXYGEN_OMIT_INTERNAL 317 bool hasLabel(
size_t pinNumber)
const;
328 std::string
getLabel(
size_t pinNumber)
const;
332 HebiInfoPtr internal_;
333 HebiInfoRef& internal_ref_;
334 HebiInfoIoPinBank
const bank_;
339 #ifndef DOXYGEN_OMIT_INTERNAL 340 LedField(
const HebiInfoRef&
internal, HebiInfoLedField field);
341 #endif // DOXYGEN_OMIT_INTERNAL 342 explicit operator bool()
const {
return hasColor(); }
362 const HebiInfoRef& internal_;
363 HebiInfoLedField
const field_;
369 #ifndef DOXYGEN_OMIT_INTERNAL 370 Io(HebiInfoPtr
internal, HebiInfoRef& internal_ref)
371 : a_(
internal, internal_ref, HebiInfoIoBankA),
372 b_(
internal, internal_ref, HebiInfoIoBankB),
373 c_(
internal, internal_ref, HebiInfoIoBankC),
374 d_(
internal, internal_ref, HebiInfoIoBankD),
375 e_(
internal, internal_ref, HebiInfoIoBankE),
376 f_(
internal, internal_ref, HebiInfoIoBankF) {}
377 #endif // DOXYGEN_OMIT_INTERNAL 427 #ifndef DOXYGEN_OMIT_INTERNAL 428 Actuator(
const HebiInfoRef&
internal)
429 : position_gains_(
internal, HebiInfoFloatPositionKp, HebiInfoBoolPositionDOnError),
430 velocity_gains_(
internal, HebiInfoFloatVelocityKp, HebiInfoBoolVelocityDOnError),
431 effort_gains_(
internal, HebiInfoFloatEffortKp, HebiInfoBoolEffortDOnError),
432 spring_constant_(
internal, HebiInfoFloatSpringConstant),
433 velocity_limit_min_(
internal, HebiInfoFloatVelocityLimitMin),
434 velocity_limit_max_(
internal, HebiInfoFloatVelocityLimitMax),
435 effort_limit_min_(
internal, HebiInfoFloatEffortLimitMin),
436 effort_limit_max_(
internal, HebiInfoFloatEffortLimitMax),
437 position_limit_min_(
internal, HebiInfoHighResAnglePositionLimitMin),
438 position_limit_max_(
internal, HebiInfoHighResAnglePositionLimitMax),
439 control_strategy_(
internal, HebiInfoEnumControlStrategy),
440 mstop_strategy_(
internal, HebiInfoEnumMstopStrategy),
441 min_position_limit_strategy_(
internal, HebiInfoEnumMinPositionLimitStrategy),
442 max_position_limit_strategy_(
internal, HebiInfoEnumMaxPositionLimitStrategy) {}
443 #endif // DOXYGEN_OMIT_INTERNAL 504 #ifndef DOXYGEN_OMIT_INTERNAL 505 Imu(
const HebiInfoRef&
internal)
506 : accel_includes_gravity_(
internal, HebiInfoBoolAccelIncludesGravity) {}
507 #endif // DOXYGEN_OMIT_INTERNAL 523 #ifndef DOXYGEN_OMIT_INTERNAL 524 Settings(HebiInfoPtr internal_ptr,
const HebiInfoRef&
internal)
525 : actuator_(internal),
527 name_(internal_ptr, HebiInfoStringName),
528 family_(internal_ptr, HebiInfoStringFamily),
529 electrical_type_(internal_ptr, HebiInfoStringElectricalType),
530 electrical_revision_(internal_ptr, HebiInfoStringElectricalRevision),
531 mechanical_type_(internal_ptr, HebiInfoStringMechanicalType),
532 mechanical_revision_(internal_ptr, HebiInfoStringMechanicalRevision),
533 firmware_type_(internal_ptr, HebiInfoStringFirmwareType),
534 firmware_revision_(internal_ptr, HebiInfoStringFirmwareRevision),
535 user_settings_bytes_1_(internal_ptr, HebiInfoStringUserSettingsBytes1),
536 user_settings_bytes_2_(internal_ptr, HebiInfoStringUserSettingsBytes2),
537 user_settings_bytes_3_(internal_ptr, HebiInfoStringUserSettingsBytes3),
538 user_settings_bytes_4_(internal_ptr, HebiInfoStringUserSettingsBytes4),
539 user_settings_bytes_5_(internal_ptr, HebiInfoStringUserSettingsBytes5),
540 user_settings_bytes_6_(internal_ptr, HebiInfoStringUserSettingsBytes6),
541 user_settings_bytes_7_(internal_ptr, HebiInfoStringUserSettingsBytes7),
542 user_settings_bytes_8_(internal_ptr, HebiInfoStringUserSettingsBytes8),
543 user_settings_float_1_(internal, HebiInfoFloatUserSettingsFloat1),
544 user_settings_float_2_(internal, HebiInfoFloatUserSettingsFloat2),
545 user_settings_float_3_(internal, HebiInfoFloatUserSettingsFloat3),
546 user_settings_float_4_(internal, HebiInfoFloatUserSettingsFloat4),
547 user_settings_float_5_(internal, HebiInfoFloatUserSettingsFloat5),
548 user_settings_float_6_(internal, HebiInfoFloatUserSettingsFloat6),
549 user_settings_float_7_(internal, HebiInfoFloatUserSettingsFloat7),
550 user_settings_float_8_(internal, HebiInfoFloatUserSettingsFloat8),
551 ip_address_(internal, HebiInfoUInt64IpAddress),
552 subnet_mask_(internal, HebiInfoUInt64SubnetMask),
553 default_gateway_(internal, HebiInfoUInt64DefaultGateway),
554 save_current_settings_(internal, HebiInfoFlagSaveCurrentSettings) {}
555 #endif // DOXYGEN_OMIT_INTERNAL 590 case 1:
return user_settings_bytes_1_;
591 case 2:
return user_settings_bytes_2_;
592 case 3:
return user_settings_bytes_3_;
593 case 4:
return user_settings_bytes_4_;
594 case 5:
return user_settings_bytes_5_;
595 case 6:
return user_settings_bytes_6_;
596 case 7:
return user_settings_bytes_7_;
597 case 8:
return user_settings_bytes_8_;
599 throw std::out_of_range(
"Invalid option for bytes array user setting entry!");
606 case 1:
return user_settings_float_1_;
607 case 2:
return user_settings_float_2_;
608 case 3:
return user_settings_float_3_;
609 case 4:
return user_settings_float_4_;
610 case 5:
return user_settings_float_5_;
611 case 6:
return user_settings_float_6_;
612 case 7:
return user_settings_float_7_;
613 case 8:
return user_settings_float_8_;
615 throw std::out_of_range(
"Invalid option for float user setting entry!");
663 #ifndef DOXYGEN_OMIT_INTERNAL 664 Actuator(
const HebiInfoRef&
internal) : calibration_state_(
internal, HebiInfoEnumCalibrationState) {}
665 #endif // DOXYGEN_OMIT_INTERNAL 685 HebiInfoPtr internal_;
686 HebiInfoRef internal_ref_;
689 #ifndef DOXYGEN_OMIT_INTERNAL 695 #endif // DOXYGEN_OMIT_INTERNAL 709 const Io&
io()
const {
return io_; }
const FlagField & saveCurrentSettings() const
Indicates if the module should save the current values of all of its settings.
Definition: info.hpp:624
const IpAddressField & defaultGateway() const
Gets the default gateway for this module.
Definition: info.hpp:622
const FloatField & userSettingsFloat(size_t number) const
Definition: info.hpp:603
std::string get() const
If the field has a value, returns a copy of that value; otherwise, returns a default.
Definition: info.cpp:73
const HighResAngleField & positionLimitMin() const
The firmware safety limit for the minimum allowed position.
Definition: info.hpp:470
Module settings that are typically changed at a slower rate.
Definition: info.hpp:422
IoBank & f()
I/O pin bank f (pins 1-8 available)
Definition: info.hpp:405
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:69
A message field for an angle measurement which does not lose precision at very high angles.
Definition: info.hpp:120
#define HEBI_DISABLE_COPY(Class)
Definition: util.hpp:16
const IoBank & c() const
I/O pin bank c (pins 1-8 available)
Definition: info.hpp:395
Actuator-specific settings, such as controller gains.
Definition: info.hpp:425
const FloatField & effortLimitMin() const
The firmware safety limit for the minimum allowed effort.
Definition: info.hpp:466
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:59
const LedField & led() const
The module's LED.
Definition: info.hpp:720
const FloatField & springConstant() const
The spring constant of the module.
Definition: info.hpp:460
T get() const
If the field has a value, returns that value; otherwise, returns a default.
Definition: info.hpp:299
const FloatField & effortLimitMax() const
The firmware safety limit for the maximum allowed effort.
Definition: info.hpp:468
const IoBank & b() const
I/O pin bank b (pins 1-8 available)
Definition: info.hpp:391
const EnumField< ControlStrategy > & controlStrategy() const
How the position, velocity, and effort PID loops are connected in order to control motor PWM.
Definition: info.hpp:474
const StringField & electricalType() const
Gets the electrical type of this module.
Definition: info.hpp:574
PositionLimitStrategy
Definition: info.hpp:72
A message field representable by a bool value.
Definition: info.hpp:197
IoBank & b()
I/O pin bank b (pins 1-8 available)
Definition: info.hpp:389
const HighResAngleField & positionLimitMax() const
The firmware safety limit for the maximum allowed position.
Definition: info.hpp:472
A message field for interfacing with a bank of I/O pins.
Definition: info.hpp:312
Actuator-specific information.
Definition: info.hpp:661
A message field representable by an unsigned 64 bit integer value.
Definition: info.hpp:166
const EnumField< CalibrationState > & calibrationState() const
The calibration state of the module.
Definition: info.hpp:673
const Actuator & actuator() const
Actuator-specific settings, such as controller gains.
Definition: info.hpp:563
const InfoGains & effortGains() const
Controller gains for the effort PID loop.
Definition: info.hpp:455
Info objects have various fields representing the module state; which fields are populated depends on...
Definition: info.hpp:34
const StringField & serial() const
Gets the serial number for this module (e.g., X5-0001).
Definition: info.hpp:718
MstopStrategy
Definition: info.hpp:63
IoBank & a()
I/O pin bank a (pins 1-8 available)
Definition: info.hpp:385
CalibrationState
Definition: info.hpp:52
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:6
const Imu & imu() const
IMU-specific settings.
Definition: info.hpp:565
const IoBank & e() const
I/O pin bank e (pins 1-8 available)
Definition: info.hpp:403
const InfoGains & positionGains() const
Controller gains for the position PID loop.
Definition: info.hpp:451
const Actuator & actuator() const
Actuator-specific information.
Definition: info.hpp:713
A two-state message field (either set/true or cleared/false).
Definition: info.hpp:246
const BoolField & accelIncludesGravity() const
Whether to include acceleration due to gravity in acceleration feedback.
Definition: info.hpp:515
A message field for interfacing with an LED.
Definition: info.hpp:337
const FloatField & velocityLimitMin() const
The firmware safety limit for the minimum allowed velocity.
Definition: info.hpp:462
bool hasLabel(size_t pinNumber) const
True if (and only if) the particular numbered pin in this bank has a string label set in this message...
Definition: info.cpp:91
const InfoGains & velocityGains() const
Controller gains for the velocity PID loop.
Definition: info.hpp:453
std::string getLabel(size_t pinNumber) const
If this numbered pin in this bank has a string label value, returns that value; otherwise returns an ...
Definition: info.cpp:95
Triggering the M-Stop results in the control strategy being set to 'off'. Remains 'off' until changed...
const Settings & settings() const
Module settings that are typically changed at a slower rate.
Definition: info.hpp:711
A direct PWM value (-1 to 1) can be sent to the motor (subject to onboard safety limiting).
const StringField & mechanicalRevision() const
Gets the mechanical revision of this module.
Definition: info.hpp:580
const IpAddressField & subnetMask() const
Gets the subnet mask for this module.
Definition: info.hpp:620
HebiStatusCode enumGetter(const RefT &ref, MetadataT &metadata, int field, int32_t *value)
Definition: message_helpers.cpp:298
The effort (e.g., spring nonlinearity) has not been calibrated.
Any available digital or analog output pins on the device.
Definition: info.hpp:367
Io & io()
Any available digital or analog output pins on the device.
Definition: info.hpp:707
The motor is not given power (equivalent to a 0 PWM value)
const StringField & firmwareRevision() const
Gets the firmware revision of this module.
Definition: info.hpp:584
The current has not been calibrated.
Info & operator=(Info &&other)=delete
ControlStrategy
Definition: info.hpp:36
Info(Info &&other)
Move constructor (necessary for containment in STL template classes)
Definition: info.cpp:124
double get() const
If the field has a value, returns that value as a double; otherwise, returns a default.
Definition: info.cpp:26
const StringField & mechanicalType() const
Gets the mechanical type of this module.
Definition: info.hpp:578
A message field representable by a std::string.
Definition: info.hpp:215
const IoBank & a() const
I/O pin bank a (pins 1-8 available)
Definition: info.hpp:387
const StringField & firmwareType() const
Gets the firmware type of this module.
Definition: info.hpp:582
A simple wrapper class for IpAddress objects.
Definition: ip_address.hpp:34
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:9
const StringField & family() const
Gets the family for this module.
Definition: info.hpp:572
const StringField & electricalRevision() const
Gets the electrical revision of this module.
Definition: info.hpp:576
IoBank & e()
I/O pin bank e (pins 1-8 available)
Definition: info.hpp:401
const IoBank & d() const
I/O pin bank d (pins 1-8 available)
Definition: info.hpp:399
Color getColor() const
Returns the led color.
Definition: info.cpp:113
Exceeding the position limit results in the control strategy being set to 'off'. Remains 'off' until ...
const Io & io() const
Any available digital or analog output pins on the device.
Definition: info.hpp:709
IpAddress get() const
If the field has a value, returns that value; otherwise, returns 0.0.0.0.
Definition: info.cpp:49
float get() const
If the field has a value, returns that value; otherwise, returns a default.
Definition: info.cpp:11
const FloatField & velocityLimitMax() const
The firmware safety limit for the maximum allowed velocity.
Definition: info.hpp:464
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:45
const StringField & userSettingsBytes(size_t number) const
Definition: info.hpp:587
const StringField & name() const
Gets the name for this module.
Definition: info.hpp:570
The module has been calibrated; this is the normal state.
bool hasColor() const
Returns true if the LED color is set, and false otherwise.
Definition: info.cpp:109
const IoBank & f() const
I/O pin bank f (pins 1-8 available)
Definition: info.hpp:407
Triggering the M-Stop has no effect.
IoBank & d()
I/O pin bank d (pins 1-8 available)
Definition: info.hpp:397
const EnumField< PositionLimitStrategy > & minPositionLimitStrategy() const
The position limit strategy (at the minimum position) for the actuator.
Definition: info.hpp:478
bool get() const
If the field has a value, returns that value; otherwise, returns false.
Definition: info.cpp:61
const EnumField< PositionLimitStrategy > & maxPositionLimitStrategy() const
The position limit strategy (at the maximum position) for the actuator.
Definition: info.hpp:480
Exceeding the position limit has no effect.
A message field representable by an enum of a given type.
Definition: info.hpp:275
Structure to describe an RGB color.
Definition: color.hpp:8
IMU-specific settings.
Definition: info.hpp:502
Exceeding the position limit results in the actuator holding the position. Needs to be manually set t...
Exceeding the position limit results in a virtual spring that pushes the actuator back to within the ...
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:22
const EnumField< MstopStrategy > & mstopStrategy() const
The motion stop strategy for the actuator.
Definition: info.hpp:476
const IpAddressField & ipAddress() const
Gets the IP address for this module.
Definition: info.hpp:618
bool has() const
Returns true if the flag is set, false if it is cleared.
Definition: info.cpp:87
IoBank & c()
I/O pin bank c (pins 1-8 available)
Definition: info.hpp:393
Triggering the M-Stop results in the motor holding the motor position. Operations resume to normal on...
A message field representable by a single-precision floating point value.
Definition: info.hpp:85
The factory zero position has not been set.
bool has() const
True if (and only if) the field has a value.
Definition: info.hpp:294