![]() |
AutoAPMS
Streamlining behaviors in ROS 2
|
Fundamental helper classes and utility functions. More...
Namespaces | |
| namespace | auto_apms_util |
| Fundamental helper classes and utility functions. | |
Classes | |
| class | ActionClientWrapper< ActionT > |
| Convenience wrapper for a rclcpp_action::Client that introduces synchronous goal handling functions. More... | |
| class | ActionContext< ActionT > |
| Helper class that stores contextual information related to a ROS 2 action. More... | |
| class | ActionWrapper< ActionT > |
| Generic base class for implementing robot skills using the ROS 2 action concept. More... | |
| class | PluginClassLoader< BaseT > |
| Class for loading plugin resources registered according to the conventions defined by the pluginlib package. More... | |
Enumerations | |
| enum class | ActionGoalStatus : uint8_t |
| Enum for indicating a ROS 2 action goal's current status. More... | |
| enum class | ActionStatus : uint8_t |
| Status of the auto_apms_util::ActionWrapper execution process. More... | |
| std::string | makeColoredText (const std::string &text, TextColor color) |
| Add ANSI color escape sequences to display the text in color when printed to console. | |
| std::vector< std::string > | splitString (const std::string &str, const std::string &delimiter, bool remove_empty=true) |
| Split a string into multiple tokens using a specific delimiter string (Delimiter may consist of multiple characters). | |
| std::string | printMap (const std::map< std::string, std::string > &map, const std::string &key_val_sep="=", const std::string &entry_sep=", ") |
| Converts a map to a string representation that is suited for printing to console. | |
| std::string | trimWhitespaces (const std::string &str) |
| Trim whitespaces from both ends of a string. | |
| std::string | toCamelCase (const std::string &str) |
| Transform a string to camelCase. | |
| std::string | toSnakeCase (const std::string &str) |
| Transform a string to snake_case. | |
| template<typename ValueT, typename AllocatorT, template< typename T, class A > class ContainerT> | |
| bool | contains (const ContainerT< ValueT, AllocatorT > &c, const ValueT &val) |
| Check whether a particular container structure contains a value. | |
| template<typename KeyT, typename CompareT, typename AllocatorT> | |
| std::set< KeyT, CompareT, AllocatorT > | getCommonElements (std::set< KeyT, CompareT, AllocatorT > c1, std::set< KeyT, CompareT, AllocatorT > c2) |
| Assemble common elements of two sets. | |
| template<typename KeyT, typename AllocatorT> | |
| std::vector< KeyT, AllocatorT > | getCommonElements (std::vector< KeyT, AllocatorT > c1, std::vector< KeyT, AllocatorT > c2) |
| Assemble common elements of two vectors. | |
| bool | isFileEmpty (const std::string &path) |
| Determine if a file is empty. | |
| void | setLoggingSeverity (const rclcpp::Logger &logger, const std::string &severity) |
| Set the logging severity of a ROS 2 logger. | |
| void | setLoggingSeverity (const rclcpp::Logger &logger, rclcpp::Logger::Level severity) |
| Set the logging severity of a ROS 2 logger. | |
| std::set< std::string > | getPackagesWithResourceType (const std::string &resource_type, const std::set< std::string > &exclude_packages={}) |
Get a list of all package names that register a certain type of ament_index resources. | |
| std::set< std::string > | getPackagesWithPluginResources (const std::set< std::string > &exclude_packages={}) |
| Get a list of all package names that register AutoAPMS plugin resources. | |
| std::string | getPluginXMLPath (const std::string &package) |
| Get the path of a specific plugins.xml manifest file generated by AutoAPMS. | |
| std::vector< std::string > | collectPluginXMLPaths (const std::set< std::string > &exclude_packages={}) |
| Collect the paths of plugins.xml manifest files generated by AutoAPMS. | |
| #define | AUTO_APMS_UTIL_DEFINE_YAML_CONVERSION_METHODS(ClassType) |
| Macro for defining YAML encode/decode methods for a class. | |
Fundamental helper classes and utility functions.
| #define AUTO_APMS_UTIL_DEFINE_YAML_CONVERSION_METHODS | ( | ClassType | ) |
Macro for defining YAML encode/decode methods for a class.
| ClassType | Fully qualified name of the class. |
|
strong |
Enum for indicating a ROS 2 action goal's current status.
It is used to represent the internal state of auto_apms_util::ActionClientWrapper.
Definition at line 42 of file action_client_wrapper.hpp.
|
strong |
Status of the auto_apms_util::ActionWrapper execution process.
Definition at line 32 of file action_wrapper.hpp.
| bool contains | ( | const ContainerT< ValueT, AllocatorT > & | c, |
| const ValueT & | val ) |
Check whether a particular container structure contains a value.
| ValueT | Type of the values inside the container. |
| AllocatorT | Container allocator type. |
| c | Container to be searched. |
| val | Comparison value. |
true if c contains val, false otherwise. Definition at line 36 of file container.hpp.
| bool isFileEmpty | ( | const std::string & | path | ) |
Determine if a file is empty.
A file is considered empty if it has no content or the content consists of whitespace characters only. If there is any non-whitespace character, this function returns false.
| path | Path to the file. |
true if the file has no content or consists of whitespaces only, false otherwise. Definition at line 24 of file filesystem.cpp.
| void setLoggingSeverity | ( | const rclcpp::Logger & | logger, |
| const std::string & | severity ) |
Set the logging severity of a ROS 2 logger.
| logger | Logger instance. |
| severity | Desired severity level encoded as a string. Must be one of DEBUG, INFO, WARN, ERROR, FATAL or UNSET. |
Definition at line 25 of file logging.cpp.
| std::set< std::string > getPackagesWithResourceType | ( | const std::string & | resource_type, |
| const std::set< std::string > & | exclude_packages = {} ) |
Get a list of all package names that register a certain type of ament_index resources.
| resource_type | Name of the resource type. |
| exclude_packages | Packages to exclude when searching for resources. |
resource_type excluding exclude_packages. Definition at line 28 of file resource.cpp.
| 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.
| text | Text to be displayed. |
| color | Desired color of the text. |
Definition at line 65 of file string.cpp.
| std::set< KeyT, CompareT, AllocatorT > getCommonElements | ( | std::set< KeyT, CompareT, AllocatorT > | c1, |
| std::set< KeyT, CompareT, AllocatorT > | c2 ) |
Assemble common elements of two sets.
| KeyT | Type of the keys within the set. |
| CompareT | Comparator type. |
| AllocatorT | Allocator type. |
| c1 | First set. |
| c2 | Second set. |
c1 as well as c2. Definition at line 53 of file container.hpp.
| std::vector< KeyT, AllocatorT > getCommonElements | ( | std::vector< KeyT, AllocatorT > | c1, |
| std::vector< KeyT, AllocatorT > | c2 ) |
Assemble common elements of two vectors.
| KeyT | Type of the values within the vector. |
| AllocatorT | Allocator type. |
| c1 | First vector. |
| c2 | Second vector. |
c1 as well as c2. Definition at line 70 of file container.hpp.
| void setLoggingSeverity | ( | const rclcpp::Logger & | logger, |
| rclcpp::Logger::Level | severity ) |
Set the logging severity of a ROS 2 logger.
| logger | Logger instance. |
| severity | Desired severity level. |
Definition at line 47 of file logging.cpp.
| std::set< std::string > getPackagesWithPluginResources | ( | const std::set< std::string > & | exclude_packages = {} | ) |
Get a list of all package names that register AutoAPMS plugin resources.
| exclude_packages | Packages to exclude when searching for resources. |
exclude_packages. Definition at line 41 of file resource.cpp.
| std::string getPluginXMLPath | ( | const std::string & | package | ) |
Get the path of a specific plugins.xml manifest file generated by AutoAPMS.
This function will discover the plugins.xml manifest file of a specific package. It will only work for packages that use the CMake macro auto_apms_util_register_plugins() to register plugins.
| package | Name of the package registering AutoAPMS plugin resources. |
pluginlib-style plugin manifest xml file. | auto_apms_util::exceptions::ResourceError | if failed to find a plugin manifest file. |
| auto_apms_util::exceptions::ResourceError | if an ament_index resource marker file is invalid. |
Definition at line 46 of file resource.cpp.
| std::vector< std::string > collectPluginXMLPaths | ( | const std::set< std::string > & | exclude_packages = {} | ) |
Collect the paths of plugins.xml manifest files generated by AutoAPMS.
This function will find all plugins.xml manifest files which are automatically populated using the CMake macro auto_apms_util_register_plugins().
| exclude_packages | Packages to exclude when searching for plugins.xml file paths. |
pluginlib-style plugin manifest xml files. | auto_apms_util::exceptions::ResourceError | if failed to find a plugin manifest file. |
| auto_apms_util::exceptions::ResourceError | if an ament_index resource marker file is invalid. |
Definition at line 65 of file resource.cpp.
| std::vector< std::string > splitString | ( | const std::string & | str, |
| const std::string & | delimiter, | ||
| bool | remove_empty = true ) |
Split a string into multiple tokens using a specific delimiter string (Delimiter may consist of multiple characters).
If delimiter is not found, the string is returned as is and the vector will have exactly one element.
Will remove empty strings if remove_empty is true (Default). So for example with the delimiter being :: passing the string ::foo will output a vector with one elements {"foo"}. If you want {"", "foo"}, you must set remove_empty to false.
| [in] | str | String to split into multiple tokens. |
| [in] | delimiter | Delimiter string at which the string shall be split. |
| [in] | remove_empty | Remove empty string tokens in the result vector. |
Definition at line 24 of file string.cpp.
| std::string printMap | ( | const std::map< std::string, std::string > & | map, |
| const std::string & | key_val_sep = "=", | ||
| const std::string & | entry_sep = ", " ) |
Converts a map to a string representation that is suited for printing to console.
| map | Map to be converted to string. |
| key_val_sep | Separator for the key-value pairs. |
| entry_sep | Separator for the map's entries. |
map. Definition at line 50 of file string.cpp.
| std::string trimWhitespaces | ( | const std::string & | str | ) |
Trim whitespaces from both ends of a string.
| str | String to trim. |
Definition at line 84 of file string.cpp.
| std::string toCamelCase | ( | const std::string & | str | ) |
Transform a string to camelCase.
| [in] | str | String to transform. |
Definition at line 97 of file string.cpp.
| std::string toSnakeCase | ( | const std::string & | str | ) |
Transform a string to snake_case.
| [in] | str | String to transform. |
Definition at line 116 of file string.cpp.