Skip to content

Commit

Permalink
ROS2 bridge: Fix detection of timestamps in PointCloud2
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jul 28, 2024
1 parent 3121823 commit 541218e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/source/doxygen-docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
\page changelog Change Log

# Version 2.13.5: UNRELEASED
- Changes in libraries:
- \ref mrpt_ros2bridge_grp:
- mrpt::ros2bridge::toROS() conversion from `PointCloud2` to mrpt::maps::CPointsMapXYZIRT: recognize timestamp field names `"t"` and `"timestamp"`, apart of `"time"`.
- Build system:
- This main MRPT repository is no longer directly built as a ROS package. Please, use the wrappers for better modularity:
- https://github.com/MRPT/mrpt_ros
Expand Down
3 changes: 3 additions & 0 deletions libs/ros2bridge/src/point_cloud2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ bool mrpt::ros2bridge::fromROS(const sensor_msgs::msg::PointCloud2& msg, CPoints
incompatible |= check_field(msg.fields[i], "z", &z_field);
incompatible |= check_field(msg.fields[i], "intensity", &i_field);
incompatible |= check_field(msg.fields[i], "ring", &r_field);

incompatible |= check_field(msg.fields[i], "timestamp", &t_field);
incompatible |= check_field(msg.fields[i], "time", &t_field);
incompatible |= check_field(msg.fields[i], "t", &t_field);
}

if (incompatible || (!x_field || !y_field || !z_field)) return false;
Expand Down

0 comments on commit 541218e

Please sign in to comment.