You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this is a GUI or sensor rendering bug, describe your GPU and rendering system. Otherwise delete this section.
Rendering plugin: Both ogre and ogre2
Description
Expected behavior: Camera::HFOV returns the current angle
Actual behavior: Always returns the initial angle
Steps to reproduce
On a Gazebo or GUI plugin, print the camera's HFOV at every frame. The number is constant.
However, looking at the 3D view, it looks like the HFOV varies a lot when the image size changes, but the VFOV remains about the same:
Additional info
I believe what happens is that ign-rendering's API exposes HFOV, but Ogre uses VFOV. So when the user sets HFOV, we store it, then calculate VFOV to pass to Ogre:
Then when the image size changes, Ogre keeps the VFOV fixed and changes the HFOV to compensate, but our API doesn't pick that up.
I think that a solution would be to override Camera::HFOV and return the current angle calculated from VFOV. I haven't opened a PR because I wanted to check that all my assumptions are correct and I'm not missing some important detail.
The text was updated successfully, but these errors were encountered:
yeah I think that's what's happening. Alternatively, we can try to maintain the HFOV by calculating the new VFOV based on the new aspect ratio whenever window size changes. Either way works.
Alternatively, we can try to maintain the HFOV by calculating the new VFOV based on the new aspect ratio whenever window size changes.
I thought of that, but I assumed that the current behaviour was preferred because I feel like most simulations are spread horizontally rather than vertically.
Environment
ign-rendering6
Description
Camera::HFOV
returns the current angleSteps to reproduce
On a Gazebo or GUI plugin, print the camera's HFOV at every frame. The number is constant.
However, looking at the 3D view, it looks like the HFOV varies a lot when the image size changes, but the VFOV remains about the same:
Additional info
I believe what happens is that
ign-rendering
's API exposes HFOV, but Ogre uses VFOV. So when the user sets HFOV, we store it, then calculate VFOV to pass to Ogre:https://github.com/ignitionrobotics/ign-rendering/blob/ae292a88bd752822e0c0f6ed6fd6029e3fc64d0e/ogre2/src/Ogre2Camera.cc#L75-L81
Then when the image size changes, Ogre keeps the VFOV fixed and changes the HFOV to compensate, but our API doesn't pick that up.
I think that a solution would be to override
Camera::HFOV
and return the current angle calculated from VFOV. I haven't opened a PR because I wanted to check that all my assumptions are correct and I'm not missing some important detail.The text was updated successfully, but these errors were encountered: