timor.utilities.module_classification

Exceptions

ModuleClassificationError

This can be raised when a module should be assigned a unique type but the classification is not possible

Classes

ModuleType

This class implements a simplified but useful distinction of modules in four types: Base, Joint, Link and Eef.

Functions

divide_db_in_types(db[, strict])

Takes one module db and splits it into subsets of bases, links, joints and end-effectors if possible.

get_module_type(module[, strict])

Tries to get the module type from Module data.

Module Contents

exception timor.utilities.module_classification.ModuleClassificationError
Inheritance diagram of timor.utilities.module_classification.ModuleClassificationError

This can be raised when a module should be assigned a unique type but the classification is not possible

Initialize self. See help(type(self)) for accurate signature.

class timor.utilities.module_classification.ModuleType
Inheritance diagram of timor.utilities.module_classification.ModuleType

This class implements a simplified but useful distinction of modules in four types: Base, Joint, Link and Eef.

Be aware that this classification might be an oversimplification, regarding the current module at hand and use with care. There is no such distinction in general - however, in the last decades multiple works have published modules that can clearly be assigned to one of these types, and if it is possible, this utility class can be used to annotate them.

Initialize self. See help(type(self)) for accurate signature.

BASE = 0
END_EFFECTOR = 3
JOINT = 2
timor.utilities.module_classification.divide_db_in_types(db, strict=True)

Takes one module db and splits it into subsets of bases, links, joints and end-effectors if possible.

In general, this distinction is an oversimplification, so in cases a module is not clearly one of the possible types, this will raise an Exception.

Parameters:
  • db (timor.Module.ModulesDB) – Any input modules db with modules that can be uniquely assigned to a ModuleType

  • strict (bool) – If true, this method will raise an Error if there are any doubts about the uniqueness of the classification.

Returns:

Four DBs in the following order: (Bases, Links, Joints, End-Effectors)

Raises:

ModuleClassificationError

Return type:

Tuple[timor.Module.ModulesDB, timor.Module.ModulesDB, timor.Module.ModulesDB, timor.Module.ModulesDB]

timor.utilities.module_classification.get_module_type(module, strict=True)

Tries to get the module type from Module data.

Be aware the distinction is not always unique, so only use this method if you know your module set.

Parameters:
  • module (timor.Module.ModuleBase) – The module to be classified.

  • strict (bool) –

    If true, this method will raise an Error if there are any doubts about the uniqueness of the classification. There are no doubts if there is:

    • Exactly one base connector, one body, zero joints and one other connector OR

    • Exactly one eef connector, one body, zero joints and one other connector OR

    • One or more joints with a “serial” setup and no special connectors OR

    • Exactly one body, no special connectors and no joints

Returns:

A Module Type

Return type:

ModuleType