Skip to content

Commit

Permalink
perf(image_projection_based_fusion): replace std::bitset (autowarefou…
Browse files Browse the repository at this point in the history
  • Loading branch information
wep21 authored and takayuki5168 committed Nov 22, 2023
1 parent 6c2d806 commit 691ab78
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ std::size_t VoxelGenerator::pointsToVoxels(
point[2] = point_current.z();
point[3] = time_lag;
// decode the class value back to one-hot binary and assign it to point
for (std::size_t i = 1; i <= config_.class_size_; i++) {
auto decode = std::bitset<8>(*class_iter).to_string();
point[3 + i] = decode[-i] == 1 ? 1 : 0;
std::fill(point.begin() + 4, point.end(), 0);
auto class_value = static_cast<int>(*class_iter);
auto iter = point.begin() + 4;
while (class_value > 0) {
*iter = class_value % 2;
class_value /= 2;
++iter;
}

out_of_range = false;
Expand Down

0 comments on commit 691ab78

Please sign in to comment.