diff --git a/src/kompass_core/mapping/local_mapper.py b/src/kompass_core/mapping/local_mapper.py index a9a8ff6..43afc42 100644 --- a/src/kompass_core/mapping/local_mapper.py +++ b/src/kompass_core/mapping/local_mapper.py @@ -156,6 +156,7 @@ def __init__(self, config: MapConfig, scan_model_config: LaserScanModelConfig): self.lower_right_corner_pose = PoseData() self.scan_update_model = scan_model_config + self.grid_data = GridData( width=self.grid_width, height=self.grid_height, @@ -163,9 +164,13 @@ def __init__(self, config: MapConfig, scan_model_config: LaserScanModelConfig): ) # for bayesian update - self.previous_grid_prob_transformed = np.copy( - self.grid_data.scan_occupancy_prob - ) + if self.config.baysian_update: + self.previous_grid_prob_transformed = np.full( + (self.grid_data.width, self.grid_data.height), + self.grid_data.p_prior, + dtype=np.float32, + order="F", + ) # turned to true after the first map update is done self.processed = False