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

Support dynamic stream metadata #493

Merged
merged 5 commits into from Jul 9, 2019
Merged

Support dynamic stream metadata #493

merged 5 commits into from Jul 9, 2019

Conversation

Pessimistress
Copy link
Contributor

@Pessimistress Pessimistress commented Jul 8, 2019

  • Add DYNAMIC_STREAM_METADATA to xviz config (default false)

@coveralls
Copy link

coveralls commented Jul 8, 2019

Coverage Status

Coverage increased (+0.05%) to 74.597% when pulling cc344fa on x/no-metadata into 66b5d2d on master.

setXVIZConfig({DYNAMIC_STREAM_METADATA: true});
const {__metadata} = parseStreamVariable(testData, '/test', time);
t.is(__metadata.category, 'VARIABLE', 'metadata generated');

Copy link
Contributor

Choose a reason for hiding this comment

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

Should scalar_type be verified here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does scalar_type in metadata work when there are multiple types in this stream?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally there shouldn't be.

The intention was that the multiple elements only really make sense if you assign an object_id so you can associate the values with something meaningful (if they share the stream id like /object/speed_prediction)
Otherwise I don't know how you interpret or use the elements, like if I have /object/velocity_prediction with multiple entries but w/o an object_id for each one, I don't know how to make sense of the data then.

The same issue fundamentally happens with primitives in that we assume each primitive is of a single primitive_type. Like you can't have /object/ufo as both circles and polygons. It doesn't look like the Schema enforces this restriction, but i'm pretty sure our code won't really handle them right.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am saying, either the relationship is implicit, and the variable would have only 1 entry, or it must be explicit with an object_id and multiple entries. Otherwise it is hard to see how the data is useful.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be fine with taking the type of the first entry. It is likely what we do elsewhere if necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like getVariableData() returns the first entry if finds too

@@ -314,7 +335,8 @@ tape('parseXVIZStream#primitive no-data entries', t => {
pointCloud: null,
images: [],
components: [],
time: 100.5425
time: 100.5425,
__metadata: {category: 'PRIMITIVE', primitive_type: 'polygon2d'}
Copy link
Contributor

Choose a reason for hiding this comment

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

polygon2d is only xviz v1, not sure if this makes sense outside of v2. (v1 didn't have metadata)

@Pessimistress Pessimistress merged commit 2c9d3aa into master Jul 9, 2019
@Pessimistress Pessimistress deleted the x/no-metadata branch July 9, 2019 19:25
alexhaislip pushed a commit to Smart-Ag/xviz that referenced this pull request Aug 2, 2021
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.

None yet

3 participants