Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Functions.cpp
- Revision:
- 9:76b59c5220f1
- Parent:
- 8:ad8766cf2ec0
- Child:
- 10:6c8ea68e9bac
--- a/Functions.cpp Tue May 11 15:05:49 2021 +0000 +++ b/Functions.cpp Tue May 11 17:53:17 2021 +0000 @@ -47,7 +47,7 @@ //if (r > min(z_max, z+alfa/2)) || (abs(phi-theta) > beta/2) //L = L0; - if ((z < z_max) && (abs(r-z_max) < alfa/2.0)) + if ((z < z_max) && (abs(r-z) < alfa/2.0)) L = Locc; else if (r <= z) L = Lfree; @@ -58,53 +58,3 @@ } -void bresenham(float poseX, float poseY, float xf, float yf, float z){ - int T, E, A, B; - int x = static_cast<int>(poseX); - int y = static_cast<int>(poseY); - int dx = static_cast<int>(abs(xf - poseX)); - int dy = static_cast<int>(abs(yf - poseY)); - - int s1 = static_cast<int>((xf - poseX)/dx); // substitui o sign() do matlab - int s2 = static_cast<int>((yf - poseY)/dy); - - int interchange = 0; - - if (dy > dx){ - T = dx; - dx = dy; - dy = T; - interchange = 1; - } - - E = 2*dy - dx; - A = 2*dy; - B = 2*dy - 2*dx; - - for (int i = 0; i<dx; i++){ - if (E < 0){ - if (interchange == 1){ - y = y + s2; - } - else{ - x = x + s1; - } - E = E + A; - } - - else{ - y = y + s2; - x = x + s1; - E = E + B; - } - - if (x >= 0 && y >= 0 && x < 40 && y < 40){ - // Mapear mapa do Logaritmo - MapaLog[x][y] = MapaLog[x][y] + Algorith_Inverse(poseX, poseY, x, y, z); - Mapa40[x][y] = 1 - 1/(1+exp(MapaLog[x][y])); - } - - - - } -}