-
Notifications
You must be signed in to change notification settings - Fork 539
Add MCAP parsers for scalar sensor messages #11078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
3ee781b
to
6bf6944
Compare
6bf6944
to
ea1909e
Compare
/// | ||
/// 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)>; |
There was a problem hiding this comment.
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. :)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related
What
This adds a generic
ScalarMessageParser
which supports ROS2 messages that implement a newScalarExtractor
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