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

rs2_get_video_stream_intrinsics no longer reports errors if not intrinsics available #13004

Merged
merged 3 commits into from
Jun 9, 2024

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Jun 5, 2024

As of v2.55, we report errors (LOG_ERROR) if API calls fail.

rs-enumerate-devices -c goes through all profiles and tries to get their intrinsics using rs2_get_video_stream_intrinsics.
Some profiles have none, and so a not_implemented_exception is triggered, and thus causes error log messages that now come out.
Since this function has no return value, an error is the only valid way of reporting that no intrinsics exist. Adding a return value and not throwing is a change in behavior, which I didn't want to make. We can also add a new API, remove the errors completely, or change them to debug...

Instead, I marked a not_implemented_exception as an "expected exception" in the code so it behaves the same but without an error.

See below: I also improved the errors given:

  • rs2_stream_profile arguments will actually show the profile
  • added output_arg( ... ) syntax, so an error would show them as (out)

Reported by CDE.
Tracked on [LRS-1130]

@maloel maloel requested a review from Nir-Az June 5, 2024 07:14
@maloel
Copy link
Collaborator Author

maloel commented Jun 5, 2024

I added other functionality:
The error (if it's given) was:

31/05 15:06:46,483 ERROR [140679837907008] (rs.cpp:255) [rs2_get_video_stream_intrinsics( from:0x56409a256170, intr:[ -50426192x32764 p[2.10195e-44 0] f[7.31541e+34 2.74886e+26] UNKNOWN [9.31105e-39 -4.90642e-27 4.58981e-41 -1.0574e+37 4.59121e-41] ] ) Not Implemented] No intrinsics are available for this stream profile!

And will now look like this:

 05/06 13:18:37,001 ERROR [19732] (rs.cpp:255) [rs2_get_video_stream_intrinsics( profile:[ IR Y16 1 1280x800 @ 25 ], intr:(out) ) Not Implemented] No intrinsics are available for this stream profile!

@Nir-Az Nir-Az requested review from remibettan and removed request for Nir-Az June 6, 2024 09:28
Copy link
Contributor

@remibettan remibettan left a comment

Choose a reason for hiding this comment

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

LGTM
A little worried by the fact it impacts the whole SDK, hopping it will not lead to any issue - I approve it because I could not figure any potential issue.

@maloel maloel merged commit 12ad6d5 into IntelRealSense:development Jun 9, 2024
17 of 18 checks passed
@maloel maloel deleted the expected-exception branch June 9, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants