Skip to content

Commit

Permalink
Remove unnecessary sign swtiching
Browse files Browse the repository at this point in the history
  • Loading branch information
Samahu committed Sep 8, 2023
1 parent a534eae commit 5130793
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ouster-ros/src/os_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,7 @@ sensor_msgs::msg::LaserScan lidar_scan_to_laser_scan_msg(
msg.intensities.resize(ls.w);

for (auto v = 0; v < ls.w; ++v) {
auto idx = ls.w / 2 - 1 - v;
auto sign = v < ls.w / 2 ? +1 : -1;
auto v_shift = (idx - sign * pixel_shift_by_row[ring]) % ls.w;
auto v_shift = (ls.w / 2 - 1 - v - pixel_shift_by_row[ring]) % ls.w;
auto src_idx = ring * ls.w + v_shift;
msg.ranges[v] = rg[src_idx] * ouster::sensor::range_unit;
msg.intensities[v] = static_cast<float>(sg[src_idx]);
Expand Down

0 comments on commit 5130793

Please sign in to comment.