with class
Dependencies: ISR_Mini-explorer mbed
Fork of VirtualForces by
Diff: Sonar.hpp
- Revision:
- 34:c208497dd079
- Parent:
- 33:814bcd7d3cfe
- Child:
- 35:68f9edbb3cff
--- a/Sonar.hpp Fri Jun 09 00:28:32 2017 +0000 +++ b/Sonar.hpp Fri Jun 09 14:30:21 2017 +0000 @@ -1,7 +1,7 @@ #ifndef SONAR_HPP #define SONAR_HPP -#include "MiniExplorerCoimbra.hpp" +#include<math.h> class Sonar { @@ -15,11 +15,11 @@ float distanceY; - Sonar(float anlgeFromCenter, float distanceXRobot, float distanceYRobot ); + 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 x, float y, float robotCoordinateXWorld, float robotCoordinateYWorld); + float compute_probability_t(float distanceObstacleDetected, float xCell, float yCell, float xRobotWorld, float yRobotWorld, float theta); //returns the angle between the vectors (x,y) and (xs,ys) float compute_angle_between_vectors(float x, float y,float xs,float ys);