gz-sim icon indicating copy to clipboard operation
gz-sim copied to clipboard

GUI for adjusting FOV

Open AzulRadio opened this issue 2 years ago • 6 comments

New feature

Add a GUI for adjusting FOV

Summary

image

Test it

Change value in horizontal_fov and the FOV of the scene should change as well.

Checklist

  • [x] Signed all commits for DCO
  • [x] Added tests
  • [ ] Added example and/or tutorial
  • [ ] Updated documentation (as needed)
  • [ ] Updated migration guide (as needed)
  • [ ] Consider updating Python bindings (if the library has them)
  • [ ] codecheck passed (See contributing)
  • [ ] All tests passed (See test coverage)
  • [ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

AzulRadio avatar May 18 '22 17:05 AzulRadio

Codecov Report

Merging #1499 (0ce21a7) into ign-gazebo6 (d6e69d0) will decrease coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head 0ce21a7 differs from pull request most recent head 113f1c7. Consider uploading reports for the commit 113f1c7 to get more accurate results

@@               Coverage Diff               @@
##           ign-gazebo6    #1499      +/-   ##
===============================================
- Coverage        64.02%   64.00%   -0.03%     
===============================================
  Files              317      317              
  Lines            25649    25649              
===============================================
- Hits             16422    16416       -6     
- Misses            9227     9233       +6     
Impacted Files Coverage Δ
src/Util.cc 92.53% <100.00%> (ø)
src/SimulationRunner.cc 90.93% <0.00%> (-0.96%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 44406a9...113f1c7. Read the comment docs.

codecov[bot] avatar May 18 '22 18:05 codecov[bot]

Thanks @ahcorde for taking a look. I was playing around during the sim meeting and in: https://github.com/gazebosim/gz-rendering/blob/1481bf8e2856a2e29fa2592bd4c32951e09166e9/ogre2/src/Ogre2Camera.cc#L79

If you change this->aspect to this->AspectRatio() the crash no longer happens for me but requires some more testing

jennuine avatar May 23 '22 18:05 jennuine

unfortunately there is another crash that occurs but it also occurs without this PR

I'm not able to reproduce the crash, I'm on Focal. But I got several error messages saying I was trying to set NaN node poses. I added more guards against NaNs in the following PR, maybe it helps with your crash?

  • https://github.com/gazebosim/gz-rendering/pull/655

chapulina avatar Jun 23 '22 22:06 chapulina

I added more guards against NaNs in the following PR, maybe it helps with your crash? https://github.com/gazebosim/gz-rendering/pull/655

Unfortunately, I'm still getting the crash on Focal and Bionic :confused:

jennuine avatar Jul 11 '22 18:07 jennuine

I'm still getting the crash on Focal and Bionic

I was able to reproduce the crash on Bionic. Then I built https://github.com/gazebo-forks/ogre-2.2-release from source into my workspace to debug further, and with the source build it doesn't crash anymore. Instead, I see lots of errors and warnings printed:

[GUI] [Err] [OrbitViewController.cc:140] Camera world position isn't finite [-nan -nan -nan]
...
[GUI] [Wrn] [Ogre2RayQuery.cc:89] Attempted to set non-finite origin from camera [scene::Camera(65527)]
[GUI] [Wrn] [Ogre2RayQuery.cc:100] Attempted to set non-finite direction from camera [scene::Camera(65527)]
...

So with that setup, I was able to fix the warnings with the following PR:

  • https://github.com/gazebosim/gz-rendering/pull/676

I'd appreciate it if someone could check if that solves the crashes for them.

chapulina avatar Jul 19 '22 23:07 chapulina

I'd appreciate it if someone could check if that solves the crashes for them.

Thanks for the attempt but unfortunately I'm still getting crashes :(

jennuine avatar Jul 20 '22 15:07 jennuine

Closing until https://github.com/gazebosim/gz-rendering/issues/710 is resolved

jennuine avatar Aug 22 '22 20:08 jennuine