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

Generate JSON schema definitions for web clients #735

Merged
merged 11 commits into from
Oct 25, 2019

Conversation

silverjam
Copy link
Contributor

@silverjam silverjam commented Oct 2, 2019

To aide in building various web clients, generate JSON schema definitions to parse the output of sbp2json. This allows web clients (like the drive demo UI) to dispatch on the msg_type field in a JSON dictionary and build a fully native object using the JSON fields that are present.

For example, in JavaScript, something like this would be possible:

import { Convert, MsgVelNED} from "./SbpModule.ts";

const json = getJsonBlob();

if (json['msg_type'] === 529) {
    const msgVelNED = Convert.toMsgVelNED(json);
    // ... do stuff with msgVelNED
}

@silverjam silverjam changed the title Generate JSON schema definitions Generate JSON schema definitions for web clients Oct 2, 2019
Copy link
Contributor

@denniszollo denniszollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few very minor things, but very cool. We are now web 2.0 compatible.

Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
generator/sbpg/targets/jsonschema.py Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
@denniszollo
Copy link
Contributor

Can you add your note on the PR about the schema and how to use it to the javascript readme here: https://github.com/swift-nav/libsbp/blob/master/javascript/README.md too ?

Copy link
Contributor

@denniszollo denniszollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet!

@silverjam
Copy link
Contributor Author

merging, failure was an (errant) performance regression in python

@silverjam silverjam merged commit 4215e34 into master Oct 25, 2019
@silverjam silverjam deleted the silverjam/jsonschema branch October 25, 2019 21:19
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.

2 participants