HEBI C++ API  3.12.0
hebi::Command Class Referencefinal

Command objects have various fields that can be set; when sent to the module, these fields control internal properties and setpoints. More...

#include <command.hpp>

Classes

class  Actuator
 Actuator-specific commands. More...
 
class  BoolField
 A message field representable by a bool value. More...
 
class  EnumField
 A message field representable by an enum of a given type. More...
 
class  FlagField
 A two-state message field (either set/true or cleared/false). More...
 
class  FloatField
 A message field representable by a single-precision floating point value. More...
 
class  HighResAngleField
 A message field for an angle measurement which does not lose precision at very high angles. More...
 
class  Io
 Any available digital or analog output pins on the device. More...
 
class  IoBank
 A message field for interfacing with a bank of I/O pins. More...
 
class  IpAddressField
 A message field representable by an unsigned 64 bit integer value. More...
 
class  LedField
 A message field for interfacing with an LED. More...
 
class  NumberedFloatField
 A message field containing a numbered set of single-precision floating point values. More...
 
class  Settings
 Module settings that are typically changed at a slower rate. More...
 
class  StringField
 A message field representable by a std::string. More...
 

Public Types

enum  ControlStrategy {
  ControlStrategy::Off, ControlStrategy::DirectPWM, ControlStrategy::Strategy2, ControlStrategy::Strategy3,
  ControlStrategy::Strategy4, ControlStrategy::Strategy5
}
 
enum  MstopStrategy { MstopStrategy::Disabled, MstopStrategy::MotorOff, MstopStrategy::HoldPosition }
 
enum  PositionLimitStrategy { PositionLimitStrategy::HoldPosition, PositionLimitStrategy::DampedSpring, PositionLimitStrategy::MotorOff, PositionLimitStrategy::Disabled }
 

Public Member Functions

 Command (Command &&other)
 Move constructor (necessary for containment in STL template classes) More...
 
Ioio ()
 Any available digital or analog output pins on the device. More...
 
const Ioio () const
 Any available digital or analog output pins on the device. More...
 
Settingssettings ()
 Module settings that are typically changed at a slower rate. More...
 
const Settingssettings () const
 Module settings that are typically changed at a slower rate. More...
 
Actuatoractuator ()
 Actuator-specific commands. More...
 
const Actuatoractuator () const
 Actuator-specific commands. More...
 
StringFieldappendLog ()
 Appends to the current log message on the module. More...
 
const StringFieldappendLog () const
 Appends to the current log message on the module. More...
 
FlagFieldreset ()
 Restart the module. More...
 
const FlagFieldreset () const
 Restart the module. More...
 
FlagFieldboot ()
 Boot the module from bootloader into application. More...
 
const FlagFieldboot () const
 Boot the module from bootloader into application. More...
 
FlagFieldstopBoot ()
 Stop the module from automatically booting into application. More...
 
const FlagFieldstopBoot () const
 Stop the module from automatically booting into application. More...
 
FlagFieldclearLog ()
 Clears the log message on the module. More...
 
const FlagFieldclearLog () const
 Clears the log message on the module. More...
 
LedFieldled ()
 The module's LED. More...
 
const LedFieldled () const
 The module's LED. More...
 
Commandoperator= (Command &&other)=delete
 

Protected Types

using CommandGains = Gains< HebiCommandRef, FloatField, BoolField, HebiCommandFloatField, HebiCommandBoolField >
 

Detailed Description

Command objects have various fields that can be set; when sent to the module, these fields control internal properties and setpoints.

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 command object, and so should not be used after the parent object has been destroyed.

The fields in the command object are typed; generally, these are optional-style read/write fields (i.e., have the concept of get/set/has/clear), 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.

Member Typedef Documentation

◆ CommandGains

using hebi::Command::CommandGains = Gains<HebiCommandRef, FloatField, BoolField, HebiCommandFloatField, HebiCommandBoolField>
protected

Member Enumeration Documentation

◆ ControlStrategy

Enumerator
Off 

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

DirectPWM 

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

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"

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"

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"

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"

◆ MstopStrategy

Enumerator
Disabled 

Triggering the M-Stop has no effect.

MotorOff 

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

HoldPosition 

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

◆ PositionLimitStrategy

Enumerator
HoldPosition 

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

DampedSpring 

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

MotorOff 

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

Disabled 

Exceeding the position limit has no effect.

Constructor & Destructor Documentation

◆ Command()

hebi::Command::Command ( Command &&  other)

Move constructor (necessary for containment in STL template classes)

Member Function Documentation

◆ io() [1/2]

Io& hebi::Command::io ( )
inline

Any available digital or analog output pins on the device.

◆ io() [2/2]

const Io& hebi::Command::io ( ) const
inline

Any available digital or analog output pins on the device.

◆ settings() [1/2]

Settings& hebi::Command::settings ( )
inline

Module settings that are typically changed at a slower rate.

◆ settings() [2/2]

const Settings& hebi::Command::settings ( ) const
inline

Module settings that are typically changed at a slower rate.

◆ actuator() [1/2]

Actuator& hebi::Command::actuator ( )
inline

Actuator-specific commands.

◆ actuator() [2/2]

const Actuator& hebi::Command::actuator ( ) const
inline

Actuator-specific commands.

◆ appendLog() [1/2]

StringField& hebi::Command::appendLog ( )
inline

Appends to the current log message on the module.

◆ appendLog() [2/2]

const StringField& hebi::Command::appendLog ( ) const
inline

Appends to the current log message on the module.

◆ reset() [1/2]

FlagField& hebi::Command::reset ( )
inline

Restart the module.

◆ reset() [2/2]

const FlagField& hebi::Command::reset ( ) const
inline

Restart the module.

◆ boot() [1/2]

FlagField& hebi::Command::boot ( )
inline

Boot the module from bootloader into application.

◆ boot() [2/2]

const FlagField& hebi::Command::boot ( ) const
inline

Boot the module from bootloader into application.

◆ stopBoot() [1/2]

FlagField& hebi::Command::stopBoot ( )
inline

Stop the module from automatically booting into application.

◆ stopBoot() [2/2]

const FlagField& hebi::Command::stopBoot ( ) const
inline

Stop the module from automatically booting into application.

◆ clearLog() [1/2]

FlagField& hebi::Command::clearLog ( )
inline

Clears the log message on the module.

◆ clearLog() [2/2]

const FlagField& hebi::Command::clearLog ( ) const
inline

Clears the log message on the module.

◆ led() [1/2]

LedField& hebi::Command::led ( )
inline

The module's LED.

◆ led() [2/2]

const LedField& hebi::Command::led ( ) const
inline

The module's LED.

◆ operator=()

Command& hebi::Command::operator= ( Command &&  other)
delete

Disable copy constructor/assignment operators


The documentation for this class was generated from the following files: