MCPcopy Create free account
hub / github.com/OctoMap/octomap / crop

Method crop

octomap/src/Pointcloud.cpp:162–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160
161
162 void Pointcloud::crop(point3d lowerBound, point3d upperBound) {
163
164 Pointcloud result;
165
166 float min_x, min_y, min_z;
167 float max_x, max_y, max_z;
168 float x,y,z;
169
170 min_x = lowerBound(0); min_y = lowerBound(1); min_z = lowerBound(2);
171 max_x = upperBound(0); max_y = upperBound(1); max_z = upperBound(2);
172
173 for (Pointcloud::const_iterator it=begin(); it!=end(); it++) {
174 x = (*it)(0);
175 y = (*it)(1);
176 z = (*it)(2);
177
178 if ( (x >= min_x) &&
179 (y >= min_y) &&
180 (z >= min_z) &&
181 (x <= max_x) &&
182 (y <= max_y) &&
183 (z <= max_z) ) {
184 result.push_back (x,y,z);
185 }
186 } // end for points
187
188 this->clear();
189 this->push_back(result);
190
191 }
192
193
194 void Pointcloud::minDist(double thres) {

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.95
clearMethod · 0.95

Tested by

no test coverage detected