File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1049,16 +1049,19 @@ namespace octomap {
1049
1049
if (depth == 0 )
1050
1050
depth = tree_depth;
1051
1051
1052
+ point3d pmin_clamped = this ->keyToCoord (this ->coordToKey (pmin, depth), depth);
1053
+ point3d pmax_clamped = this ->keyToCoord (this ->coordToKey (pmax, depth), depth);
1054
+
1052
1055
float diff[3 ];
1053
1056
unsigned int steps[3 ];
1054
1057
float step_size = this ->resolution * pow (2 , tree_depth-depth);
1055
1058
for (int i=0 ;i<3 ;++i) {
1056
- diff[i] = pmax (i) - pmin (i);
1059
+ diff[i] = pmax_clamped (i) - pmin_clamped (i);
1057
1060
steps[i] = floor (diff[i] / step_size);
1058
1061
// std::cout << "bbx " << i << " size: " << diff[i] << " " << steps[i] << " steps\n";
1059
1062
}
1060
1063
1061
- point3d p = pmin ;
1064
+ point3d p = pmin_clamped ;
1062
1065
NODE* res;
1063
1066
for (unsigned int x=0 ; x<steps[0 ]; ++x) {
1064
1067
p.x () += step_size;
@@ -1072,9 +1075,9 @@ namespace octomap {
1072
1075
node_centers.push_back (p);
1073
1076
}
1074
1077
}
1075
- p.z () = pmin .z ();
1078
+ p.z () = pmin_clamped .z ();
1076
1079
}
1077
- p.y () = pmin .y ();
1080
+ p.y () = pmin_clamped .y ();
1078
1081
}
1079
1082
}
1080
1083
You can’t perform that action at this time.
0 commit comments