Sensing#
Describes a typed, bounded, multi-dimensional buffer.
Mimics Gymnasium Box spaces (https://gymnasium.farama.org/api/spaces/).
Constructs a new instance.
- Parameters:
shape – The shape
type – The type
low – The low
high – The high
categorical – The categorical
- Type:
Whether the [integer] data is categorical or not.
- Type:
The upper limits
- Type:
The lower limits
- Type:
The shape of the buffer
- Type:
A code that identify the type of data.
A typed, bounded, multi-dimensional array, similar to
numpy
arrays.Constructs a new instance.
- Parameters:
description (
navground.core.BufferDescription
| None) – The descriptiondata (object) – Optional data to initialize the buffer. If provided, it will overwrite data initialized from the description. Else the buffer will be initialized with zeros. Accept any type supporting the buffer protocol.
Sets the description.
If force is set, it will set the description and possibly reset the buffer if the type or size have changed. If force is not set, it won’t allow changing shape to a different size or type to a different type.
- Parameters:
value – The value
force – Whenever data may be reset.
- Returns:
Whether the description was set or not.
- Type:
Whether buffer is categorical.
- Type:
The data stored in the buffer
-
The description.
- Type:
The upper bound.
- Type:
The lower bound.
- Type:
The shape.
- Type:
The buffer size
- Type:
The buffer type
A dictionary of type Dict[str, Buffer]
Generic state to hold data from sensors in keyed buffers.
Construct an instance
Gets the buffer assigned to a key
- Parameters:
key – The key
- Returns:
The buffer.
Initializes a buffer.
- Parameters:
key (str) – The key
description (
navground.core.BufferDescription
| None) – The description
- “:param” data: Optional data to initialize the buffer. If provided,
it will overwrite data initialized from the description. Else the buffer will be initialized with zeros. Accept any type supporting the buffer protocol.
- Returns:
The buffer if successfully initialized else a null pointer
- Return type:
navground.core.Buffer
| None
Assign a buffer to a key.
- Parameters:
key – The key
value – The value
- Type:
The buffers.