Register#

For each C++ template class navground::core::HasRegister, we expose a Python class with name ending by Register, which serves as super-classes for their respective T class.

Python sub-classes of T by adding name=<name> to the class, where the <name> is an arbitrary string that will index the sub-class in the register. For example,

SubClassOfT(T, name="SubClassOfT"):
   ...

will register type SubClassOfT under the name "SubClassOfT".

A decorator to register a property. It must be used below the @property decorator.

For example, the following code adds a boolean valued registered property to a registered sub-class C of class T:

class C(T, name="C"):

    def __init__(self):
        super().__init__()
        self._my_field = True

    @property
    @register(True, "...")
    def my_property(self) -> bool:
        return self._my_field;

    @my_property.setter
    def my_property(self, value: bool) -> None:
        self._my_field = value;
Parameters:
  • default_value – The default value of the property when the object is initialized

  • description – The description of the property

  • schema – A optional schema to add validity constrains to the property

  • deprecated_names – A list of alternative deprecated names

This register holds any behavior registered in navground::core::HasRegister as well as registered Python sub-classes of navground.Behavior.

The names of all registered behaviors

The dictionary of registered properties with registered names as keys

This register holds any kinematics registered in navground::core::HasRegister as well as registered Python sub-classes of navground.Kinematics.

The names of all registered kinematics.

The dictionary of registered properties with registered names as keys

This register holds any modulation registered in navground::core::HasRegister as well as registered Python sub-classes of navground.core.BehaviorModulation.

The names of all registered modulations.

The dictionary of registered properties with registered names as keys