-
Notifications
You must be signed in to change notification settings - Fork 62
Change to std::get_if for gz::rendering::Variant for throwless behaviour #1124
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
Conversation
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 good, just minor style comments
|
884822b
to
459c5b7
Compare
hey Ian, I think while I was signing off the DCO, the commits of other contributors have also been included. Is there any way to resolve that? This is my first PR so I am quite unsure and I believe I messed up. |
459c5b7
to
b7973e1
Compare
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.
@dheerubhai-101 you closed the PR, are you planning to reopen it again ?
Hi @ahcorde yes, I will reopen the PR today. The PR included the commits you made when I pulled and rebased, with my sign off on other contributers commits. I unexpectedly closed the PR while fixing it. I will resubmit the changes soon |
917f5f2
to
7568e54
Compare
you changes look good, Like you mentioned, you signed off commits from other authors. I still see this. Are you able to fix them? You can do a rebase and take only your commits and rebase them on the |
Signed-off-by: kurohane <[email protected]>
Signed-off-by: kurohane <[email protected]>
Signed-off-by: kurohane <[email protected]>
Signed-off-by: kurohane <[email protected]>
6b700e9
to
159ccd7
Compare
hi Ian, rebased it as you said. It only includes my commits now. Thanks for the help man |
great, thanks for the contribution! |
🦟 Bug fix
Fixes #516
Summary
Use of std::get for gz::rendering::Variant throws exceptions whenever it is interpreted as the wrong type. Non-critical exceptions when working Gazebo can cause lead to cumbersome debugging. So the code has been changed to use std::get_if for a softer error handling when encountering wrong Variant type.
Two things have been changed
try
catch
withstd::get
changed tostd::get_if
inogre/src/OgreThermalCamera.cc
,ogre2/src/Ogre2BoundingBoxMaterialSwitcher.cc
andogre2/src/Ogre2SegmentationMaterialSwitcher.cc
std::holds_alternative
nested withstd::get
changed to use onlystd::get_if
for simpler value access inogre2/src/Ogre2GpuRays.cc
andogre2/src/Ogre2ThermalCamera.cc
The following tests FAILED:
due to the bug pointed out by @j-rivero.
Reason:
Error while loading the library [/gz_ws/install/lib/gz-rendering-9/engine-plugins/libgz-rendering-ogre2.so]: /gz_ws/install/lib/gz-rendering-9/engine-plugins/libgz-rendering-ogre2.so: undefined symbol: _ZThn944_N4Ogre7HlmsPbs19_changeRenderSystemEPNS_12RenderSystemE
Will need your help to test it properly.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.