robokudo.utils.module_loader

Classes

RobokudoModuleType

Generic enumeration.

ModuleLoader

Module Contents

class robokudo.utils.module_loader.RobokudoModuleType

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

ActionServer
Annotator
AnalysisEngine
CameraConfig
IO
SemanticMap
ObjectKnowledgeBase
TreeComponents
Types
Utils
Data
class robokudo.utils.module_loader.ModuleLoader
logger = None
_get_ros_pkg_src_path(ros_pkg_name: str) pathlib.Path

Get the ros package src path given the name of the package.

Parameters

ros_pkg_namestr

name of a ros package

Returns

ros_pkg_pathPath

path object with the ros package path

_get_module_dir_path(package_src_path: pathlib.Path, module_type: RobokudoModuleType)

Get the path of a directory in a robokudo module of a given ros package.

Parameters

package_src_pathPath

path to the src of a robokudo ros package

module_type: RobokudoModuleType

type of the robokudo module to load

Returns

module_dir_pathPath

path object with the directory path

_get_module_path(package_src_path: pathlib.Path, module_type: RobokudoModuleType, module_name: str) pathlib.Path

Get the path of a robokudo module given the ros package src path.

Parameters

package_src_pathPath

path to the src of a robokudo ros package

module_type: RobokudoModuleType

type of the robokudo module to load

module_name: str

name of the module to load, e.g. the name of an analysis engine or annotator

Returns

module_pathPath

path object with the module path

_load_module(ros_pkg_name: str, module_type: RobokudoModuleType, module_name: str)

Load a robokudo module from given the ros package.

Parameters

ros_pkg_namestr

name of the ros package

module_type: RobokudoModuleType

type of the robokudo module to load

module_name: str

name of the module to load, e.g. the name of an analysis engine or annotator

Returns

loaded_module

object of the module to load

load_ae(ros_pkg_name: str, module_name: str)

Load an Analysis Engine (AE) given the AE module name and the ros package name.

The ros package has to be in located in the same workspace. The path to the AE within the package is meant to be: $package_path/src/robokudo_example_package/descriptors/analysis_engines/.

Parameters

ros_pkg_namestr

name of the ros package where the AE is located

module_name: str

name of the module to load, e.g. the name of an analysis engine or annotator

Returns

ae_root

root of the AE

load_annotator(ros_pkg_name: str, module_name: str)
load_camera_config(ros_pkg_name: str, module_name: str)

Load a camera config module given the ros package and module name.

Parameters

ros_pkg_namestr

name of the ros package where the camera config is located

module_name: str

name of the camera config module to load annotator

Returns

loaded_config

loaded camera config class

load_action_server(ros_pkg_name: str, module_name: str)

Load an action server module given the ros package name where the module is located the module name.

Parameters

ros_pkg_namestr

name of the ros package where the action server is located

module_name: str

name of action server module to load

Returns

loaded_action_server

loaded action server class

load_io(ros_pkg_name: str, module_name: str)
load_object_knowledge_base(ros_pkg_name: str, module_name: str)

Load an ObjectKnowledgeBase given the module name and the ros package name.

The path to the AE within the package is meant to be: $package_path/src/PACKAGE_NAME/descriptors/object_knowledge/.

Parameters

ros_pkg_namestr

name of the ros package where the semantic map is located

module_name: str

name of the module to load, e.g. the name of a object knowledge base

Returns

object_knowledge_base

The object knowledge base

load_semantic_map(ros_pkg_name: str, module_name: str)

Load an Analysis Engine (AE) given the AE module name and the ros package name.

The path to the AE within the package is meant to be: $package_path/src/PACKAGE_NAME/descriptors/semantic_maps/.

Parameters

ros_pkg_namestr

name of the ros package where the semantic map is located

module_name: str

name of the module to load, e.g. the name of a semantic map

Returns

ae_root

root of the AE

load_tree_components(ros_pkg_name: str, module_name: str)
load_types(ros_pkg_name: str, module_name: str)
load_utils(ros_pkg_name: str, module_name: str)
get_file_paths(ros_pkg_name: str, module_type: RobokudoModuleType, dir_name: str, file_extension: str = None) List[pathlib.Path]

Get the path of a robokudo module given the ros package src path.

Parameters

ros_pkg_namestr

name of the ros package where the AE is located

module_type: RobokudoModuleType

type of the robokudo module to load

dir_name: str

name of the directory where the files are located relative to the module

file_extension: str

extension of files to load, e.g. ‘.txt’, ‘.png’, ‘.yaml’ etc.

Returns

file_pathsList[Path]

list of file path objects