Skip to content
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

Set camera projection matrix based on lens params for other types of cameras #432

Merged
merged 6 commits into from
May 15, 2024

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented May 14, 2024

🦟 Bug fix

Related issues: gazebosim/gz-rendering#968, #363

Related PR: gazebosim/gz-rendering#1002

Summary

For camera types other than camera, e.g. depth_camera, the input camera sdf's lens <intrinsics> or <projection> parameters were not used. This PR refactor's the base CameraSensor class' logic for parsing and setting custom projection matrix in to a new function named UpdateLensIntrinsicsAndProjection(). The derived camera classes now call this function for setting a custom projection matrix if needed.

Added tests to verify the intrinsic params published through the camera info topic for depth camera sensors.

Here is a test camera_projection.sdf world file. Together with gazebosim/gz-rendering#1002, a depth camera should now produce the same image / FOV as a regular camera when intrinsics or projection param are specified in the sdf.

Before: Cameras have different FOV.
depth_camera_projection_before

After: Depth camera has the same horizontal FOV as a regular camera
depth_camera_projection_after

Checklist

  • Signed all commits for DCO
  • 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.

Signed-off-by: Ian Chen <[email protected]>
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a small change, but LGTM

test/integration/depth_camera.cc Show resolved Hide resolved
iche033 added 2 commits May 14, 2024 18:55
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
@iche033 iche033 requested a review from ahcorde May 15, 2024 00:44
@iche033 iche033 merged commit 661a40a into gz-sensors8 May 15, 2024
8 of 9 checks passed
@iche033 iche033 deleted the camera_intrinsics_projection branch May 15, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants