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
Noneif loading fails.- Return type:
StateEstimation| None
Load a sensor from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded sensor or
Noneif loading fails.- Return type:
Sensor| None
Load a task from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded task or
Noneif loading fails.- Return type:
Task| None
Load a scenario from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded scenario or
Noneif loading fails.- Return type:
Scenario| None
Load a obstacle from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded obstacle or
Noneif loading fails.- Return type:
Obstacle| None
Load a wall from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded wall or
Noneif loading fails.- Return type:
Wall| None
Load a agent from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded agent or
Noneif loading fails.- Return type:
Agent| None
Load a world from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded world or
Noneif loading fails.- Return type:
World| None
Load a experiment from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded experiment or
Noneif 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
Noneif loading fails.- Return type:
Sampler| None
Load a group from a YAML string.
- Parameters:
value – the YAML string.
- Returns:
The loaded group or
Noneif 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:
Schema#
navground.sim schemas are more complex than navground.core schemas due to the presence of samplers.
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: