Classes | Public Types | Public Member Functions | Protected Types | Private Member Functions | Private Attributes | List of all members
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  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
}
 

Public Member Functions

Actuatoractuator ()
 Actuator-specific commands. More...
 
const Actuatoractuator () const
 Actuator-specific commands. More...
 
FlagFieldboot ()
 Boot the module from bootloader into application. More...
 
const FlagFieldboot () const
 Boot the module from bootloader into application. More...
 
 Command (HebiCommandPtr)
 Wraps an existing C-style object that is managed by its parent. NOTE: this should not be used except by internal library functions! More...
 
 Command (Command &&other)
 Move constructor (necessary for containment in STL template classes) More...
 
NumberedFloatFielddebug ()
 Values for internal debug functions (channel 1-9 available). More...
 
const NumberedFloatFielddebug () const
 Values for internal debug functions (channel 1-9 available). 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...
 
LedFieldled ()
 The module's LED. More...
 
const LedFieldled () const
 The module's LED. More...
 
FlagFieldreset ()
 Restart the module. More...
 
const FlagFieldreset () const
 Restart the module. 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...
 
FlagFieldstopBoot ()
 Stop the module from automatically booting into application. More...
 
const FlagFieldstopBoot () const
 Stop the module from automatically booting into application. More...
 
 ~Command () noexcept
 Cleans up command object as necessary. More...
 

Protected Types

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

Private Member Functions

Commandoperator= (const Command &&other)=delete
 

Private Attributes

Actuator actuator_
 
FlagField boot_
 
NumberedFloatField debug_
 
HebiCommandPtr internal_
 
Io io_
 
LedField led_
 
FlagField reset_
 
Settings settings_
 
FlagField stop_boot_
 

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.

Definition at line 30 of file command.hpp.

Member Typedef Documentation

Definition at line 482 of file command.hpp.

Member Enumeration Documentation

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".

Definition at line 33 of file command.hpp.

Constructor & Destructor Documentation

hebi::Command::Command ( HebiCommandPtr  command)

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

Definition at line 318 of file command.cpp.

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

Move constructor (necessary for containment in STL template classes)

Definition at line 334 of file command.cpp.

hebi::Command::~Command ( )
noexcept

Cleans up command object as necessary.

Definition at line 330 of file command.cpp.

Member Function Documentation

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

Actuator-specific commands.

Definition at line 700 of file command.hpp.

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

Actuator-specific commands.

Definition at line 702 of file command.hpp.

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

Boot the module from bootloader into application.

Definition at line 357 of file command.cpp.

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

Boot the module from bootloader into application.

Command::NumberedFloatField & hebi::Command::debug ( )

Values for internal debug functions (channel 1-9 available).

Definition at line 349 of file command.cpp.

const NumberedFloatField& hebi::Command::debug ( ) const

Values for internal debug functions (channel 1-9 available).

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

Any available digital or analog output pins on the device.

Definition at line 692 of file command.hpp.

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

Any available digital or analog output pins on the device.

Definition at line 694 of file command.hpp.

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

The module's LED.

Definition at line 365 of file command.cpp.

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

The module's LED.

Command& hebi::Command::operator= ( const Command &&  other)
privatedelete

Disable copy constructor/assignment operators

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

Restart the module.

Definition at line 353 of file command.cpp.

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

Restart the module.

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

Module settings that are typically changed at a slower rate.

Definition at line 696 of file command.hpp.

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

Module settings that are typically changed at a slower rate.

Definition at line 698 of file command.hpp.

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

Stop the module from automatically booting into application.

Definition at line 361 of file command.cpp.

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

Stop the module from automatically booting into application.

Member Data Documentation

Actuator hebi::Command::actuator_
private

Definition at line 732 of file command.hpp.

FlagField hebi::Command::boot_
private

Definition at line 736 of file command.hpp.

NumberedFloatField hebi::Command::debug_
private

Definition at line 734 of file command.hpp.

HebiCommandPtr hebi::Command::internal_
private

C-style object; managed by parent. NOTE: this should not be used except by internal library functions!

Definition at line 667 of file command.hpp.

Io hebi::Command::io_
private

Definition at line 730 of file command.hpp.

LedField hebi::Command::led_
private

Definition at line 738 of file command.hpp.

FlagField hebi::Command::reset_
private

Definition at line 735 of file command.hpp.

Settings hebi::Command::settings_
private

Definition at line 731 of file command.hpp.

FlagField hebi::Command::stop_boot_
private

Definition at line 737 of file command.hpp.


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


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:10:59