with class

Dependencies:   ISR_Mini-explorer mbed

Fork of VirtualForces by Georgios Tsamis

Committer:
Ludwigfr
Date:
Sun Jun 11 22:53:59 2017 +0000
Revision:
36:b59d56d0b3b4
Parent:
35:68f9edbb3cff
Child:
37:b4c45e43ad29
moved some fct to private

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ludwigfr 33:814bcd7d3cfe 1 #ifndef SONAR_HPP
Ludwigfr 33:814bcd7d3cfe 2 #define SONAR_HPP
Ludwigfr 33:814bcd7d3cfe 3
Ludwigfr 34:c208497dd079 4 #include<math.h>
Ludwigfr 33:814bcd7d3cfe 5
Ludwigfr 33:814bcd7d3cfe 6 class Sonar {
Ludwigfr 33:814bcd7d3cfe 7
Ludwigfr 36:b59d56d0b3b4 8 public:
Ludwigfr 33:814bcd7d3cfe 9 float maxRange;//cm
Ludwigfr 33:814bcd7d3cfe 10 float minRange;//Rmin cm
Ludwigfr 33:814bcd7d3cfe 11 float incertitudeRange;//cm
Ludwigfr 33:814bcd7d3cfe 12 float angleRange;//Omega rad
Ludwigfr 33:814bcd7d3cfe 13 float angleFromCenter;
Ludwigfr 33:814bcd7d3cfe 14 float distanceX;
Ludwigfr 33:814bcd7d3cfe 15 float distanceY;
Ludwigfr 33:814bcd7d3cfe 16
Ludwigfr 35:68f9edbb3cff 17 //the distance are in the world coordinates
Ludwigfr 34:c208497dd079 18 Sonar(float anlgeFromCenter, float distanceXFromRobotCenter, float distanceYFromRobotCenter );
Ludwigfr 33:814bcd7d3cfe 19
Ludwigfr 34:c208497dd079 20 float compute_probability_t(float distanceObstacleDetected, float xCell, float yCell, float xRobotWorld, float yRobotWorld, float theta);
Ludwigfr 36:b59d56d0b3b4 21
Ludwigfr 36:b59d56d0b3b4 22 private:
Ludwigfr 36:b59d56d0b3b4 23
Ludwigfr 33:814bcd7d3cfe 24 //returns the angle between the vectors (x,y) and (xs,ys)
Ludwigfr 33:814bcd7d3cfe 25 float compute_angle_between_vectors(float x, float y,float xs,float ys);
Ludwigfr 33:814bcd7d3cfe 26
Ludwigfr 33:814bcd7d3cfe 27 //makes the angle inAngle between 0 and 2pi
Ludwigfr 33:814bcd7d3cfe 28 float rad_angle_check(float inAngle);
Ludwigfr 33:814bcd7d3cfe 29
Ludwigfr 33:814bcd7d3cfe 30 };
Ludwigfr 33:814bcd7d3cfe 31
Ludwigfr 33:814bcd7d3cfe 32 #endif
Ludwigfr 33:814bcd7d3cfe 33