From a230a4f4a418fe0a5989f0be4f9b238d23a57c4d Mon Sep 17 00:00:00 2001 From: Timothy Wiley Date: Sun, 30 Apr 2017 13:59:29 +1000 Subject: [PATCH] crosbot_fastslam: deprecate un-used function, and more code cleanup --- .../include/crosbot_fastslam/heightmap.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crosbot_fastslam/include/crosbot_fastslam/heightmap.hpp b/crosbot_fastslam/include/crosbot_fastslam/heightmap.hpp index 2b3f3ce..c2a0c8d 100644 --- a/crosbot_fastslam/include/crosbot_fastslam/heightmap.hpp +++ b/crosbot_fastslam/include/crosbot_fastslam/heightmap.hpp @@ -138,7 +138,7 @@ public: // checks if a location is in this patch // NOTE: this function isn't currently used since it's more efficient not to make invalid calls // This means it hasn't been tested in use - inline bool checkWithinMap(float x, float y) { + inline bool checkWithinMap(float x, float y) __attribute__ ((deprecated)) { if ((x < xOrig) || (x >= (xOrig + width)) || (y < yOrig) || (y >= (yOrig + height))) { return false; } @@ -163,7 +163,8 @@ class HeightMultiMap : public HandledObject { public: struct SearchConstraints { public: - double maxDist, fov; + double maxDist; + double fov; Pose2D sensor; SearchConstraints() : maxDist(-1), fov(0), sensor(NAN, NAN, NAN) {} @@ -252,7 +253,9 @@ public: rval = patches[i][j]; if (rval == NULL) { - if (!create) return rval; + if (!create) { + return rval; + } // just create an empty map rval = newMap(i, j); patches[i][j] = rval; @@ -270,7 +273,8 @@ public: // returns the row (i) and column (j) of the heightmap containing x, y inline void getIJ(float x, float y, unsigned int &i, unsigned int &j) { // note: assumes the submaps are using SUB_WIDTH and SUB_HEIGHT - double ti, tj; + double ti; + double tj; tj = x - offsetX; ti = y - offsetY; @@ -284,10 +288,12 @@ public: j = (int) floor(tj); i = (int) floor(ti); - if (j == __UINT32_MAX__) + if (j == __UINT32_MAX__) { j = 0; - if (i == __UINT32_MAX__) + } + if (i == __UINT32_MAX__) { i = 0; + } } // checks if i,j is a valid heightmap -- GitLab