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:

bool

Whether the [integer] data is categorical or not.

Type:

float

The upper limits

Type:

float

The lower limits

Type:

tuple

The shape of the buffer

Type:

list[int]

The strides.

Type:

numpy.dtype

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 description

  • data (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:

bool

Whether buffer is categorical.

Type:

numpy.ndarray

The data stored in the buffer

Type:

navground.core.BufferDescription

The description.

Type:

float

The upper bound.

Type:

float

The lower bound.

Type:

tuple

The shape.

Type:

int

The buffer size

Type:

numpy.dtype

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:
“: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:

navground.core.BufferMap

The buffers.