api.sensors package¶
Submodules¶
api.sensors.camera module¶
-
class
api.sensors.camera.
Camera
(name, platform)¶ Bases:
pioneer.das.api.sensors.sensor.Sensor
Camera sensor, expects ‘img’ datasource, intrinsics matrix and distortion coefficients
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
property
camera_matrix
¶ the 3x3 intrinsics matrix
See also: https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga3207604e4b1a1758aa66acb6ed5aa65d
- Type
np.ndarray
-
property
distortion_coeffs
¶ Nx1 distortion coefficient, refer to opencv documentation
See also: https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga3207604e4b1a1758aa66acb6ed5aa65d
- Type
np.ndarray
-
load_intrinsics
(intrinsics_config)¶ Looks for a pickle file containing intrinsics information for this sensor, e.g. ‘eagle_tfc.pkl’
- Parameters
intrinsics_config – path to folder containing this sensor’s intrinsics pickle file,
or relative to dataset path), e.g. '/nas/cam_intrinsics' or 'cam_intrinsics' ((absolute) –
-
api.sensors.carla_gps module¶
api.sensors.carla_imu module¶
-
class
api.sensors.carla_imu.
CarlaIMU
(name, platform)¶ Bases:
pioneer.das.api.sensors.sensor.Sensor
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
create_egomotion_provider
()¶
-
api.sensors.egomotion_provider module¶
api.sensors.encoder module¶
-
class
api.sensors.encoder.
Encoder
(name, platform)¶ Bases:
pioneer.das.api.sensors.sensor.Sensor
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
create_egomotion_provider
()¶
-
api.sensors.imu_egomotion_provider module¶
api.sensors.imu_sbg_ekinox module¶
-
class
api.sensors.imu_sbg_ekinox.
ImuSbgEkinox
(name, platform)¶ Bases:
pioneer.das.api.sensors.sensor.Sensor
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
create_egomotion_provider
()¶
-
api.sensors.lca3 module¶
-
class
api.sensors.lca3.
LCA3
(name, platform)¶ Bases:
pioneer.das.api.sensors.lcax.LCAx
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
get_trace_smoothing_kernel
()¶ Get the convolution kernel for trace processing for Eagle
-
api.sensors.lcax module¶
-
class
api.sensors.lcax.
LCAx
(name, platform)¶ Bases:
pioneer.das.api.sensors.sensor.Sensor
LeddarTech LCAx family of sensors, expects ‘ech’, ‘sta’ and ‘cfg’ datasources
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
apply_distance_corrections
(timestamp, indices, distances)¶ Applies calibration and temperature-related distances corrections
-
apply_temperature_correction
(timestamp, indices, distances)¶ Applies temperature-related distance corrections
-
property
base_point_count
¶
-
property
binning
¶
-
cache
(specs: Dict[str, Union[int, float]]) → Dict[str, numpy.ndarray]¶ caches computation that are shared for all ‘ech’ samples.
- Parameters
specs – a dict with keys, ‘v’: number of scan channels, ‘h’: the number of imaging channels, ‘v_fov’: scan field of view, in degrees, ‘h_fov’: imaging field of view, in degrees
- Returns
A dict with keys ‘angles’ (the projection angles), ‘directions’ (the projection directions) and ‘quad_directions’ (the projection surface cloud directions)
Note
If ‘angle_chart’ is defined in this sensor’s intrinsics, the angle chart’s angles is used to compute ‘directions’, but not ‘quad_directions’. If ‘mirror_temp_compensation’ is defined in this sensor’s intrisincs, ‘angles_temp_lut’ and ‘directions_temp_lut’ will appear in cache and be used by apply_direction_corrections()
-
property
distance_scaling
¶ Get the distance in meters between two subsequent points in a trace
-
get_corrected_cloud
(timestamp, cache, type, indices, distances, amplitudes=None, dtype=<class 'numpy.float64'>)¶ Returns the point-cloud (or quad-cloud) using the get_corrected_projection_data() method.
- Parameters
type – ‘point_cloud’ or ‘quad_cloud’
-
get_corrected_projection_data
(timestamp: Union[int, float], cache: dict, type: str = 'directions')¶ Returns temperature compensated projections directions or angles
- Parameters
timestamp – the timestamp at which the sample is needed (use to obtain the right temperature)
cache – the cache to search in (obtained by calling LCAx.cache(…))
type – the type of directions (e.g) ‘directions’ or ‘quad_directions’. Must be present in the cache
- Returns
the compensated directions if any, or the uncompensated direction otherwise
-
get_temperature_at
(timestamp)¶
-
get_trace_smoothing_kernel
()¶ Get the convolution kernel for trace processing for LCA2
-
load_intrinsics
(intrinsics_config: Union[str, dict])¶ Load the LCAx intrinsics from a dictionnary like {‘v’: 8, ‘h’, 32, ‘v_fov’: 20, ‘h_fov’: 30}
- Parameters
intrinsics_config – The intrinsics configuration
-
load_specs_from_cfg
()¶
-
load_static_noise_from_cfg
()¶
-
load_time_base_delays_from_cfg
()¶
-
property
oversampling
¶
-
property
trace_smoothing_kernel
¶
-
api.sensors.motor_lidar module¶
-
class
api.sensors.motor_lidar.
MotorLidar
(name, platform)¶ Bases:
pioneer.das.api.sensors.sensor.Sensor
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
apply_temperature_correction
(timestamp, distances)¶ Applies temperature-related distance corrections
-
get_corrected_cloud
(timestamp, pts, dtype)¶ It corrects the pts-cloud according to a temperature compensation (if any).
-
load_intrinsics
(intrinsics_config: Union[str, dict])¶ load data from yml platform
-
api.sensors.mti module¶
api.sensors.pixell module¶
-
class
api.sensors.pixell.
Pixell
(name, platform)¶ Bases:
pioneer.das.api.sensors.lcax.LCAx
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
static
angles_from_heads
(distances, angles, head_positions)¶
-
cache
(specs)¶ caches computation that are shared for all ‘ech’ samples.
- Parameters
specs – a dict with keys, ‘v’: number of scan channels, ‘h’: the number of imaging channels, ‘v_fov’: scan field of view, in degrees, ‘h_fov’: imaging field of view, in degrees
- Returns
A dict with keys ‘angles’ (the projection angles), ‘directions’ (the projection directions) and ‘quad_directions’ (the projection surface cloud directions)
Note
If ‘angle_chart’ is defined in this sensor’s intrinsics, the angle chart’s angles is used to compute ‘directions’, but not ‘quad_directions’. If ‘mirror_temp_compensation’ is defined in this sensor’s intrisincs, ‘angles_temp_lut’ and ‘directions_temp_lut’ will appear in cache and be used by apply_direction_corrections()
-
get_cloud
(cache, type, indices, distances, amplitudes=None, dtype=<class 'numpy.float64'>)¶ Get cloud data (type_pts, type_amplitudes, type_indices) from a sensor.
-
get_corrected_cloud
(timestamp, cache, type, indices, distances, amplitudes=None, dtype=<class 'numpy.float64'>)¶ Returns the point-cloud (or quad-cloud) using the get_corrected_projection_data() method.
- Parameters
type – ‘point_cloud’ or ‘quad_cloud’
-
get_head_position_per_channel
()¶
-
get_trace_smoothing_kernel
()¶ Get the convolution kernel for trace processing for LCA2
-
load_intrinsics
(intrinsics_config: Union[str, dict])¶ Basic intrinsics are brougth back under Sensor.
-
api.sensors.radar_ti module¶
-
class
api.sensors.radar_ti.
RadarTI
(name, platform)¶ Bases:
pioneer.das.api.sensors.sensor.Sensor
-
__init__
(name, platform)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
get_corrected_cloud
(timestamp, pts, dtype)¶
-
api.sensors.sensor module¶
-
class
api.sensors.sensor.
Sensor
(name: str, pf, factories: Dict[str, Tuple[Any, Any]] = {}, call_start: Optional[Callable] = None, call_stop: Optional[Callable] = None)¶ Bases:
object
A sensor encapsulate a sensor and its datasources. Important when you add a new derivation of class Sensor, don’t forget to add it to platform.SENSOR_FACTORY.
-
exception
NoPathToReferential
¶ Bases:
Exception
-
__getitem__
(key: str)¶ Returns the datasource
- Parameters
key – the datasource type, e.g. ‘ech’
-
__init__
(name: str, pf, factories: Dict[str, Tuple[Any, Any]] = {}, call_start: Optional[Callable] = None, call_stop: Optional[Callable] = None)¶ Constructor.
- Parameters
name – the sensor’s name and position id, e.g. ‘eagle_tfc’
platform – the platform this sensor belongs to
factories – a dict containing one entry per datasource type, each entry’s value is a tuple containing (Sample-derived, optional_interpolator_function). For example, a factoryies dict could be {“ech”:(Echo, None), “sta”:(Sample, interpolators.linear_dict_of_float_interpolator)}
call_start – a callback to be called by Sensor.start() (e.g. to start an actual live sensor)
call_stop – similar to call_start
-
add_datasource
(ds, ds_type: str, cache_size: int = 100)¶ Adds a datasouce to this sensor
- Parameters
ds – a Filesource-derived instance or VirtualDatasource
ds_type – the datasource type, e.g. ‘ech’
-
create_egomotion_provider
() → Optional[EgomotionProvider]¶
-
datasource_names
() → List[str]¶ Returns this sensor’s datasource types
-
property
extrinsics_dirty
¶ The extrinsics dirty signal
-
invalidate_datasources_caches
()¶ Invalidate sensor’s datasources caches
-
items
()¶ Returns the datasource key,value iterable, implement dict API
-
keys
()¶ Returns the datasource types, implement dict API
-
load_extrinsics
(extrinsics_folder: str)¶ Looks for a pickle file containing extrinsics information for this sensor, named ‘From-To’ e.g. ‘flir_tfl-eagle_tfc.pkl’
- Parameters
intrinsics_config – path to folder containing this sensor’s extrinsics pickle file
or relative to dataset path), e.g. '/nas/extrinsics' or 'extrinsics' ((absolute) –
-
load_intrinsics
(intrinsics_config: str)¶ Looks for a pickle file containing intrinsics information for this sensor, e.g. ‘eagle_tfc.pkl’
- Parameters
intrinsics_config – path to folder containing this sensor’s intrinsics pickle file,
or relative to dataset path), e.g. '/nas/cam_intrinsics' or 'cam_intrinsics' ((absolute) –
-
map_to
(target: str) → numpy.ndarray¶ Returns a 4x4 tranform matrix mapping a point from this sensor’s referential to ‘target’ sensor’s referential
- Parameters
target – the name of the target sensor in which referential we want to map to
- Raises
Sensor.NoPathToReferential – if no mapping could be found
-
property
platform
¶
-
start
()¶ Starts the live sensor wrapped by this Sensor instance
-
stop
()¶ Stops the live sensor wrapped by this Sensor instance
-
exception