Class Info

Nested Relationships

Nested Types

Class Documentation

class Info

Info objects have various fields representing the module state; which fields are populated depends on the module type and various other settings.

This object has a hierarchical structure — there are some direct general-purpose fields at the top level, and many more specific fields contained in different nested subobjects.

The subobjects contain references to the parent info object, and so should not be used after the parent object has been destroyed.

The fields in the info object are typed; generally, these are optional-style read-only fields (i.e., have the concept of has/get), although the return types and exact interface vary slightly between fields. Where appropriate, the explicit bool operator has been overridden so that you can shortcut if(field.has()) by calling if(field).

Although this header file can be used to look at the hierarchy of the messages, in general the online documentation at apidocs.hebi.us presents this information. in a more readable form.

Public Types

enum class ControlStrategy

Values:

enumerator Off

The motor is not given power (equivalent to a 0 PWM value)

enumerator DirectPWM

A direct PWM value (-1 to 1) can be sent to the motor (subject to onboard safety limiting).

enumerator Strategy2

A combination of the position, velocity, and effort loops with P and V feeding to T; documented on docs.hebi.us under “Control Modes”

enumerator Strategy3

A combination of the position, velocity, and effort loops with P, V, and T feeding to PWM; documented on docs.hebi.us under “Control Modes”

enumerator Strategy4

A combination of the position, velocity, and effort loops with P feeding to T and V feeding to PWM; documented on docs.hebi.us under “Control Modes”

enumerator Strategy5

A combination of the position, velocity, and effort loops with P and V feeding to T; only supported for actuators supporting field-oriented motor control. Documented on docs.hebi.us under “Control Modes”

enum class CalibrationState

Values:

enumerator Normal

The module has been calibrated; this is the normal state.

enumerator UncalibratedCurrent

The current has not been calibrated.

enumerator UncalibratedPosition

The factory zero position has not been set.

enumerator UncalibratedEffort

The effort (e.g., spring nonlinearity) has not been calibrated.

enum class MstopStrategy

Values:

enumerator Disabled

Triggering the M-Stop has no effect.

enumerator MotorOff

Triggering the M-Stop results in the control strategy being set to ‘off’. Remains ‘off’ until changed by user.

enumerator HoldPosition

Triggering the M-Stop results in the motor holding the motor position. Operations resume to normal once trigger is released.

enum class PositionLimitStrategy

Values:

enumerator HoldPosition

Exceeding the position limit results in the actuator holding the position. Needs to be manually set to ‘disabled’ to recover.

enumerator DampedSpring

Exceeding the position limit results in a virtual spring that pushes the actuator back to within the limits.

enumerator MotorOff

Exceeding the position limit results in the control strategy being set to ‘off’. Remains ‘off’ until changed by user.

enumerator Disabled

Exceeding the position limit has no effect.

Public Functions

Info(HebiInfoPtr)

Wraps an existing C-style object that is managed by its parent. NOTE: this should not be used except by internal library functions!

Info(Info &&other)

Move constructor (necessary for containment in STL template classes)

inline Io &io()

Any available digital or analog output pins on the device.

inline const Io &io() const

Any available digital or analog output pins on the device.

inline const Settings &settings() const

Module settings that are typically changed at a slower rate.

inline const Actuator &actuator() const

Actuator-specific information.

inline const StringField &serial() const

Gets the serial number for this module (e.g., X5-0001).

inline const LedField &led() const

The module’s LED.

inline const UInt64Field &secondsCommanded() const

The number of total seconds the module has been sent commands; returned by RuntimeData “Extra” info request.

inline const UInt64Field &secondsOn() const

The number of total seconds the module has been on; returned by RuntimeData “Extra” info request.

Info &operator=(Info &&other) = delete

Disable copy constructor/assignment operators

Protected Types

using InfoGains = Gains<HebiInfoRef, FloatField, BoolField, HebiInfoFloatField, HebiInfoBoolField>
class Actuator

Actuator-specific information.

Public Functions

inline Actuator(const HebiInfoRef &internal)
inline const EnumField<CalibrationState> &calibrationState() const

The calibration state of the module.

class BoolField

A message field representable by a bool value.

Public Functions

BoolField(const HebiInfoRef &internal, HebiInfoBoolField field)
bool has() const

True if (and only if) the field has a value.

bool get() const

If the field has a value, returns that value; otherwise, returns false.

template<typename T>
class EnumField

A message field representable by an enum of a given type.

Public Functions

inline EnumField(const HebiInfoRef &internal, HebiInfoEnumField field)
inline explicit operator bool() const

Allows casting to a bool to check if the field has a value without directly calling has().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::EnumField& f = parent.myField();
if (f)
  std::cout << "Field has value: " << f.get() << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

inline bool has() const

True if (and only if) the field has a value.

inline T get() const

If the field has a value, returns that value; otherwise, returns a default.

class FlagField

A two-state message field (either set/true or cleared/false).

Public Functions

FlagField(const HebiInfoRef &internal, HebiInfoFlagField field)
inline explicit operator bool() const

Allows casting to a bool to check if the flag is set without directly calling has().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::FlagField& f = parent.myField();
if (f)
  std::cout << "Field has value: " << f.get() << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

bool has() const

Returns true if the flag is set, false if it is cleared.

class FloatField

A message field representable by a single-precision floating point value.

Public Functions

FloatField(const HebiInfoRef &internal, HebiInfoFloatField field)
inline explicit operator bool() const

Allows casting to a bool to check if the field has a value without directly calling has().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::FloatField& f = parent.myField();
if (f)
  std::cout << "Field has value: " << f.get() << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

bool has() const

True if (and only if) the field has a value.

float get() const

If the field has a value, returns that value; otherwise, returns a default.

class HighResAngleField

A message field for an angle measurement which does not lose precision at very high angles.

This field is represented as an int64_t for the number of revolutions and a float for the radian offset from that number of revolutions.

Public Functions

HighResAngleField(const HebiInfoRef &internal, HebiInfoHighResAngleField field)
inline explicit operator bool() const

Allows casting to a bool to check if the field has a value without directly calling has().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::HighResAngleField& f = parent.myField();
if (f)
  std::cout << "Field has value: " << f.get() << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

bool has() const

True if (and only if) the field has a value.

double get() const

If the field has a value, returns that value as a double; otherwise, returns a default.

Note that some precision might be lost converting to a double at very high number of revolutions.

void get(int64_t *revolutions, float *radian_offset) const

If the field has a value, returns that value in the int64 and float parameters passed in; otherwise, returns a default.

Note that this maintains the full precision of the underlying angle measurement, even for very large numbers of revolutions.

Parameters:
  • revolutions – The number of full revolutions

  • radian_offset – The offset from the given number of full revolutions. Note that this is usually between 0 and 2*M_PI, but callers should not assume this.

class Io

Any available digital or analog output pins on the device.

Public Functions

inline Io(HebiInfoPtr internal, HebiInfoRef &internal_ref)
inline IoBank &a()

I/O pin bank a (pins 1-8 available)

inline const IoBank &a() const

I/O pin bank a (pins 1-8 available)

inline IoBank &b()

I/O pin bank b (pins 1-8 available)

inline const IoBank &b() const

I/O pin bank b (pins 1-8 available)

inline IoBank &c()

I/O pin bank c (pins 1-8 available)

inline const IoBank &c() const

I/O pin bank c (pins 1-8 available)

inline IoBank &d()

I/O pin bank d (pins 1-8 available)

inline const IoBank &d() const

I/O pin bank d (pins 1-8 available)

inline IoBank &e()

I/O pin bank e (pins 1-8 available)

inline const IoBank &e() const

I/O pin bank e (pins 1-8 available)

inline IoBank &f()

I/O pin bank f (pins 1-8 available)

inline const IoBank &f() const

I/O pin bank f (pins 1-8 available)

class IoBank

A message field for interfacing with a bank of I/O pins.

Public Functions

IoBank(HebiInfoPtr internal, HebiInfoRef &internal_ref, HebiInfoIoPinBank bank)
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.

Parameters:

pinNumber – Which pin to set; valid values for pinNumber depend on the bank.

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 empty string.

Parameters:

pinNumber – Which pin to get; valid values for pinNumber depend on the bank.

class IpAddressField

A message field representable by an unsigned 64 bit integer value.

Public Functions

IpAddressField(const HebiInfoRef &internal, HebiInfoUInt64Field field)
inline explicit operator bool() const

Allows casting to a bool to check if the field has a value without directly calling has().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::IpAddressField& f = parent.myField();
if (f)
  std::cout << "Field has value: " << f.get() << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

bool has() const

True if (and only if) the field has a value.

IpAddress get() const

If the field has a value, returns that value; otherwise, returns 0.0.0.0.

class LedField

A message field for interfacing with an LED.

Public Functions

LedField(const HebiInfoRef &internal, HebiInfoLedField field)
inline explicit operator bool() const

Allows casting to a bool to check if the LED color is set without directly calling hasColor().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::LedField& f = parent.myField();
if (f)
  std::cout << "Field has color!" << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

bool hasColor() const

Returns true if the LED color is set, and false otherwise.

Color getColor() const

Returns the led color.

class Settings

Module settings that are typically changed at a slower rate.

Public Functions

inline Settings(HebiInfoPtr internal_ptr, const HebiInfoRef &internal)
inline const Actuator &actuator() const

Actuator-specific settings, such as controller gains.

inline const Imu &imu() const

IMU-specific settings.

inline const StringField &name() const

Gets the name for this module.

inline const StringField &family() const

Gets the family for this module.

inline const StringField &electricalType() const

Gets the electrical type of this module.

inline const StringField &electricalRevision() const

Gets the electrical revision of this module.

inline const StringField &mechanicalType() const

Gets the mechanical type of this module.

inline const StringField &mechanicalRevision() const

Gets the mechanical revision of this module.

inline const StringField &firmwareType() const

Gets the firmware type of this module.

inline const StringField &firmwareRevision() const

Gets the firmware revision of this module.

inline const StringField &userSettingsBytes(size_t number) const

Gets the given byte array user setting; valid for entry number 1-8. Throws out of range if given an invalid index

inline const FloatField &userSettingsFloat(size_t number) const

Gets the given float user setting; valid for entry number 1-8. Throws out of range if given an invalid index

inline const IpAddressField &ipAddress() const

Gets the IP address for this module.

inline const IpAddressField &subnetMask() const

Gets the subnet mask for this module.

inline const IpAddressField &defaultGateway() const

Gets the default gateway for this module.

inline const FlagField &saveCurrentSettings() const

Indicates if the module should save the current values of all of its settings.

class Actuator

Actuator-specific settings, such as controller gains.

Public Functions

inline Actuator(const HebiInfoRef &internal)
inline const InfoGains &positionGains() const

Controller gains for the position PID loop.

inline const InfoGains &velocityGains() const

Controller gains for the velocity PID loop.

inline const InfoGains &effortGains() const

Controller gains for the effort PID loop.

inline const FloatField &springConstant() const

The spring constant of the module.

inline const FloatField &velocityLimitMin() const

The firmware safety limit for the minimum allowed velocity.

inline const FloatField &velocityLimitMax() const

The firmware safety limit for the maximum allowed velocity.

inline const FloatField &effortLimitMin() const

The firmware safety limit for the minimum allowed effort.

inline const FloatField &effortLimitMax() const

The firmware safety limit for the maximum allowed effort.

inline const HighResAngleField &positionLimitMin() const

The firmware safety limit for the minimum allowed position.

inline const HighResAngleField &positionLimitMax() const

The firmware safety limit for the maximum allowed position.

inline const EnumField<ControlStrategy> &controlStrategy() const

How the position, velocity, and effort PID loops are connected in order to control motor PWM.

inline const EnumField<MstopStrategy> &mstopStrategy() const

The motion stop strategy for the actuator.

inline const EnumField<PositionLimitStrategy> &minPositionLimitStrategy() const

The position limit strategy (at the minimum position) for the actuator.

inline const EnumField<PositionLimitStrategy> &maxPositionLimitStrategy() const

The position limit strategy (at the maximum position) for the actuator.

class Imu

IMU-specific settings.

Public Functions

inline Imu(const HebiInfoRef &internal)
inline const BoolField &accelIncludesGravity() const

Whether to include acceleration due to gravity in acceleration feedback.

class StringField

A message field representable by a std::string.

Public Functions

StringField(HebiInfoPtr internal, HebiInfoStringField field)
inline explicit operator bool() const

Allows casting to a bool to check if the field has a value without directly calling has().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::StringField& f = parent.myField();
if (f)
  std::cout << "Field has value: " << f.get() << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

bool has() const

True if (and only if) the field has a value.

std::string get() const

If the field has a value, returns a copy of that value; otherwise, returns a default.

class UInt64Field

A message field representable by an unsigned 64 bit integer value.

Public Functions

UInt64Field(const HebiInfoRef &internal, HebiInfoUInt64Field field)
inline explicit operator bool() const

Allows casting to a bool to check if the field has a value without directly calling has().

This can be used as in the following (assuming ‘parent’ is a parent message, and this field is called ‘myField’)

Info::UInt64Field& f = parent.myField();
if (f)
  std::cout << "Field has value: " << f.get() << std::endl;
else
  std::cout << "Field has no value!" << std::endl;

bool has() const

True if (and only if) the field has a value.

uint64_t get() const

If the field has a value, returns that value; otherwise, returns a default.