Localization applies the same Z limits to the live scan in body coordinates and the initial reference scan in map coordinates. This can select different points or crash when the reference filter removes everything.
Example:
With height limits [-1.5, 2.0], a valid scan containing points at body z=0 passes. If the vehicle’s map elevation is z=10, those points become map z=10 and fail the reference filter. _squash() returns None, and subsampling raises TypeError
if perception_model is not None:
self.perception_model = perception_model
if sensors is None:
return
scan = self._squash(sensors.lidar_sensor.to_base(sensors.lidar)) # lidar → ego body frame
.
.
.
if self._map is None:
self._x = float(ego.x)
self._y = float(ego.y)
self._theta = float(ego.theta)
self._map = **self._squash(sensors.lidar_sensor.to_map(sensors.lidar, ego))[:: self._map_subsample]**
return
Filter once in body coordinates/map, then transform those accepted points into the desired frame.
Localization applies the same Z limits to the live scan in body coordinates and the initial reference scan in map coordinates. This can select different points or crash when the reference filter removes everything.
Example:
With height limits [-1.5, 2.0], a valid scan containing points at body z=0 passes. If the vehicle’s map elevation is z=10, those points become map z=10 and fail the reference filter. _squash() returns None, and subsampling raises TypeError
Filter once in body coordinates/map, then transform those accepted points into the desired frame.