Navigate to a given point using the OGM and virtual forces
Dependencies: ISR_Mini-explorer mbed
Fork of VirtualForces by
Diff: main.cpp
- Revision:
- 10:a7fd80e79e80
- Parent:
- 9:b7138acdf4ac
diff -r b7138acdf4ac -r a7fd80e79e80 main.cpp --- a/main.cpp Mon Mar 27 16:26:41 2017 +0000 +++ b/main.cpp Mon Mar 27 16:31:41 2017 +0000 @@ -5,7 +5,7 @@ Timer t; float dist(float robot_x, float robot_y, float target_x, float target_y); -int goToPointWithAngle(float target_x, float target_y, float target_angle, int theta); +int goToPointWithAngle(float target_x, float target_y, float target_angle); float alpha; //angle error float rho; //distance from target @@ -18,6 +18,8 @@ float temp; float d2; +float map[40][40]; + //Diameter of a wheel and distance between the 2 float r=3.25, b=7.2; @@ -57,7 +59,7 @@ return sqrt(pow(target_y-robot_y,2) + pow(target_x-robot_x,2)); } -int goToPointWithAngle(float target_x, float target_y, float target_angle, int theta) { +int goToPointWithAngle(float target_x, float target_y, float target_angle) { do { pc.printf("\n\n\r entered while");