Skip to content

rs2_get_video_stream_intrinsics no longer reports errors if not intrinsics available - #13004

Merged
maloel merged 3 commits into
realsenseai:developmentfrom
maloel:expected-exception
Jun 9, 2024
Merged

rs2_get_video_stream_intrinsics no longer reports errors if not intrinsics available#13004
maloel merged 3 commits into
realsenseai:developmentfrom
maloel:expected-exception

Conversation

@maloel

@maloel maloel commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

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

maloel commented Jun 5, 2024

Copy link
Copy Markdown
Contributor Author

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

@remibettan remibettan left a comment

Copy link
Copy Markdown
Contributor

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 realsenseai:development Jun 9, 2024
@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