Skip to content
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

Merged
merged 1 commit into from
Jul 25, 2019
Merged

Conversation

twojtasz
Copy link
Contributor

Add the option --protobuf which will output the #-frame.pbe formatted XVIZ Messages.

@twojtasz twojtasz requested a review from jlisee July 17, 2019 23:48
Copy link
Contributor

@jlisee jlisee left a 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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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 = {
Copy link
Contributor

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?

Copy link
Contributor Author

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

@twojtasz twojtasz changed the base branch from master to tpw/add-protobuf-support July 25, 2019 00:00
@twojtasz
Copy link
Contributor Author

sorry, the base branch to merge into was master instead of #499. Fixed, now this properly only shows 2 files difference.

@twojtasz twojtasz changed the base branch from tpw/add-protobuf-support to master July 25, 2019 00:43
@twojtasz twojtasz force-pushed the tpw/kitti-pb-support branch from 7bc4f77 to 5678656 Compare July 25, 2019 00:47
@twojtasz twojtasz merged commit bd7cc81 into master Jul 25, 2019
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 63.294% when pulling 5678656 on tpw/kitti-pb-support into 575b053 on master.

@twojtasz twojtasz deleted the tpw/kitti-pb-support branch September 5, 2019 05:14
alexhaislip pushed a commit to Smart-Ag/xviz that referenced this pull request Aug 2, 2021
Add the option --protobuf which will output the #-frame.pbe formatted XVIZ Messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants