test morning

Dependencies:   ISR_Mini-explorer mbed

Fork of roboticLab_withclass_3_July by Georgios Tsamis

Revision:
5:19f24c363418
Parent:
3:37345c109dfc
--- a/Map.cpp	Thu Jul 06 12:13:14 2017 +0000
+++ b/Map.cpp	Thu Jul 06 16:51:40 2017 +0000
@@ -81,6 +81,25 @@
     return log(p/(1-p));
 }
 
+void Map::fill_map_with_kalman_knowledge(){
+	float xCenterRect=0;
+	float yCenterRect=0;
+	for (int i = 0; i<this->nbCellWidth; i++) {
+        for (int j = 0; j<this->nbCellHeight; j++) {
+            if(j==0 || j==this->nbCellHeight-1 || i==0 || i==this->nbCellWidth-1)
+                this->cellsLogValues[i][j] = this->proba_to_log(1);
+            else{
+            	//rectangle in center 30 width, 20 height
+            	if(((this->cell_width_coordinate_to_world(i) >= this->widthRealMap/2-15) && (this->cell_width_coordinate_to_world(i) <= this->widthRealMap/2+15)) && ((this->cell_height_coordinate_to_world(j) >= this->heightRealMap/2-10) && (this->cell_height_coordinate_to_world(j) <= this->heightRealMap/2+10))  ){
+            		this->cellsLogValues[i][j] = this->proba_to_log(1);
+            	}else
+            		this->cellsLogValues[i][j] = this->proba_to_log(0.5);
+            }
+            
+        }
+    }
+}
+
 /*
 
 float Map::robot_x_coordinate_in_world(float robot_x, float robot_y){