test morning

Dependencies:   ISR_Mini-explorer mbed

Fork of roboticLab_withclass_3_July by Georgios Tsamis

Revision:
12:1e80471c5c6c
Parent:
3:37345c109dfc
Child:
13:b0ddd71e8f08
--- a/Sonar.cpp	Tue Jul 11 10:30:21 2017 +0000
+++ b/Sonar.cpp	Tue Jul 11 16:55:13 2017 +0000
@@ -19,8 +19,8 @@
 float Sonar::isInRange(float xCell, float yCell, float xRobotWorld, float yRobotWorld, float thetaWorld){
 	float xSonar=xRobotWorld+this->distanceX;
 	float ySonar=yRobotWorld+this->distanceY;	
-	float distanceCellToSonar=sqrt(pow(xCell-xSonar,2)+pow(yCell-ySonar,2));
-	
+	//float distanceCellToSonar=sqrt(pow(xCell-xSonar,2)+pow(yCell-ySonar,2));
+	float distanceCellToSonar=sqrt(pow(xSonar-xCell,2)+pow(ySonar-yCell,2));
 	//check if the distance between the cell and the robot is within the circle of range RADIUS_WHEELS
     if( distanceCellToSonar < this->maxRange){
         //float anglePointToSonar=this->compute_angle_between_vectors(xCell,yCell,xSonar,ySonar);//angle beetween the point and the sonar beam