|
| MC_RBDYN_DLLAPI const mc_rbdyn::Robot & | mc_rbdyn::robotFromConfig (const mc_rtc::Configuration &config, const mc_rbdyn::Robots &robots, const std::string &prefix, bool required=false, const std::string &robotIndexKey="robotIndex", const std::string &robotNameKey="robot", const std::string &defaultRobotName="") |
| | Obtains a reference to a loaded robot from configuration (using robotName or robotIndex) More...
|
| |
| std::string MC_RBDYN_DLLAPI | mc_rbdyn::robotNameFromConfig (const mc_rtc::Configuration &config, const mc_rbdyn::Robots &robots, const std::string &prefix="", bool required=false, const std::string &robotIndexKey="robotIndex", const std::string &robotNameKey="robot", const std::string &defaultRobotName="") |
| | Helper to obtain the robot name from configuration. More...
|
| |
| unsigned int MC_RBDYN_DLLAPI | mc_rbdyn::robotIndexFromConfig (const mc_rtc::Configuration &config, const mc_rbdyn::Robots &robots, const std::string &prefix="", bool required=false, const std::string &robotIndexKey="robotIndex", const std::string &robotNameKey="robot", const std::string &defaultRobotName="") |
| | Helper to obtain the robot index from configuration. More...
|
| |
The intent of these functions is:
- to facilitate supporting managing robots by name in the FSM, while maintaining compatibility with the existing FSMs using robotIndex.
- to facilitate the upcoming transition from Tasks (requires robotIndex) to TVM (using only robotName). When the transition occurs, robotIndexFromConfig can be deprecated, and its uses be replaced with robotNameFromConfig instead.
◆ robotFromConfig()
Obtains a reference to a loaded robot from configuration (using robotName or robotIndex)
- If robotName is present, it is used to find the robot
- Otherwise, it'll attempt to use robotIndex and inform the user that its use is deprecated in favor of robotName
- Parameters
-
| config | Configuration from which to look for robotName/robotIndex |
| robots | Loaded robots |
| prefix | Prefix used for printint outputs to the user (deprecation warning, non-existing robot, etc). |
| required |
- When true, throws if the robotName/robotIndex is invalid or missing.
- When false, returns the main robot if the robotName/robotIndex is invalid or missing.
|
| robotIndexKey | Configuration key for robotIndex |
| robotNameKey | Configuration key for robotName |
| defaultRobotName | When empty, return the main robot name, otherwise use the specified name |
- Returns
- Robot as configured by the robotName or robotIndex configuration entry.
◆ robotIndexFromConfig()
| unsigned int MC_RBDYN_DLLAPI mc_rbdyn::robotIndexFromConfig |
( |
const mc_rtc::Configuration & |
config, |
|
|
const mc_rbdyn::Robots & |
robots, |
|
|
const std::string & |
prefix = "", |
|
|
bool |
required = false, |
|
|
const std::string & |
robotIndexKey = "robotIndex", |
|
|
const std::string & |
robotNameKey = "robot", |
|
|
const std::string & |
defaultRobotName = "" |
|
) |
| |
Helper to obtain the robot index from configuration.
- Note
- This function will be removed when transitioning to TVM. To facilitate the transition from index-based to named-based robots, this function can be deprecated to help with the transition.
- See also
- const mc_rbdyn::Robot & robotFromConfig(const mc_rtc::Configuration & config, const mc_rbdyn::Robots & robots, const std::string & prefix, bool required);
◆ robotNameFromConfig()
| std::string MC_RBDYN_DLLAPI mc_rbdyn::robotNameFromConfig |
( |
const mc_rtc::Configuration & |
config, |
|
|
const mc_rbdyn::Robots & |
robots, |
|
|
const std::string & |
prefix = "", |
|
|
bool |
required = false, |
|
|
const std::string & |
robotIndexKey = "robotIndex", |
|
|
const std::string & |
robotNameKey = "robot", |
|
|
const std::string & |
defaultRobotName = "" |
|
) |
| |