AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
AutoAPMS - Core

Classes

class  ActionClientWrapper< ActionT >
 
class  Task< ActionT >
 

Enumerations

enum class  ActionGoalStatus : uint8_t { REJECTED = 0 , RUNNING , COMPLETED }
 
enum class  TaskStatus : uint8_t { RUNNING , SUCCESS , FAILURE }
 

Functions

std::set< std::string > getAllPackagesWithResource (const std::string &resource_type)
 
std::vector< std::string > collectPluginXMLPaths (const std::string &resource_type, const std::set< std::string > &search_packages={})
 
enum class  TextColor {
  GREEN , RED , YELLOW , BLUE ,
  MAGENTA , CYAN
}
 
std::string makeColoredText (const std::string &text, TextColor color)
 
std::vector< std::string > splitString (const std::string &str, const std::string &delimiter, bool preserve_empty=true)
 

Detailed Description

Fundamental base classes and utility functions.

Enumeration Type Documentation

◆ ActionGoalStatus

enum class ActionGoalStatus : uint8_t
strong

Enum for indicating a ROS 2 action goal's current status.

It is used to represent the internal state of auto_apms_core::ActionClientWrapper.

Enumerator
REJECTED 
RUNNING 
COMPLETED 

Definition at line 33 of file action_client.hpp.

◆ TaskStatus

enum class TaskStatus : uint8_t
strong

Status of the auto_apms_core::Task execution process.

Enumerator
RUNNING 
SUCCESS 
FAILURE 

Definition at line 36 of file task.hpp.

◆ TextColor

enum class TextColor
strong
Enumerator
GREEN 
RED 
YELLOW 
BLUE 
MAGENTA 
CYAN 

Definition at line 25 of file string.hpp.

Function Documentation

◆ 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_typeName of the resource type.
Returns
Package names.
Exceptions
exceptions::ResourceNotFoundErrorif no resources of type resource_type were found.

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_typeName of the ament_index resource type containing the path to the plugins.xml manifest file relative to the package's install prefix.
search_packagesPackages to consider when searching for plugin resources. Leave empty to search in all packages.
Returns
Vector of file paths.
Exceptions
auto_apms_core::exceptions::ResourceNotFoundErrorif failed to find a corresponding file in a package specified in search_packages or if an ament_index resource marker file is invalid.

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
textText to be displayed.
colorDesired 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]strString to split into multiple tokens.
[in]delimiterDelimiter string at which the string shall be split.
[in]preserve_emptyPreserve 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.