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

Fix metadata #11567

Merged
merged 6 commits into from
Mar 19, 2023
Merged

Fix metadata #11567

merged 6 commits into from
Mar 19, 2023

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Mar 15, 2023

So it turns out that we cannot count on sensor-based parsers to keep validity of frame-based metadata (obviously), which is what happened after #11551.
So this brings in the validity back into the metadata_blob. It's still all array-based and fast, at the cost of a slightly bigger blob.
Add unit-tests for it. The last test failed before the fix; now passes.

@maloel maloel requested a review from OhadMeir March 15, 2023 11:19
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good. Can add a test setting multiple fields, say 5.
And a test that opens multiple sensors setting different values and verifying no problems from the shared parsers.

Later on when we will use erase or clear (in the DDS) we should also verify that erasing in one sensor does not affect the other sensor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can add a test setting multiple fields, say 5.
And a test that opens multiple sensors setting different values and verifying no problems from the shared parsers.

You want these in this PR?

Later on when we will use erase or clear (in the DDS) we should also verify that erasing in one sensor does not affect the other sensor.

That's assuming we'll add an API to erase metadata :) so should be part of the task that does that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can add a test setting multiple fields, say 5.
And a test that opens multiple sensors setting different values and verifying no problems from the shared parsers.

You want these in this PR?

Yes. We should validate 2 sensors don't interfere for this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See new commit.

w = 640
h = 480
bpp = 2 # bytes
pixels = bytearray( b'\x00' * ( w * h * 2 )) # Dummy data
Copy link
Contributor

Choose a reason for hiding this comment

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

better to use bpps value instead of 2. Does this support formats like Y8 or RGB8?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, but this was copy-paste from sw.py inside unit-tests/syncer/. It should be able to support any format (like the DDS frames) but right now no content is actually written there...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@maloel maloel requested a review from OhadMeir March 19, 2023 08:26
rgb.set( rs.frame_metadata_value.actual_fps, 0xf00d )
stereo.set( rs.frame_metadata_value.actual_fps, 0xbaad )
c1 = rgb.publish( color.frame() )
test.check_false( f1.supports_frame_metadata( rs.frame_metadata_value.actual_fps ))
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean d1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so...f1 is from one of the previous tests... :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@OhadMeir OhadMeir left a comment

Choose a reason for hiding this comment

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

LGTM

@maloel maloel merged commit 3aa0de8 into IntelRealSense:development Mar 19, 2023
@maloel maloel deleted the metadata branch March 19, 2023 09:49
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