Base class#
The type of callbacks called when the task publishes data related to an event. The task must publish data of the same size, see
navground.sim.Task.log_size
.
This class describe the high-level task control that provides navigation goals.
Adds a callback called to log task events.
- Parameters:
value – The desired callback
Returns whether the task is done.
- Returns:
True if the task has finished.
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
The size of the data passed to callbacks when events occur, see
TaskCallback
andadd_callback()
.- Returns:
The size of the data vector.
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 task modulation from a YAML string.
- Returns:
The loaded task or
None
if loading fails.- Return type:
Task| None
Log an event, forwarding data to registered callbacks
- Parameters:
log – The logged data
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.
Setup the task. Called before starting a simulation.
- Parameters:
agent – The agent owning the task
world – The world the agent is part of
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
Tick the task, possibly updating the navigation goal of the agent.
- Parameters:
agent – The agent ticking the task
world – The world the agent is part of
time – The simulation time
- Type:
The size of the data passed to callbacks when events occur, see
TaskCallback
andadd_callback()
.
- Type:
The registered properties
- Type:
The name associated to the type of an object