MCPcopy Create free account
hub / github.com/KumarRobotics/sloam / _destaggerCloud

Method _destaggerCloud

sloam/src/segmentation/inference.cpp:200–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void Segmentation::_destaggerCloud(const Cloud::Ptr cloud, Cloud::Ptr& outCloud){
201 bool col_valid = true;
202
203 for(auto irow = 0; irow < _img_h; irow++){
204 for(auto icol = 0; icol < _img_w; icol++){
205 auto im_col = icol;
206 // Ouster data needs a shift every other row
207 if(irow % 2 == 0){
208 im_col += 32;
209 if(im_col < 0 || im_col > _img_w){
210 col_valid = false;
211 im_col = im_col % _img_w;
212 }
213 }
214
215 if(col_valid){
216 const auto& pt = cloud->points[irow * _img_w + icol];
217 auto& outPt = outCloud->points[irow * _img_w + im_col];
218 // const auto& pt = cloud->at(icol, irow);
219 // auto& outPt = outCloud->at(im_col, irow);
220 outPt.x = pt.x;
221 outPt.y = pt.y;
222 outPt.z = pt.z;
223 }
224
225 col_valid = true;
226 }
227 }
228}
229
230void Segmentation::maskCloud(const Cloud::Ptr cloud,
231 cv::Mat mask,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected