YAML#

Similar as for navground.core, the Python bindings exposed part of the public functionality described in the YAML cpp reference. In particular, for classes Task, StateEstimation, Scenario, Experiment, Agent, World, Wall, Obstacle, Sampler, you can load objects of class T using T.load(...) or load_<t>(...):

Load a state estimation from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded state estimation or None if loading fails.

Return type:

StateEstimation| None

Load a sensor from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded sensor or None if loading fails.

Return type:

Sensor| None

Load a task from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded task or None if loading fails.

Return type:

Task| None

Load a scenario from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded scenario or None if loading fails.

Return type:

Scenario| None

Load a obstacle from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded obstacle or None if loading fails.

Return type:

Obstacle| None

Load a wall from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded wall or None if loading fails.

Return type:

Wall| None

Load a agent from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded agent or None if loading fails.

Return type:

Agent| None

Load a world from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded world or None if loading fails.

Return type:

World| None

Load a experiment from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded experiment or None if loading fails.

Return type:

Experiment| None

Load a Sampler from a YAML string.

Parameters:
  • value – The YAML string.

  • type_name – The samples type name.

Returns:

The loaded Sampler or None if loading fails.

Return type:

Sampler| None

Load a group from a YAML string.

Parameters:

value – the YAML string.

Returns:

The loaded group or None if loading fails.

Return type:

AgentSampler| None

You can dump objects of the same classes (and navground.core classes) to YAML using T.dump() or

Dumps the object to a YAML-string.

Returns:

The YAML representation

Return type:

str

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: navground.core.schema.Schema) -> None:
>>>     ...
Parameters:

modifier – A modifier

Returns:

The registered static method

Return type:

staticmethod

bundle_schema() -> navground.core.schema.Schema

Returns the bundle json-schema

Returns:

json-schema

Return type:

navground.core.schema.Schema