YAML#

Similar as for the core library, the Python bindings only exposed part of the public functionality described in the YAML cpp reference. In particular, you can load registered components

load_state_estimation(value: str) StateEstimation | None#

Load a state estimation from a YAML string.

Returns:

The loaded state estimation or None if loading fails.

load_task(value: str) Task | None#

Load a task from a YAML string.

Returns:

The loaded task or None if loading fails.

load_scenario(value: str) Scenario | None#

Load a scenario from a YAML string.

Returns:

The loaded scenario or None if loading fails.

in addition to navground.sim.Agent, navground.sim.World, and navground.sim.Experiment:

load_agent(value: str) Agent | None#

Load an agent from a YAML string.

Returns:

The loaded task or None if loading fails.

load_world(value: str) World | None#

Load a world from a YAML string.

Returns:

The loaded world or None if loading fails.

load_experiment(value: str) Experiment | None#

Load a experiment from a YAML string.

Returns:

The loaded experiment or None if loading fails.

You can dump objects of the same classes to YAML:

Dumps the object to a YAML-string.

Returns:

The YAML representation

Return type:

str

Note

Like for navground.core, functions load_<component>() and methods <Component>.load() are equivalent, like for example navground.sim.load_task() and navground.sim.Task.load().

Similar is valid for function navground.sim.dump() and methods <Component>.dump, such as navground.sim.Task.dump().

Schema#

navground.sim schemas are more complex than navground.core schemas due to the presence of samplers.

module:

navground.sim.schema

Register a custom JSON-schema for a class

Use it as:

>>> class MyClass(Class, name=...):
>>>
>>> @schema.register
>>> def modifier(schema: dict[str, typing.Any]) -> None:
>>>     ...
Parameters:

modifier – A modifier

Returns:

The registered static method

Return type:

staticmethod

bundle_schema() -> object

Returns the bundle json-schema

Returns:

json-schema

Return type:

dict[str, typing.Any]