Fundamental base classes and utility functions.
◆ ActionGoalStatus
◆ TaskStatus
◆ TextColor
Enumerator |
---|
GREEN | |
RED | |
YELLOW | |
BLUE | |
MAGENTA | |
CYAN | |
Definition at line 25 of file string.hpp.
◆ getAllPackagesWithResource()
std::set< std::string > getAllPackagesWithResource |
( |
const std::string & | resource_type | ) |
|
Collect all package names that register a certain type of ament_index
resources.
- Note
- Resources are not available until the respective ROS2 package is installed.
- Parameters
-
resource_type | Name of the resource type. |
- Returns
- Package names.
- Exceptions
-
Definition at line 25 of file resources.cpp.
◆ collectPluginXMLPaths()
std::vector< std::string > collectPluginXMLPaths |
( |
const std::string & | resource_type, |
|
|
const std::set< std::string > & | search_packages = {} ) |
Collect the paths of plugin.xml manifest files used for initializing pluginlib::ClassLoader objects.
This function requires packages to install plugins.xml manifest files and register them as an ament_index
resource.
- Parameters
-
resource_type | Name of the ament_index resource type containing the path to the plugins.xml manifest file relative to the package's install prefix. |
search_packages | Packages to consider when searching for plugin resources. Leave empty to search in all packages. |
- Returns
- Vector of file paths.
- Exceptions
-
Definition at line 40 of file resources.cpp.
◆ makeColoredText()
std::string makeColoredText |
( |
const std::string & | text, |
|
|
TextColor | color ) |
Add ANSI color escape sequences to display the text in color when printed to console.
The text color will be reset to default after the text ends.
- Parameters
-
text | Text to be displayed. |
color | Desired color of the text. |
- Returns
- String including corresponding ANSI color escape sequences.
Definition at line 45 of file string.cpp.
◆ splitString()
std::vector< std::string > splitString |
( |
const std::string & | str, |
|
|
const std::string & | delimiter, |
|
|
bool | preserve_empty = true ) |
Split a string into multiple tokens using a specific delimiter string (Delimiter may consist of multiple characters).
Will preserve empty strings if preserve_empty
is true
(Default), so for example with the delimiter being ::
passing the string ::foo
will output a vector with two elements {"", "foo"}.
- Parameters
-
[in] | str | String to split into multiple tokens. |
[in] | delimiter | Delimiter string at which the string shall be split. |
[in] | preserve_empty | Preserve empty string tokens in the result vector. |
- Returns
- Vector of string representing the string's tokens without the delimiter.
Definition at line 24 of file string.cpp.