with class

Dependencies:   ISR_Mini-explorer mbed

Fork of VirtualForces by Georgios Tsamis

Revision:
38:5ed7c79fb724
Parent:
37:b4c45e43ad29
Child:
39:890439b495e3
--- a/MiniExplorerCoimbra.cpp	Sun Jun 11 23:22:28 2017 +0000
+++ b/MiniExplorerCoimbra.cpp	Thu Jun 15 23:17:55 2017 +0000
@@ -3,7 +3,7 @@
 
 #define PI 3.14159
 
-MiniExplorerCoimbra::MiniExplorerCoimbra(float defaultXWorld, float defaultYWorld, float defaultThetaWorld):map(200,200,20,20),sonarLeft(PI/2+10*PI/36,-4,4),sonarFront(PI/2,0,5),sonarRight(PI/2-10*PI/36,4,4){
+MiniExplorerCoimbra::MiniExplorerCoimbra(float defaultXWorld, float defaultYWorld, float defaultThetaWorld):map(200,200,20,20),sonarLeft(10*PI/36,-4,4),sonarFront(0,0,5),sonarRight(-10*PI/36,4,4){
     i2c1.frequency(100000);
     initRobot(); //Initializing the robot
     pc.baud(9600); // baud for the pc communication
@@ -170,10 +170,9 @@
         for(int j=0;j<this->map.nbCellHeight;j++){
         	xWorldCell=this->map.cell_width_coordinate_to_world(i);
             yWorldCell=this->map.cell_height_coordinate_to_world(j);
-            //compute_probability_t(float distanceObstacleDetected, float x, float y, float[2] robotCoordinatesInWorld)
-        	this->map.update_cell_value(i,j,this->sonarRight.compute_probability_t(rightMm,xWorldCell,yWorldCell,this->xWorld,this->yWorld,this->thetaWorld));
-        	this->map.update_cell_value(i,j,this->sonarLeft.compute_probability_t(leftMm,xWorldCell,yWorldCell,this->xWorld,yWorldCell,this->thetaWorld));
-        	this->map.update_cell_value(i,j,this->sonarFront.compute_probability_t(frontMm,xWorldCell,yWorldCell,this->xWorld,yWorldCell,this->thetaWorld));
+        	this->map.update_cell_value(i,j,this->sonarRight.compute_probability_t(rightMm/10,xWorldCell,yWorldCell,this->xWorld,this->yWorld,this->thetaWorld));
+        	this->map.update_cell_value(i,j,this->sonarLeft.compute_probability_t(leftMm/10,xWorldCell,yWorldCell,this->xWorld,this->yWorld,this->thetaWorld));
+        	this->map.update_cell_value(i,j,this->sonarFront.compute_probability_t(frontMm/10,xWorldCell,yWorldCell,this->xWorld,this->yWorld,this->thetaWorld));
 
        	}
     }