Skip to content

Commit f47dab6

Browse files
authored
Group non-Unix epoch ROS 2 messages on a shared timeline (#11218)
1 parent 80cafc4 commit f47dab6

File tree

16 files changed

+65
-48
lines changed

16 files changed

+65
-48
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:b8ea1193dfe8e86ddd32a7c5926dcb7af876b31f7a1905f205c9e6549b14c394
3+
size 12

crates/store/re_data_loader/tests/snapshots/test.snap.new

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:a5007101f4ae92b50171c12aed1b51ceb482503aade827248c8d8c8fabb146f4
3-
size 442998
2+
oid sha256:9edae2d9c157373606a3909fccc9ad3dca5c4f829c0b9e8a3a3f74594c9fdc8e
3+
size 443218

crates/utils/re_mcap/src/layers/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ impl McapChunkDecoder {
118118

119119
let channel = msg.channel.as_ref();
120120
let channel_id = ChannelId(channel.id);
121-
let log_time_cell = crate::util::TimestampCell::guess_from_nanos(msg.log_time, "log_time");
122-
let publish_time_cell =
123-
crate::util::TimestampCell::guess_from_nanos(msg.publish_time, "publish_time");
121+
let log_time_cell = crate::util::TimestampCell::guess_from_nanos(msg.log_time);
122+
let publish_time_cell = crate::util::TimestampCell::guess_from_nanos(msg.publish_time);
124123
let timepoint = re_chunk::TimePoint::from([
125124
("log_time", log_time_cell.into_time_cell()),
126125
("publish_time", publish_time_cell.into_time_cell()),

crates/utils/re_mcap/src/parsers/ros2msg/rcl_interfaces/log.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ impl MessageParser for LogMessageParser {
8383
.context("Failed to decode `rcl_interfaces::Log` message from CDR data")?;
8484

8585
// add the sensor timestamp to the context, `log_time` and `publish_time` are added automatically
86-
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos(
86+
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos_ros2(
8787
stamp.as_nanos() as u64,
88-
msg.channel.topic.clone(),
8988
));
9089

9190
self.text_entries.push(format!("[{name}] {log_msg}"));

crates/utils/re_mcap/src/parsers/ros2msg/scalar_parser.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ impl<T: ScalarExtractor> MessageParser for ScalarMessageParser<T> {
8686
})?;
8787

8888
// Add the sensor timestamp to the context, `log_time` and `publish_time` are added automatically
89-
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos(
89+
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos_ros2(
9090
message.header().stamp.as_nanos() as u64,
91-
msg.channel.topic.clone(),
9291
));
9392

9493
let scalar_values = message.extract_scalars();

crates/utils/re_mcap/src/parsers/ros2msg/sensor_msgs/camera_info.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ impl MessageParser for CameraInfoMessageParser {
9999
} = cdr::try_decode_message::<sensor_msgs::CameraInfo>(&msg.data)?;
100100

101101
// add the sensor timestamp to the context, `log_time` and `publish_time` are added automatically
102-
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos(
102+
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos_ros2(
103103
header.stamp.as_nanos() as u64,
104-
msg.channel.topic.clone(),
105104
));
106105

107106
self.distortion_models

crates/utils/re_mcap/src/parsers/ros2msg/sensor_msgs/compressed_image.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ impl MessageParser for CompressedImageMessageParser {
5151
} = cdr::try_decode_message::<sensor_msgs::CompressedImage<'_>>(&msg.data)?;
5252

5353
// add the sensor timestamp to the context, `log_time` and `publish_time` are added automatically
54-
ctx.add_timestamp_cell(TimestampCell::guess_from_nanos(
54+
ctx.add_timestamp_cell(TimestampCell::guess_from_nanos_ros2(
5555
header.stamp.as_nanos() as u64,
56-
msg.channel.topic.clone(),
5756
));
5857

5958
self.blobs.push(data.into_owned());

crates/utils/re_mcap/src/parsers/ros2msg/sensor_msgs/image.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ impl MessageParser for ImageMessageParser {
7575
.context("Failed to decode sensor_msgs::Image message from CDR data")?;
7676

7777
// add the sensor timestamp to the context, `log_time` and `publish_time` are added automatically
78-
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos(
78+
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos_ros2(
7979
header.stamp.as_nanos() as u64,
80-
msg.channel.topic.clone(),
8180
));
8281

8382
let dimensions = [width, height];

crates/utils/re_mcap/src/parsers/ros2msg/sensor_msgs/imu.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ impl MessageParser for ImuMessageParser {
7474
.map_err(|err| Error::Other(anyhow::anyhow!(err)))?;
7575

7676
// add the sensor timestamp to the context, `log_time` and `publish_time` are added automatically
77-
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos(
77+
ctx.add_timestamp_cell(crate::util::TimestampCell::guess_from_nanos_ros2(
7878
imu.header.stamp.as_nanos() as u64,
79-
msg.channel.topic.clone(),
8079
));
8180

8281
self.orientation.values().append_slice(&[

0 commit comments

Comments
 (0)