![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
test morning
Dependencies: ISR_Mini-explorer mbed
Fork of roboticLab_withclass_3_July by
Sonar.hpp@14:696187e74411, 2017-07-12 (annotated)
- Committer:
- Ludwigfr
- Date:
- Wed Jul 12 18:08:07 2017 +0000
- Revision:
- 14:696187e74411
- Parent:
- 3:37345c109dfc
lol
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Ludwigfr | 0:9f7ee7ed13e4 | 1 | #ifndef SONAR_HPP |
Ludwigfr | 0:9f7ee7ed13e4 | 2 | #define SONAR_HPP |
Ludwigfr | 0:9f7ee7ed13e4 | 3 | |
Ludwigfr | 0:9f7ee7ed13e4 | 4 | #include<math.h> |
Ludwigfr | 0:9f7ee7ed13e4 | 5 | |
Ludwigfr | 0:9f7ee7ed13e4 | 6 | class Sonar { |
Ludwigfr | 0:9f7ee7ed13e4 | 7 | |
Ludwigfr | 0:9f7ee7ed13e4 | 8 | public: |
Ludwigfr | 0:9f7ee7ed13e4 | 9 | float maxRange;//cm |
Ludwigfr | 0:9f7ee7ed13e4 | 10 | float minRange;//Rmin cm |
Ludwigfr | 0:9f7ee7ed13e4 | 11 | float incertitudeRange;//cm |
Ludwigfr | 0:9f7ee7ed13e4 | 12 | float angleRange;//Omega rad |
Ludwigfr | 0:9f7ee7ed13e4 | 13 | float angleFromCenter; |
Ludwigfr | 0:9f7ee7ed13e4 | 14 | float distanceX; |
Ludwigfr | 0:9f7ee7ed13e4 | 15 | float distanceY; |
Ludwigfr | 0:9f7ee7ed13e4 | 16 | |
Ludwigfr | 0:9f7ee7ed13e4 | 17 | //the distance are in the world coordinates |
Ludwigfr | 0:9f7ee7ed13e4 | 18 | Sonar(float angleFromCenter, float distanceXFromRobotCenter, float distanceYFromRobotCenter ); |
Ludwigfr | 3:37345c109dfc | 19 | |
Ludwigfr | 3:37345c109dfc | 20 | void setMaxRange(float newMaxRange); |
Ludwigfr | 3:37345c109dfc | 21 | |
Ludwigfr | 0:9f7ee7ed13e4 | 22 | float compute_probability_t(float distanceObstacleDetected, float xCell, float yCell, float xRobotWorld, float yRobotWorld, float theta); |
Ludwigfr | 0:9f7ee7ed13e4 | 23 | |
Ludwigfr | 0:9f7ee7ed13e4 | 24 | //return distance sonar to cell if in range, -1 if not |
Ludwigfr | 0:9f7ee7ed13e4 | 25 | float isInRange(float xCell, float yCell, float xRobotWorld, float yRobotWorld, float thetaWorld); |
Ludwigfr | 0:9f7ee7ed13e4 | 26 | |
Ludwigfr | 0:9f7ee7ed13e4 | 27 | private: |
Ludwigfr | 0:9f7ee7ed13e4 | 28 | |
Ludwigfr | 0:9f7ee7ed13e4 | 29 | //returns the angle between the vectors (x,y) and (xs,ys) |
Ludwigfr | 0:9f7ee7ed13e4 | 30 | float compute_angle_between_vectors(float x, float y,float xs,float ys); |
Ludwigfr | 0:9f7ee7ed13e4 | 31 | |
Ludwigfr | 0:9f7ee7ed13e4 | 32 | //makes the angle inAngle between 0 and 2pi |
Ludwigfr | 0:9f7ee7ed13e4 | 33 | float rad_angle_check(float inAngle); |
Ludwigfr | 0:9f7ee7ed13e4 | 34 | |
Ludwigfr | 0:9f7ee7ed13e4 | 35 | }; |
Ludwigfr | 0:9f7ee7ed13e4 | 36 | |
Ludwigfr | 0:9f7ee7ed13e4 | 37 | #endif |
Ludwigfr | 0:9f7ee7ed13e4 | 38 |