Skip to content

Commit

Permalink
When doing a shallow copy of the pointcloud ensure to set the cellsiz…
Browse files Browse the repository at this point in the history
…e in the copy. Closes #11.
  • Loading branch information
jackjansen committed Oct 13, 2021
1 parent 3b43f5a commit 9df6210
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cwipc_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class cwipc_encoder_impl : public cwipc_encoder
else {
// Make shallow clone of pc
newpc = cwipc_from_pcl(pc->access_pcl_pointcloud(), pc->timestamp(), nullptr, CWIPC_API_VERSION);
newpc->_set_cellsize(pc->cellsize());
}
pc = nullptr; // Ensure we don't access this anymore.
m_queue_encoder.enqueue(newpc);
Expand Down Expand Up @@ -303,6 +304,7 @@ class cwipc_encodergroup_impl : public cwipc_encodergroup
} else {
// Make shallow clone of pc
newpc = cwipc_from_pcl(pc->access_pcl_pointcloud(), pc->timestamp(), nullptr, CWIPC_API_VERSION);
newpc->_set_cellsize(pc->cellsize());
}
pc = nullptr; // Ensure we don't access this anymore.

Expand Down

0 comments on commit 9df6210

Please sign in to comment.