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

A list of Command objects appropriate for sending to a Group of modules; the size() must match the number of modules in the group. More...

#include <group_command.hpp>

Public Member Functions

 GroupCommand (size_t number_of_modules)
 Create a group command with the specified number of modules. More...
 
 ~GroupCommand () noexcept=default
 Destructor cleans up group command object as necessary. More...
 
 GroupCommand (GroupCommand &&)=default
 Allows moving result from "subview". More...
 
GroupCommand subview (std::vector< int > indices) const
 Creates a "subview" of this group command object, with shared access to a subset of the Command elements. Note that certain functions (clear, read/write gains, and read/write safety parameters and not currently supported on subviews) More...
 
bool isSubview () const
 Was this created as a subview of another GroupCommand? More...
 
size_t size () const
 Returns the number of module commands in this group command. More...
 
Commandoperator[] (size_t index)
 Access the command for an individual module. More...
 
const Commandoperator[] (size_t index) const
 Access the command for an individual module. More...
 
void clear ()
 Clears all data in this GroupCommand object; this returns to the state the GroupCommand was at time of creation. More...
 
bool readGains (const std::string &file)
 Import the gains from a file into this GroupCommand object. More...
 
bool writeGains (const std::string &file) const
 Export the gains from this GroupCommand object into a file, creating it as necessary. More...
 
FunctionCallResult readSafetyParameters (const std::string &file)
 Import the safety parameters from a file into this GroupCommand object. More...
 
FunctionCallResult writeSafetyParameters (const std::string &file) const
 Export the safety parameters from this GroupCommand object into a file, creating it as necessary. More...
 
void setPosition (const Eigen::VectorXd &position)
 Convenience function for setting position commands from Eigen vectors. More...
 
void setVelocity (const Eigen::VectorXd &velocity)
 Convenience function for setting velocity commands from Eigen vectors. More...
 
void setEffort (const Eigen::VectorXd &effort)
 Convenience function for setting effort commands from Eigen vectors. More...
 
void setSpringConstant (const Eigen::VectorXd &springConstant)
 Convenience function for setting spring constant commands from Eigen vectors. More...
 
Eigen::VectorXd getPosition () const
 Convenience function for returning commanded position values. More...
 
Eigen::VectorXd getVelocity () const
 Convenience function for returning commanded velocity values. More...
 
Eigen::VectorXd getEffort () const
 Convenience function for returning commanded effort values. More...
 
Eigen::VectorXd getSpringConstant () const
 Convenience function for returning commanded spring constant values. More...
 
void getPosition (Eigen::VectorXd &out) const
 Convenience function for returning commanded position values. More...
 
void getVelocity (Eigen::VectorXd &out) const
 Convenience function for returning commanded velocity values. More...
 
void getEffort (Eigen::VectorXd &out) const
 Convenience function for returning commanded effort values. More...
 
void getSpringConstant (Eigen::VectorXd &out) const
 Convenience function for returning commanded spring constant values. More...
 

Detailed Description

A list of Command objects appropriate for sending to a Group of modules; the size() must match the number of modules in the group.

Constructor & Destructor Documentation

◆ GroupCommand() [1/2]

hebi::GroupCommand::GroupCommand ( size_t  number_of_modules)

Create a group command with the specified number of modules.

◆ ~GroupCommand()

hebi::GroupCommand::~GroupCommand ( )
defaultnoexcept

Destructor cleans up group command object as necessary.

◆ GroupCommand() [2/2]

hebi::GroupCommand::GroupCommand ( GroupCommand &&  )
default

Allows moving result from "subview".

Member Function Documentation

◆ subview()

GroupCommand hebi::GroupCommand::subview ( std::vector< int >  indices) const

Creates a "subview" of this group command object, with shared access to a subset of the Command elements. Note that certain functions (clear, read/write gains, and read/write safety parameters and not currently supported on subviews)

The indices do not need to remain in order, and do not need to be unique; however, they must each be >= 0 and < size(); otherwise an out_of_range exception is thrown.

◆ isSubview()

bool hebi::GroupCommand::isSubview ( ) const
inline

Was this created as a subview of another GroupCommand?

◆ size()

size_t hebi::GroupCommand::size ( ) const

Returns the number of module commands in this group command.

◆ operator[]() [1/2]

Command & hebi::GroupCommand::operator[] ( size_t  index)

Access the command for an individual module.

◆ operator[]() [2/2]

const Command & hebi::GroupCommand::operator[] ( size_t  index) const

Access the command for an individual module.

◆ clear()

void hebi::GroupCommand::clear ( )

Clears all data in this GroupCommand object; this returns to the state the GroupCommand was at time of creation.

◆ readGains()

bool hebi::GroupCommand::readGains ( const std::string &  file)

Import the gains from a file into this GroupCommand object.

Parameters
fileThe filename (or path + filename) to the file to read from.

◆ writeGains()

bool hebi::GroupCommand::writeGains ( const std::string &  file) const

Export the gains from this GroupCommand object into a file, creating it as necessary.

Parameters
fileThe filename (or path + filename) to the file to write to.

◆ readSafetyParameters()

FunctionCallResult hebi::GroupCommand::readSafetyParameters ( const std::string &  file)
inline

Import the safety parameters from a file into this GroupCommand object.

Parameters
fileThe filename (or path + filename) to the file to read from.

◆ writeSafetyParameters()

FunctionCallResult hebi::GroupCommand::writeSafetyParameters ( const std::string &  file) const
inline

Export the safety parameters from this GroupCommand object into a file, creating it as necessary.

Parameters
fileThe filename (or path + filename) to the file to write to.

◆ setPosition()

void hebi::GroupCommand::setPosition ( const Eigen::VectorXd &  position)

Convenience function for setting position commands from Eigen vectors.

Note that if the vector is not the correct link, no action is taken.

◆ setVelocity()

void hebi::GroupCommand::setVelocity ( const Eigen::VectorXd &  velocity)

Convenience function for setting velocity commands from Eigen vectors.

Note that if the vector is not the correct link, no action is taken.

◆ setEffort()

void hebi::GroupCommand::setEffort ( const Eigen::VectorXd &  effort)

Convenience function for setting effort commands from Eigen vectors.

Note that if the vector is not the correct link, no action is taken.

◆ setSpringConstant()

void hebi::GroupCommand::setSpringConstant ( const Eigen::VectorXd &  springConstant)

Convenience function for setting spring constant commands from Eigen vectors.

Note that if the vector is not the correct link, no action is taken.

◆ getPosition() [1/2]

Eigen::VectorXd hebi::GroupCommand::getPosition ( ) const

Convenience function for returning commanded position values.

◆ getVelocity() [1/2]

Eigen::VectorXd hebi::GroupCommand::getVelocity ( ) const

Convenience function for returning commanded velocity values.

◆ getEffort() [1/2]

Eigen::VectorXd hebi::GroupCommand::getEffort ( ) const

Convenience function for returning commanded effort values.

◆ getSpringConstant() [1/2]

Eigen::VectorXd hebi::GroupCommand::getSpringConstant ( ) const

Convenience function for returning commanded spring constant values.

◆ getPosition() [2/2]

void hebi::GroupCommand::getPosition ( Eigen::VectorXd &  out) const

Convenience function for returning commanded position values.

◆ getVelocity() [2/2]

void hebi::GroupCommand::getVelocity ( Eigen::VectorXd &  out) const

Convenience function for returning commanded velocity values.

◆ getEffort() [2/2]

void hebi::GroupCommand::getEffort ( Eigen::VectorXd &  out) const

Convenience function for returning commanded effort values.

◆ getSpringConstant() [2/2]

void hebi::GroupCommand::getSpringConstant ( Eigen::VectorXd &  out) const

Convenience function for returning commanded spring constant values.


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