-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add a frame_id field to LocationFix #108
Add a frame_id field to LocationFix #108
Conversation
The frame_id field for the LocationFix message specifies the frame for the origin of the sensor so the lat/lon values can be tied to a location on the robot.
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.
Wondering if this is the right way to add this? I think this might need a headerstamp to address a frameId at a specific header time as well, no?
Is there a reason we're doing it this way and not adding a new TransformWithLocationFix message?
Just trying to think about what usage would look like
Yea - we need to add a
What would this message be? To me the reason to go with this approach is that it uses the same pattern that other sensor data uses which is that there is a frame_id for the sensor and some message data tied to that frame. |
Ah yeah, that makes sense. I guess defining a new kind of transform message would make it harder to access this, so nevermind on that. Yeah, so all this needs really is the timestamp. |
I've added a timestamp. |
internal/schemas.ts
Outdated
"Frame for the sensor. Latitude and longitude readings are at the origin of the frame.", | ||
}, | ||
{ | ||
name: "timestamp", |
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.
nit: every other schema has timestamp
listed before frame_id
// Latitude in degrees | ||
double latitude = 1; | ||
double latitude = 3; |
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 know that it doesn't affect us directly due to mcap storing schemas in the file, but it seems against the spirit of protobuf to change these field identifiers right? It would break backwards compatibility for anyone trying to use new schemas to read old data?
Not sure if we have already made breaking changes like this before?
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.
If we wanted to solve this while still allowing the fields to appear in desired order (timestamp at the top), we might need to introduce some explicit protobuf field ID into schemas.ts to manually assign these. I think it's only an issue for protobuf.
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.
@jtbandes Have we done anything like this yet?
@amacneil I think we roughly treat these schemas as a snapshot set of examples rather than "use these exactly for all possible use-cases you have". Maybe we should call out this nuance in protobuf more explicitly but I've never known this repo to have a goal of keeping things backwards compatible.
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.
Yeah we have, search for protobufFieldNumber
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 think we roughly treat these schemas as a snapshot set of examples rather than "use these exactly for all possible use-cases you have". Maybe we should call out this nuance in protobuf more explicitly but I've never known this repo to have a goal of keeping things backwards compatible.
Yeah agreed I don't think we explicitly make this promise. But it does seem a bit weird from a user's perspective for us to unnecessarily ship backwards-incompatible changes to the schema. So maybe we should make that promise going forward unless there is a particular change where that would be impossible. In this case looks like we just need to explicitly specify the numbers.
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.
Thanks for the tip on protobufFieldNumber
I've added that to LocationFix
to keep the existing field numbering unchanged.
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.
We should probably make a ticket for testing that we don't break protobuf field numbers when updating the schema if there isn't one already
The frame_id field for the LocationFix message specifies the frame for the origin of the sensor so the lat/lon values can be tied to a location on the robot.
Fixes: #100
Nothing in Studio uses this information yet but we can introduce this for folks that want to start recording it.