Base class#
This class describes a generic behavior modulation that happens right before (
pre()
) and right after (post()
) computing a command.Dumps the object to a YAML-string.
- Returns:
The YAML representation
- Return type:
Gets the value of the specified property.
- Parameters:
name – The name of the property
- Raise:
std::runtime_error A runtime error if no property is found.
- Returns:
The value of the property
Check whether a type name has been registered.
- Parameters:
type – The associated type name.
- Returns:
True if the type name has been registered.
Load a modulation modulation from a YAML string.
- Returns:
The loaded modulation or
None
if loading fails.- Return type:
BehaviorModulation| None
Create an object of a sub-class selected by name.
- Parameters:
type – The associated type name.
- Returns:
An object of a registered sub-class or
None
in case the desired name is not found.
Called right after the evaluation of behavior in
Behavior.compute_cmd()
.- Parameters:
behavior – The behavior being evaluated
time_step – The time step
cmd – The command just computed by the behavior
Called right before the evaluation of behavior in
Behavior.compute_cmd()
.- Parameters:
behavior – The behavior being evaluated
time_step – The time step
Returns the json-schema that includes registered components.
- Returns:
“anyOf” json-schema of all registered components.
- Return type:
dict[str, typing.Any]
Returns the json-schema of a component
Returns an empty dictionary if a not registered type is requested.
- Parameters:
reference_register_schema – Whether to reference registered components schema in the base class schema.
type (str) – An optional registered type. If not specified, it returns the schema of the base class.
- Returns:
A json-schema of the registered class
- Return type:
dict[str, typing.Any]
Set the value of a named property. Fails silently if no property can be found or if the value has a non-compatible type.
- Parameters:
name – The name of the property
value – The desired value for the property
- Type:
Returns whether the modulation is enabled
- Type:
The registered properties
- Type:
The name associated to the type of an object