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

ogre2: Set custom projection matrix for other types of cameras

Open iche033 opened this issue 1 year ago • 0 comments

🦟 Bug fix

Related issues: #968, https://github.com/gazebosim/gz-sensors/issues/363

Related PR: https://github.com/gazebosim/gz-sensors/pull/432

Summary

The SetProjectionMatrix function call currently works correctly only for the Ogre2Camera class but not other types of cameras. It just ends up calling the base camera's SetProjectionMatrix without actually making ogre API calls to actually set the projection matrix. To make it work, we would need to override the BaseCamera::SetProjectionMatrix in the derived ogre2 classes. This breaks API so the workaround is to handle setting the custom projection matrix in the PreRender.

Added a test that verifies when the SetProjectionMatrix function is called, the depth image also changed.

Checklist

  • [x] Signed all commits for DCO
  • [x] Added tests
  • [ ] 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.

iche033 avatar May 14 '24 05:05 iche033