-
Notifications
You must be signed in to change notification settings - Fork 97
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
Implement HasTime for Frames [DEVINFRA-516] #1254
Conversation
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.
Seems good
One thing that bothers me a bit about this is that if you have for (frame, time) in Framer::new(...).with_rover_time() {
....
let msg = frame.to_sbp();
...
} you end up converting the frame twice.
would avoid that, but not sure what a clean way to do that is. maybe we could add a method to impl Framer {
pub fn with_messages(self) -> impl Iterator<Item=(Frame, Result<Sbp>)> {
self.map(|f| (f, f.to_sbp()))
}
} and then you can impl |
Let's track with an issue and revisit @adrian-kong |
Intended for
with_rover_time
, important to not do redundantto_sbp
calls after, so this just assumes that we want(Frame, Time)
since we cant easily convert from sbp -> frame,
or maybe alternatively we can retain frame and sbp.
This is so that we can do
Framer::new(...).with_rover_time()
for(Frame, Time)
tupleinstead of only
sbp::iter_messages(...).with_rover_time()
for(Sbp, Time)
tuple