Skip to content

Commit 4f4ca9c

Browse files
xmfcxPunitKVerma
andauthored
Keep humble compatibility with send_timestamp in dataload_ros2.cpp (#97)
* Update dataload_ros2.cpp while building it shows that send_timestamp has no member named. it replaced by the time_stamp which is the member of SerializedBagMessage struct. * keep jazzy compatibility Signed-off-by: M. Fatih Cırıt <mfc@autoware.org> --------- Signed-off-by: M. Fatih Cırıt <mfc@autoware.org> Co-authored-by: PunitKVerma <155130932+PunitKVerma@users.noreply.github.com>
1 parent 2865020 commit 4f4ca9c

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ elseif(COMPILING_WITH_AMENT)
9898

9999
if("$ENV{ROS_DISTRO}" STREQUAL "humble")
100100
message(STATUS "Detected Humble")
101+
target_compile_definitions(DataLoadROS2 PUBLIC ROS_HUMBLE)
101102
target_compile_definitions(TopicPublisherROS2 PUBLIC ROS_HUMBLE)
102103
endif()
103104
endif()

src/DataLoadROS2/dataload_ros2.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@ bool DataLoadROS2::readDataFromFile(PJ::FileLoadInfo* info,
193193
{
194194
continue;
195195
}
196+
197+
#ifdef ROS_HUMBLE
198+
const double msg_timestamp = 1e-9 * double(msg->time_stamp); // nanoseconds to seconds
199+
#else
200+
// from jazzy and later
196201
const double msg_timestamp = 1e-9 * double(msg->send_timestamp); // nanoseconds to seconds
202+
#endif
197203

198204
//------ progress dialog --------------
199205
if (msg_count++ % 100 == 0)

0 commit comments

Comments
 (0)