-
Notifications
You must be signed in to change notification settings - Fork 231
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 protobuf support to KITTI example #499
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.
This looks good but I think it shares the same content with #500?
let pbType = XVIZ_PROTOBUF_MESSAGE.StateUpdate; | ||
let pbMsg = pbType.fromObject(pbJSON); | ||
|
||
if (this.options.envelope) { |
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.
This enveloping looks like it should be in a helper function since it's used below too and a bit complex.
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.
Done
// 2-frame is where the actual XVIZ updates begin | ||
const messageName = index => `${index + 2}-frame`; | ||
|
||
export class XVIZProtobufWriter extends XVIZBaseWriter { |
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.
Is the message timing bits here protobuf specific, or could it be in the base class?
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.
You are correct, it is shared. But I will address this in a separate PR
return color; | ||
} | ||
|
||
// Recursively walk object performing the following conversions |
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.
Maybe explain what this is converting the protobuf into, I think it's the JSON format right?
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.
Actually, its the JSON format from builder works for other encodings but Protobuf is more strict (doesn't not support variants such as fields with both string and array values in JSON). So this normalize for protobuf encoding, which is what I'll explain in the comment.
// | ||
// Test data and cases for successful writer tests | ||
// | ||
const SAMPLE_METADATA = { |
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.
Should this test include things we are having enum trouble with?
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.
The enum's issue is covered in parsing related tests in #503
sorry, the base branch to merge into was master instead of #499. Fixed, now this properly only shows 2 files difference. |
7bc4f77
to
5678656
Compare
Add the option --protobuf which will output the #-frame.pbe formatted XVIZ Messages.
Add the option
--protobuf
which will output the#-frame.pbe
formatted XVIZ Messages.