irsim.world.sensors.sensor_factory#

Classes#

SensorFactory

Factory for sensors declared in YAML object configurations.

Module Contents#

class irsim.world.sensors.sensor_factory.SensorFactory[source]#

Factory for sensors declared in YAML object configurations.

The factory reads the name or type key from a sensor dictionary and creates the matching concrete sensor class. Currently supported names are "lidar2d" and "fmcw_lidar2d".

create_sensor(state: numpy.ndarray, obj_id: int, **kwargs: Any) Any[source]#

Create a sensor instance from configuration kwargs.

Parameters:
  • state (np.ndarray) – Initial sensor state.

  • obj_id (int) – Associated object id.

  • **kwargs – Sensor configuration; expects ‘name’ or ‘type’.

Returns:

A concrete sensor instance (e.g., Lidar2D).

Return type:

Any

Raises:

NotImplementedError – If the requested sensor type is not supported.