with class

Dependencies:   ISR_Mini-explorer mbed

Fork of VirtualForces by Georgios Tsamis

Revision:
33:814bcd7d3cfe
Child:
34:c208497dd079
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Sonar.hpp	Fri Jun 09 00:28:32 2017 +0000
@@ -0,0 +1,33 @@
+#ifndef SONAR_HPP
+#define SONAR_HPP
+
+#include "MiniExplorerCoimbra.hpp"
+
+class Sonar {
+
+public:
+	float maxRange;//cm
+	float minRange;//Rmin cm
+	float incertitudeRange;//cm
+	float angleRange;//Omega rad
+	float angleFromCenter;
+	float distanceX;
+	float distanceY;
+	
+
+	Sonar(float anlgeFromCenter, float distanceXRobot, float distanceYRobot );
+
+	//ODOMETRIA MUST HAVE BEEN CALLED
+	//function that check if a cell A(x,y) is in the range of the front sonar S(xs,ys) (with an angle depending on the sonar used, front 0, left pi/3, right -pi/3) returns the probability it's occupied/empty [0;1]
+	float compute_probability_t(float distanceObstacleDetected, float x, float y, float robotCoordinateXWorld, float robotCoordinateYWorld);
+
+	//returns the angle between the vectors (x,y) and (xs,ys)
+	float compute_angle_between_vectors(float x, float y,float xs,float ys);
+
+	//makes the angle inAngle between 0 and 2pi
+	float rad_angle_check(float inAngle);
+
+};
+
+#endif
+