WB-Toolbox  6.0.0
ASimulinkToolboxforWholeBodyControl
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
wbt::base::Configuration Class Reference

Store the configuration for whole-body blocks. More...

#include <Configuration.h>

Detailed Description

Store the configuration for whole-body blocks.

This class stores the content of the WBToolbox.Configuration Matlab class and its related configuration block. This in principle is Simulink specific, but nothing prevents using it from C++ for instantiating a wbt::RobotInterface object.

Its usage is specific for using yarp::dev::RemoteControlBoardRemapper and iDynTree::KinDynComputations objects contained in the wbt::RobotInterface class.

See also
wbt::RobotInterface, wbt::WBBlock, wbt::WholeBodySingleton, WBToolbox.Configuration Matlab Class

Classes

class  impl
 

Public Member Functions

 Configuration (const std::string &confKey={})
 
 Configuration (const Configuration &conf)
 
 ~Configuration ()
 
void setParameters (const std::string &robotName, const std::string &urdfFile, const std::vector< std::string > &controlledJoints, const std::vector< std::string > &controlBoardsNames, const std::string &localName, const std::array< double, 3 > &gravityVector)
 Initialize the object. More...
 
void setRobotName (const std::string &robotName)
 Set the name of the robot. More...
 
void setUrdfFile (const std::string &urdfFile)
 Set the name of the file containing the urdf model. More...
 
void setControlledJoints (const std::vector< std::string > &controlledJoints)
 Set the subset of controlled joints. More...
 
void setControlBoardsNames (const std::vector< std::string > &controlBoardsNames)
 Set the names of the used ControlBoard names. More...
 
void setLocalName (const std::string &localName)
 Set the prefix appended to the opened ports. More...
 
void setGravityVector (const std::array< double, 3 > &gravityVector)
 Set the gravity vector. More...
 
const std::string & getRobotName () const
 Get the name of the robot. More...
 
const std::string & getUrdfFile () const
 Get the name of the file containing the urdf model. More...
 
const std::vector< std::string > & getControlledJoints () const
 Get the subset of controlled joints. More...
 
const std::vector< std::string > & getControlBoardsNames () const
 Get the names of the used ControlBoard names. More...
 
const std::string & getLocalName () const
 Get the prefix appended to the opened ports. A leading "/" is always present. More...
 
const std::string getUniqueId () const
 Generate a unique identifier. More...
 
const std::array< double, 3 > & getGravityVector () const
 Get the gravity vector. More...
 
const size_t & getNumberOfDoFs () const
 
const std::string getConfKey () const
 Get the unique identifier of this configuration object. More...
 
bool isValid () const
 Check if the congiguration is valid. More...
 
bool operator== (const Configuration &config) const
 

Private Attributes

std::unique_ptr< implpImpl
 

Constructor & Destructor Documentation

◆ Configuration() [1/2]

Configuration::Configuration ( const std::string &  confKey = {})

◆ Configuration() [2/2]

Configuration::Configuration ( const Configuration conf)

◆ ~Configuration()

Configuration::~Configuration ( )
default

Member Function Documentation

◆ getConfKey()

const std::string Configuration::getConfKey ( ) const

Get the unique identifier of this configuration object.

Returns
The unique identifier.

◆ getControlBoardsNames()

const std::vector< std::string > & Configuration::getControlBoardsNames ( ) const

Get the names of the used ControlBoard names.

Returns
Names of the used ControlBoard names.

◆ getControlledJoints()

const std::vector< std::string > & Configuration::getControlledJoints ( ) const

Get the subset of controlled joints.

Returns
Subset of controlled joints.

◆ getGravityVector()

const std::array< double, 3 > & Configuration::getGravityVector ( ) const

Get the gravity vector.

Returns
The gravity vector.

◆ getLocalName()

const std::string & Configuration::getLocalName ( ) const

Get the prefix appended to the opened ports. A leading "/" is always present.

Returns
Prefix appended to the opened ports.

◆ getNumberOfDoFs()

const size_t & Configuration::getNumberOfDoFs ( ) const

Get the configured number of DoFs

Returns
The configured number of DoFs.

◆ getRobotName()

const std::string & Configuration::getRobotName ( ) const

Get the name of the robot.

Returns
Name of the robot.

◆ getUniqueId()

const std::string Configuration::getUniqueId ( ) const

Generate a unique identifier.

Get a string with a unique identifier generated from the name of the config block from Simulink. It might be useful when yarp ports must have a unique prefix (e.g. two RemoteControlBoardRemappers which share a ControlBoard)

Returns
The unique identifier.
See also
setLocalName

◆ getUrdfFile()

const std::string & Configuration::getUrdfFile ( ) const

Get the name of the file containing the urdf model.

Returns
Name of the file containing the urdf model.

◆ isValid()

bool Configuration::isValid ( ) const

Check if the congiguration is valid.

I.e. all the required fields have been stored successfully.

Returns
True if the configuration is valid.

◆ operator==()

bool Configuration::operator== ( const Configuration config) const

◆ setControlBoardsNames()

void Configuration::setControlBoardsNames ( const std::vector< std::string > &  controlBoardsNames)

Set the names of the used ControlBoard names.

Parameters
controlBoardsNamesNames of the used ControlBoard names.

◆ setControlledJoints()

void Configuration::setControlledJoints ( const std::vector< std::string > &  controlledJoints)

Set the subset of controlled joints.

Parameters
controlledJointsSubset of controlled joints.

◆ setGravityVector()

void Configuration::setGravityVector ( const std::array< double, 3 > &  gravityVector)

Set the gravity vector.

Parameters
gravityVectorThe gravity vector.

◆ setLocalName()

void Configuration::setLocalName ( const std::string &  localName)

Set the prefix appended to the opened ports.

Parameters
localNamePrefix appended to the opened ports.

◆ setParameters()

void Configuration::setParameters ( const std::string &  robotName,
const std::string &  urdfFile,
const std::vector< std::string > &  controlledJoints,
const std::vector< std::string > &  controlBoardsNames,
const std::string &  localName,
const std::array< double, 3 > &  gravityVector 
)

Initialize the object.

Parameters
robotNameName of the robot.
urdfFileName of the file containing the urdf model.
controlledJointsSubset of controlled joints.
controlBoardsNamesNames of the used ControlBoard names.
localNamePrefix appended to the opened ports.
gravityVectorThe gravity vector.

◆ setRobotName()

void Configuration::setRobotName ( const std::string &  robotName)

Set the name of the robot.

Parameters
robotNameName of the robot.

◆ setUrdfFile()

void Configuration::setUrdfFile ( const std::string &  urdfFile)

Set the name of the file containing the urdf model.

Parameters
urdfFileName of the file containing the urdf model.

Member Data Documentation

◆ pImpl

std::unique_ptr<impl> wbt::base::Configuration::pImpl
private

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