AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
TreeResource Struct Reference

#include <auto_apms_behavior_tree/resource/tree_resource.hpp>

Public Member Functions

std::string writeTreeToString () const
 

Static Public Member Functions

static std::vector< TreeResourcecollectFromPackage (const std::string &package_name)
 
static TreeResource selectByTreeName (const std::string &tree_name, const std::string &package_name="")
 
static TreeResource selectByFileName (const std::string &file_name, const std::string &package_name="")
 
static TreeResource fromString (const std::string &identity)
 

Public Attributes

std::string tree_file_stem
 
std::string tree_file_path
 
std::string package_name
 
std::string node_manifest_file_path
 
std::set< std::string > tree_names
 

Detailed Description

Struct containing behavior tree resource data.

Definition at line 30 of file tree_resource.hpp.

Member Function Documentation

◆ collectFromPackage()

std::vector< TreeResource > collectFromPackage ( const std::string & package_name)
static

Collect all behavior tree resources registered by a certain package.

Parameters
package_nameName of the package to search for resources.
Returns
Collection of all resources found in package_name.

Definition at line 29 of file tree_resource.cpp.

◆ selectByTreeName()

TreeResource selectByTreeName ( const std::string & tree_name,
const std::string & package_name = "" )
static

Definition at line 59 of file tree_resource.cpp.

◆ selectByFileName()

TreeResource selectByFileName ( const std::string & file_name,
const std::string & package_name = "" )
static

Definition at line 98 of file tree_resource.cpp.

◆ fromString()

TreeResource fromString ( const std::string & identity)
static

Find a behavior tree resource using an identity string.

To uniquely identify the resource, the identity string may contain the <tree_file_stem>, the <tree_name> and the <package_name> seperated by :: in that order. Depending on the registered resources, it might be possible to use shorter, less precise signatures. All possible identity strings are listed below:

  • <tree_file_stem>::<tree_name>::<package_name>

    Fully qualified identity string of a behavior tree resource.

  • <tree_file_stem>::<tree_name>::

    Try to find the resource by searching for a tree with name <tree_name> in a file with stem <tree_file_stem> considering all packages.

  • <tree_file_stem>::::

    Try to find the resource by searching for a file with stem <tree_file_stem> considering all packages.

  • ::<tree_name>::

    Try to find the resource by searching for a tree with name <tree_name> considering all packages.

Note
The delimiter :: must be kept when tokens are omitted.
Parameters
identityIdentity string with formatting compliant to the signatures above.
Returns
Corresponding TreeResource object.
Exceptions
exceptions::ResourceIdentityFormatErrorif the identity string has wrong format.
auto_apms_core::exceptions::ResourceNotFoundErrorif the resource cannot be found using the given identity string.

Definition at line 138 of file tree_resource.cpp.

◆ writeTreeToString()

std::string writeTreeToString ( ) const

Definition at line 166 of file tree_resource.cpp.

Member Data Documentation

◆ tree_file_stem

std::string tree_file_stem

Definition at line 37 of file tree_resource.hpp.

◆ tree_file_path

std::string tree_file_path

Definition at line 38 of file tree_resource.hpp.

◆ package_name

std::string package_name

Definition at line 39 of file tree_resource.hpp.

◆ node_manifest_file_path

std::string node_manifest_file_path

Definition at line 40 of file tree_resource.hpp.

◆ tree_names

std::set<std::string> tree_names

Definition at line 41 of file tree_resource.hpp.


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