with class
Dependencies: ISR_Mini-explorer mbed
Fork of VirtualForces by
Diff: Sonar.hpp
- Revision:
- 36:b59d56d0b3b4
- Parent:
- 35:68f9edbb3cff
- Child:
- 37:b4c45e43ad29
diff -r 68f9edbb3cff -r b59d56d0b3b4 Sonar.hpp --- a/Sonar.hpp Sun Jun 11 22:40:37 2017 +0000 +++ b/Sonar.hpp Sun Jun 11 22:53:59 2017 +0000 @@ -5,7 +5,7 @@ class Sonar { -public: + public: float maxRange;//cm float minRange;//Rmin cm float incertitudeRange;//cm @@ -17,10 +17,10 @@ //the distance are in the world coordinates 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); - + + 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);