with class

Dependencies:   ISR_Mini-explorer mbed

Fork of VirtualForces by Georgios Tsamis

Sonar.hpp

Committer:
Ludwigfr
Date:
2017-06-11
Revision:
37:b4c45e43ad29
Parent:
36:b59d56d0b3b4
Child:
38:5ed7c79fb724

File content as of revision 37:b4c45e43ad29:

#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 angleFromOrigin;
	float distanceX;
	float distanceY;
	
	//the distance are in the world coordinates
	Sonar(float angleFromOrigin, float distanceXFromRobotCenter, float distanceYFromRobotCenter );

	float compute_probability_t(float distanceObstacleDetected, float xCell, float yCell, float xRobotWorld, float yRobotWorld, float theta);
	
	private:
	
	//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