Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

oxkitsune
Copy link
Member

Related

What

This adds a generic ScalarMessageParser which supports ROS2 messages that implement a new ScalarExtractor trait. This generic parser is then used for the following ROS2 messages that contain simple scalar values:

  • sensor_msgs/msg/Temperature
  • sensor_msgs/msg/FluidPressure
  • sensor_msgs/msg/RelativeHumidity
  • sensor_msgs/msg/Illuminance
  • sensor_msgs/msg/Range
  • sensor_msgs/msg/BatteryState

@oxkitsune oxkitsune added 📺 re_viewer affects re_viewer itself include in changelog 🧢 MCAP Everything related to the MCAP support labels Sep 2, 2025
Copy link

github-actions bot commented Sep 2, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
ea1909e https://rerun.io/viewer/pr/11078 +nightly +main

Note: This comment is updated whenever you push a commit.

///
/// Returns a vector of (`field_name`, `value`) pairs where `field_name` is used
/// for labeling in the visualization and `value` is the scalar measurement.
fn extract_scalars(&self) -> Vec<(&str, f64)>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A default implementation would be nice. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to have a default implementation for that function, as each struct should implement it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean there are structs that could utilize a serde-based field enumeration. But it's probably overkill.

Copy link
Member

@aedm aedm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oxkitsune oxkitsune merged commit 6b9ec11 into main Sep 5, 2025
40 checks passed
@oxkitsune oxkitsune deleted the gijs/scalar-parser branch September 5, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 🧢 MCAP Everything related to the MCAP support 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants