with class

Dependencies:   ISR_Mini-explorer mbed

Fork of VirtualForces by Georgios Tsamis

Revision:
38:5ed7c79fb724
Parent:
37:b4c45e43ad29
--- a/Sonar.hpp	Sun Jun 11 23:22:28 2017 +0000
+++ b/Sonar.hpp	Thu Jun 15 23:17:55 2017 +0000
@@ -10,15 +10,18 @@
 	float minRange;//Rmin cm
 	float incertitudeRange;//cm
 	float angleRange;//Omega rad
-	float angleFromOrigin;
+	float angleFromCenter;
 	float distanceX;
 	float distanceY;
 	
 	//the distance are in the world coordinates
-	Sonar(float angleFromOrigin, float distanceXFromRobotCenter, float distanceYFromRobotCenter );
+	Sonar(float angleFromCenter, float distanceXFromRobotCenter, float distanceYFromRobotCenter );
 
 	float compute_probability_t(float distanceObstacleDetected, float xCell, float yCell, float xRobotWorld, float yRobotWorld, float theta);
 	
+	//return distance sonar to cell if in range, -1 if not
+	float isInRange(float xCell, float yCell, float xRobotWorld, float yRobotWorld, float thetaWorld);
+	
 	private:
 	
 	//returns the angle between the vectors (x,y) and (xs,ys)