Skip to content

Commit

Permalink
Apply same fix from foxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Samahu committed Nov 22, 2023
1 parent e8c42c8 commit 27937c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog
=========

[unreleased]
============
* fix: LaserScan is not properly aligned with generated point cloud

ouster_ros v0.12.0
==================
* [BREAKING]: updated ouster_client to the release of ``20231031`` [v0.10.0]; changes listed below.
Expand Down
2 changes: 1 addition & 1 deletion ouster-ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ouster_ros</name>
<version>0.12.0</version>
<version>0.12.1</version>
<description>Ouster ROS2 driver</description>
<maintainer email="[email protected]">ouster developers</maintainer>
<license file="LICENSE">BSD</license>
Expand Down
3 changes: 2 additions & 1 deletion ouster-ros/src/os_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ sensor_msgs::msg::LaserScan lidar_scan_to_laser_scan_msg(
msg.intensities.resize(ls.w);

for (auto v = 0; v < ls.w; ++v) {
auto v_shift = (ls.w / 2 - 1 - v - pixel_shift_by_row[ring]) % ls.w;
auto sign = v < ls.w / 2 ? -1 : +1;
auto v_shift = (ls.w / 2 - 1 - v + sign * 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 27937c9

Please sign in to comment.