with class

Dependencies:   ISR_Mini-explorer mbed

Fork of VirtualForces by Georgios Tsamis

Sonar.hpp

Committer:
Ludwigfr
Date:
2017-06-09
Revision:
33:814bcd7d3cfe
Child:
34:c208497dd079

File content as of revision 33:814bcd7d3cfe:

#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