with class

Dependencies:   ISR_Mini-explorer mbed

Fork of VirtualForces by Georgios Tsamis

Sonar.hpp

Committer:
Ludwigfr
Date:
2017-06-09
Revision:
34:c208497dd079
Parent:
33:814bcd7d3cfe
Child:
35:68f9edbb3cff

File content as of revision 34:c208497dd079:

#ifndef SONAR_HPP
#define SONAR_HPP

#include<math.h>

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 distanceXFromRobotCenter, float distanceYFromRobotCenter );

	//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 xCell, float yCell, float xRobotWorld, float yRobotWorld, float theta);

	//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