90 #ifndef DOXYGEN_OMIT_INTERNAL 91 FloatField(
const HebiInfoRef&
internal, HebiInfoFloatField field);
92 #endif // DOXYGEN_OMIT_INTERNAL 93 explicit operator bool()
const {
return has(); }
114 const HebiInfoRef& internal_;
115 HebiInfoFloatField
const field_;
125 #ifndef DOXYGEN_OMIT_INTERNAL 127 #endif // DOXYGEN_OMIT_INTERNAL 128 explicit operator bool()
const {
return has(); }
160 void get(int64_t* revolutions,
float* radian_offset)
const;
164 const HebiInfoRef& internal_;
165 HebiInfoHighResAngleField
const field_;
171 #ifndef DOXYGEN_OMIT_INTERNAL 172 UInt64Field(
const HebiInfoRef&
internal, HebiInfoUInt64Field field);
173 #endif // DOXYGEN_OMIT_INTERNAL 174 explicit operator bool()
const {
return has(); }
191 uint64_t
get()
const;
195 const HebiInfoRef& internal_;
196 HebiInfoUInt64Field
const field_;
202 #ifndef DOXYGEN_OMIT_INTERNAL 203 IpAddressField(
const HebiInfoRef&
internal, HebiInfoUInt64Field field);
204 #endif // DOXYGEN_OMIT_INTERNAL 205 explicit operator bool()
const {
return has(); }
226 const HebiInfoRef& internal_;
227 HebiInfoUInt64Field
const field_;
233 #ifndef DOXYGEN_OMIT_INTERNAL 234 BoolField(
const HebiInfoRef&
internal, HebiInfoBoolField field);
235 #endif // DOXYGEN_OMIT_INTERNAL 244 const HebiInfoRef& internal_;
245 HebiInfoBoolField
const field_;
251 #ifndef DOXYGEN_OMIT_INTERNAL 252 StringField(HebiInfoPtr
internal, HebiInfoStringField field);
253 #endif // DOXYGEN_OMIT_INTERNAL 254 explicit operator bool()
const {
return has(); }
271 std::string
get()
const;
275 HebiInfoPtr
const internal_;
276 HebiInfoStringField
const field_;
282 #ifndef DOXYGEN_OMIT_INTERNAL 283 FlagField(
const HebiInfoRef&
internal, HebiInfoFlagField field);
284 #endif // DOXYGEN_OMIT_INTERNAL 285 explicit operator bool()
const {
return has(); }
303 const HebiInfoRef& internal_;
304 HebiInfoFlagField
const field_;
311 #ifndef DOXYGEN_OMIT_INTERNAL 312 EnumField(
const HebiInfoRef&
internal, HebiInfoEnumField field) : internal_(
internal), field_(field) {}
313 #endif // DOXYGEN_OMIT_INTERNAL 314 explicit operator bool()
const {
return has(); }
329 return (
enumGetter(internal_, field_,
nullptr) == HebiStatusSuccess);
336 return static_cast<T>(ret);
341 const HebiInfoRef& internal_;
342 HebiInfoEnumField
const field_;
348 #ifndef DOXYGEN_OMIT_INTERNAL 349 IoBank(HebiInfoPtr
internal, HebiInfoRef& internal_ref, HebiInfoIoPinBank bank);
350 #endif // DOXYGEN_OMIT_INTERNAL 351 bool hasLabel(
size_t pinNumber)
const;
362 std::string
getLabel(
size_t pinNumber)
const;
366 HebiInfoPtr internal_;
367 HebiInfoIoPinBank
const bank_;
372 #ifndef DOXYGEN_OMIT_INTERNAL 373 LedField(
const HebiInfoRef&
internal, HebiInfoLedField field);
374 #endif // DOXYGEN_OMIT_INTERNAL 375 explicit operator bool()
const {
return hasColor(); }
395 const HebiInfoRef& internal_;
396 HebiInfoLedField
const field_;
402 #ifndef DOXYGEN_OMIT_INTERNAL 403 Io(HebiInfoPtr
internal, HebiInfoRef& internal_ref)
404 : a_(
internal, internal_ref, HebiInfoIoBankA),
405 b_(
internal, internal_ref, HebiInfoIoBankB),
406 c_(
internal, internal_ref, HebiInfoIoBankC),
407 d_(
internal, internal_ref, HebiInfoIoBankD),
408 e_(
internal, internal_ref, HebiInfoIoBankE),
409 f_(
internal, internal_ref, HebiInfoIoBankF) {}
410 #endif // DOXYGEN_OMIT_INTERNAL 460 #ifndef DOXYGEN_OMIT_INTERNAL 461 Actuator(
const HebiInfoRef&
internal)
462 : position_gains_(
internal, HebiInfoFloatPositionKp, HebiInfoBoolPositionDOnError),
463 velocity_gains_(
internal, HebiInfoFloatVelocityKp, HebiInfoBoolVelocityDOnError),
464 effort_gains_(
internal, HebiInfoFloatEffortKp, HebiInfoBoolEffortDOnError),
465 spring_constant_(
internal, HebiInfoFloatSpringConstant),
466 velocity_limit_min_(
internal, HebiInfoFloatVelocityLimitMin),
467 velocity_limit_max_(
internal, HebiInfoFloatVelocityLimitMax),
468 effort_limit_min_(
internal, HebiInfoFloatEffortLimitMin),
469 effort_limit_max_(
internal, HebiInfoFloatEffortLimitMax),
470 position_limit_min_(
internal, HebiInfoHighResAnglePositionLimitMin),
471 position_limit_max_(
internal, HebiInfoHighResAnglePositionLimitMax),
472 control_strategy_(
internal, HebiInfoEnumControlStrategy),
473 mstop_strategy_(
internal, HebiInfoEnumMstopStrategy),
474 min_position_limit_strategy_(
internal, HebiInfoEnumMinPositionLimitStrategy),
475 max_position_limit_strategy_(
internal, HebiInfoEnumMaxPositionLimitStrategy) {}
476 #endif // DOXYGEN_OMIT_INTERNAL 537 #ifndef DOXYGEN_OMIT_INTERNAL 538 Imu(
const HebiInfoRef&
internal)
539 : accel_includes_gravity_(
internal, HebiInfoBoolAccelIncludesGravity) {}
540 #endif // DOXYGEN_OMIT_INTERNAL 556 #ifndef DOXYGEN_OMIT_INTERNAL 557 Settings(HebiInfoPtr internal_ptr,
const HebiInfoRef&
internal)
558 : actuator_(internal),
560 name_(internal_ptr, HebiInfoStringName),
561 family_(internal_ptr, HebiInfoStringFamily),
562 electrical_type_(internal_ptr, HebiInfoStringElectricalType),
563 electrical_revision_(internal_ptr, HebiInfoStringElectricalRevision),
564 mechanical_type_(internal_ptr, HebiInfoStringMechanicalType),
565 mechanical_revision_(internal_ptr, HebiInfoStringMechanicalRevision),
566 firmware_type_(internal_ptr, HebiInfoStringFirmwareType),
567 firmware_revision_(internal_ptr, HebiInfoStringFirmwareRevision),
568 user_settings_bytes_1_(internal_ptr, HebiInfoStringUserSettingsBytes1),
569 user_settings_bytes_2_(internal_ptr, HebiInfoStringUserSettingsBytes2),
570 user_settings_bytes_3_(internal_ptr, HebiInfoStringUserSettingsBytes3),
571 user_settings_bytes_4_(internal_ptr, HebiInfoStringUserSettingsBytes4),
572 user_settings_bytes_5_(internal_ptr, HebiInfoStringUserSettingsBytes5),
573 user_settings_bytes_6_(internal_ptr, HebiInfoStringUserSettingsBytes6),
574 user_settings_bytes_7_(internal_ptr, HebiInfoStringUserSettingsBytes7),
575 user_settings_bytes_8_(internal_ptr, HebiInfoStringUserSettingsBytes8),
576 user_settings_float_1_(internal, HebiInfoFloatUserSettingsFloat1),
577 user_settings_float_2_(internal, HebiInfoFloatUserSettingsFloat2),
578 user_settings_float_3_(internal, HebiInfoFloatUserSettingsFloat3),
579 user_settings_float_4_(internal, HebiInfoFloatUserSettingsFloat4),
580 user_settings_float_5_(internal, HebiInfoFloatUserSettingsFloat5),
581 user_settings_float_6_(internal, HebiInfoFloatUserSettingsFloat6),
582 user_settings_float_7_(internal, HebiInfoFloatUserSettingsFloat7),
583 user_settings_float_8_(internal, HebiInfoFloatUserSettingsFloat8),
584 ip_address_(internal, HebiInfoUInt64IpAddress),
585 subnet_mask_(internal, HebiInfoUInt64SubnetMask),
586 default_gateway_(internal, HebiInfoUInt64DefaultGateway),
587 save_current_settings_(internal, HebiInfoFlagSaveCurrentSettings) {}
588 #endif // DOXYGEN_OMIT_INTERNAL 623 case 1:
return user_settings_bytes_1_;
624 case 2:
return user_settings_bytes_2_;
625 case 3:
return user_settings_bytes_3_;
626 case 4:
return user_settings_bytes_4_;
627 case 5:
return user_settings_bytes_5_;
628 case 6:
return user_settings_bytes_6_;
629 case 7:
return user_settings_bytes_7_;
630 case 8:
return user_settings_bytes_8_;
632 throw std::out_of_range(
"Invalid option for bytes array user setting entry!");
639 case 1:
return user_settings_float_1_;
640 case 2:
return user_settings_float_2_;
641 case 3:
return user_settings_float_3_;
642 case 4:
return user_settings_float_4_;
643 case 5:
return user_settings_float_5_;
644 case 6:
return user_settings_float_6_;
645 case 7:
return user_settings_float_7_;
646 case 8:
return user_settings_float_8_;
648 throw std::out_of_range(
"Invalid option for float user setting entry!");
696 #ifndef DOXYGEN_OMIT_INTERNAL 697 Actuator(
const HebiInfoRef&
internal) : calibration_state_(
internal, HebiInfoEnumCalibrationState) {}
698 #endif // DOXYGEN_OMIT_INTERNAL 718 HebiInfoPtr internal_;
719 HebiInfoRef internal_ref_;
722 #ifndef DOXYGEN_OMIT_INTERNAL 728 #endif // DOXYGEN_OMIT_INTERNAL 742 const Io&
io()
const {
return io_; }
776 UInt64Field seconds_commanded_;
777 UInt64Field seconds_on_;
const FlagField & saveCurrentSettings() const
Indicates if the module should save the current values of all of its settings.
Definition: info.hpp:657
const IpAddressField & defaultGateway() const
Gets the default gateway for this module.
Definition: info.hpp:655
const FloatField & userSettingsFloat(size_t number) const
Definition: info.hpp:636
std::string get() const
If the field has a value, returns a copy of that value; otherwise, returns a default.
Definition: info.cpp:88
const HighResAngleField & positionLimitMin() const
The firmware safety limit for the minimum allowed position.
Definition: info.hpp:503
Module settings that are typically changed at a slower rate.
Definition: info.hpp:455
IoBank & f()
I/O pin bank f (pins 1-8 available)
Definition: info.hpp:438
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:84
A message field for an angle measurement which does not lose precision at very high angles.
Definition: info.hpp:123
#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:428
Actuator-specific settings, such as controller gains.
Definition: info.hpp:458
const FloatField & effortLimitMin() const
The firmware safety limit for the minimum allowed effort.
Definition: info.hpp:499
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:74
const LedField & led() const
The module's LED.
Definition: info.hpp:753
const FloatField & springConstant() const
The spring constant of the module.
Definition: info.hpp:493
T get() const
If the field has a value, returns that value; otherwise, returns a default.
Definition: info.hpp:333
const FloatField & effortLimitMax() const
The firmware safety limit for the maximum allowed effort.
Definition: info.hpp:501
const IoBank & b() const
I/O pin bank b (pins 1-8 available)
Definition: info.hpp:424
const EnumField< ControlStrategy > & controlStrategy() const
How the position, velocity, and effort PID loops are connected in order to control motor PWM.
Definition: info.hpp:507
const StringField & electricalType() const
Gets the electrical type of this module.
Definition: info.hpp:607
PositionLimitStrategy
Definition: info.hpp:75
const UInt64Field & secondsCommanded() const
Definition: info.hpp:756
A message field representable by a bool value.
Definition: info.hpp:231
IoBank & b()
I/O pin bank b (pins 1-8 available)
Definition: info.hpp:422
const HighResAngleField & positionLimitMax() const
The firmware safety limit for the maximum allowed position.
Definition: info.hpp:505
A message field for interfacing with a bank of I/O pins.
Definition: info.hpp:346
Actuator-specific information.
Definition: info.hpp:694
A message field representable by an unsigned 64 bit integer value.
Definition: info.hpp:200
const EnumField< CalibrationState > & calibrationState() const
The calibration state of the module.
Definition: info.hpp:706
const Actuator & actuator() const
Actuator-specific settings, such as controller gains.
Definition: info.hpp:596
const InfoGains & effortGains() const
Controller gains for the effort PID loop.
Definition: info.hpp:488
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:751
MstopStrategy
Definition: info.hpp:66
IoBank & a()
I/O pin bank a (pins 1-8 available)
Definition: info.hpp:418
CalibrationState
Definition: info.hpp:55
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:6
const Imu & imu() const
IMU-specific settings.
Definition: info.hpp:598
const IoBank & e() const
I/O pin bank e (pins 1-8 available)
Definition: info.hpp:436
const InfoGains & positionGains() const
Controller gains for the position PID loop.
Definition: info.hpp:484
const Actuator & actuator() const
Actuator-specific information.
Definition: info.hpp:746
A two-state message field (either set/true or cleared/false).
Definition: info.hpp:280
const BoolField & accelIncludesGravity() const
Whether to include acceleration due to gravity in acceleration feedback.
Definition: info.hpp:548
A message field for interfacing with an LED.
Definition: info.hpp:370
const FloatField & velocityLimitMin() const
The firmware safety limit for the minimum allowed velocity.
Definition: info.hpp:495
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:106
uint64_t get() const
If the field has a value, returns that value; otherwise, returns a default.
Definition: info.cpp:49
const InfoGains & velocityGains() const
Controller gains for the velocity PID loop.
Definition: info.hpp:486
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:110
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:744
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:613
const IpAddressField & subnetMask() const
Gets the subnet mask for this module.
Definition: info.hpp:653
HebiStatusCode enumGetter(const RefT &ref, MetadataT &metadata, int field, int32_t *value)
Definition: message_helpers.cpp:300
The effort (e.g., spring nonlinearity) has not been calibrated.
Any available digital or analog output pins on the device.
Definition: info.hpp:400
Io & io()
Any available digital or analog output pins on the device.
Definition: info.hpp:740
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:617
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:139
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:611
A message field representable by a std::string.
Definition: info.hpp:249
const IoBank & a() const
I/O pin bank a (pins 1-8 available)
Definition: info.hpp:420
const StringField & firmwareType() const
Gets the firmware type of this module.
Definition: info.hpp:615
A simple wrapper class for IpAddress objects.
Definition: ip_address.hpp:36
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:605
const StringField & electricalRevision() const
Gets the electrical revision of this module.
Definition: info.hpp:609
const UInt64Field & secondsOn() const
Definition: info.hpp:759
IoBank & e()
I/O pin bank e (pins 1-8 available)
Definition: info.hpp:434
const IoBank & d() const
I/O pin bank d (pins 1-8 available)
Definition: info.hpp:432
Color getColor() const
Returns the led color.
Definition: info.cpp:128
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:742
IpAddress get() const
If the field has a value, returns that value; otherwise, returns 0.0.0.0.
Definition: info.cpp:64
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:497
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:60
const StringField & userSettingsBytes(size_t number) const
Definition: info.hpp:620
const StringField & name() const
Gets the name for this module.
Definition: info.hpp:603
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:124
const IoBank & f() const
I/O pin bank f (pins 1-8 available)
Definition: info.hpp:440
Triggering the M-Stop has no effect.
IoBank & d()
I/O pin bank d (pins 1-8 available)
Definition: info.hpp:430
const EnumField< PositionLimitStrategy > & minPositionLimitStrategy() const
The position limit strategy (at the minimum position) for the actuator.
Definition: info.hpp:511
bool get() const
If the field has a value, returns that value; otherwise, returns false.
Definition: info.cpp:76
const EnumField< PositionLimitStrategy > & maxPositionLimitStrategy() const
The position limit strategy (at the maximum position) for the actuator.
Definition: info.hpp:513
Exceeding the position limit has no effect.
A message field representable by an enum of a given type.
Definition: info.hpp:309
Structure to describe an RGB color.
Definition: color.hpp:8
A message field representable by an unsigned 64 bit integer value.
Definition: info.hpp:169
IMU-specific settings.
Definition: info.hpp:535
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:509
const IpAddressField & ipAddress() const
Gets the IP address for this module.
Definition: info.hpp:651
bool has() const
Returns true if the flag is set, false if it is cleared.
Definition: info.cpp:102
IoBank & c()
I/O pin bank c (pins 1-8 available)
Definition: info.hpp:426
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:88
bool has() const
True if (and only if) the field has a value.
Definition: info.cpp:45
The factory zero position has not been set.
bool has() const
True if (and only if) the field has a value.
Definition: info.hpp:328