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
Conversation
setXVIZConfig({DYNAMIC_STREAM_METADATA: true}); | ||
const {__metadata} = parseStreamVariable(testData, '/test', time); | ||
t.is(__metadata.category, 'VARIABLE', 'metadata generated'); | ||
|
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 scalar_type
be verified here?
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.
How does scalar_type
in metadata work when there are multiple types in this stream?
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.
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.
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 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.
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'd be fine with taking the type of the first entry. It is likely what we do elsewhere if necessary.
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.
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'} |
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.
polygon2d
is only xviz v1, not sure if this makes sense outside of v2. (v1 didn't have metadata)
DYNAMIC_STREAM_METADATA
to xviz config (defaultfalse
)