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

Distortion Camera Sensor #192

Merged
merged 13 commits into from
Mar 29, 2022

Conversation

WilliamLewww
Copy link
Contributor

🎉 Distortion Camera Sensor

Summary

Camera distortion has already been implemented in ign-rendering, but in order to use it with ign-gazebo, it must be implemented within ign-sensors.

Distortion is implemented with abstraction (just like how noise is implemented) in the case that different distortion models are to be implemented. The abstract implementation in ign-sensors would reduce future work for adding additional distortions.

Comments with the TODO tag have been added in areas where additional work is required in other repositories to maintain the abstraction. For example, sdf::Distortion does not exist so sdf::Camera is being used instead with it's distortion element that is hard-coded with the Brown's distortion model coefficients.

Tasks required to enable distortion abstraction

  • Change DistortionPass to BrownDistortionPass in ign-rendering
  • Create sdf::Distortion class in sdformat
  • Update ign-sensors to use the new classes

Test it

Requires the branch: https://github.com/WilliamLewww/ign-gazebo/tree/wlew/distortion_test
ign gazebo ign-gazebo/test/worlds/camera_distortion.sdf

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • 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: William Lew <WilliamMilesLew@gmail.com>
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Jan 20, 2022
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
@WilliamLewww
Copy link
Contributor Author

CI is failing with the following:

ImageBrownDistortionModel.cc:31:10: fatal error: ignition/rendering/DistortionPass.hh: No such file or directory

The DistortionPass.hh file was introduced recently to ign-rendering6.

include/ignition/sensors/BrownDistortionModel.hh Outdated Show resolved Hide resolved
include/ignition/sensors/BrownDistortionModel.hh Outdated Show resolved Hide resolved
include/ignition/sensors/Distortion.hh Outdated Show resolved Hide resolved
include/ignition/sensors/Distortion.hh Outdated Show resolved Hide resolved
src/BrownDistortionModel.cc Outdated Show resolved Hide resolved
src/BrownDistortionModel.cc Outdated Show resolved Hide resolved
src/Distortion.cc Outdated Show resolved Hide resolved
src/ImageBrownDistortionModel.cc Outdated Show resolved Hide resolved
src/ImageBrownDistortionModel.cc Outdated Show resolved Hide resolved
@scpeters
Copy link
Member

scpeters commented Jan 21, 2022

CI is failing with the following:

ImageBrownDistortionModel.cc:31:10: fatal error: ignition/rendering/DistortionPass.hh: No such file or directory

The DistortionPass.hh file was introduced recently to ign-rendering6.

since this is targeting fortress, we will need a release of ign-rendering6 in order to test this pull request. I suggest a prerelease along with an update to gzdev similar to gazebo-tooling/gzdev@c183129 that enables the prerelease repository for ignition-sensors6

gazebosim/gz-rendering@ignition-rendering6_6.1.0...ign-rendering6

Edit: I can assist with the prerelease if needed

@WilliamLewww
Copy link
Contributor Author

CI is failing with the following:

ImageBrownDistortionModel.cc:31:10: fatal error: ignition/rendering/DistortionPass.hh: No such file or directory

The DistortionPass.hh file was introduced recently to ign-rendering6.

since this is targeting fortress, we will need a release of ign-rendering6 in order to test this pull request. I suggest a prerelease along with an update to gzdev similar to ignition-tooling/gzdev@c183129 that enables the prerelease repository for ignition-sensors6

ignitionrobotics/ign-rendering@ignition-rendering6_6.1.0...ign-rendering6

Edit: I can assist with the prerelease if needed

That would be great if you could help with the prerelease. I'm not too sure how to go about doing that.

@scpeters
Copy link
Member

Edit: I can assist with the prerelease if needed

That would be great if you could help with the prerelease. I'm not too sure how to go about doing that.

here's the prerelease version bump and changelog pull request: gazebosim/gz-rendering#548

Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
@scpeters
Copy link
Member

Edit: I can assist with the prerelease if needed

That would be great if you could help with the prerelease. I'm not too sure how to go about doing that.

here's the prerelease version bump and changelog pull request: ignitionrobotics/ign-rendering#548

I just made the 6.2.0~pre1 prerelease: https://build.osrfoundation.org/job/ign-rendering6-debbuilder/525/

you should update find_package(ignition-rendering6) to require version 6.2

Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
scpeters added a commit to gazebo-tooling/gzdev that referenced this pull request Jan 27, 2022
Testing gazebosim/gz-sensors#192

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to gazebo-tooling/gzdev that referenced this pull request Jan 27, 2022
Testing gazebosim/gz-sensors#192

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member

in order to use the prerelease only in a branch, you need to create a special branch in the gzdev repository that configures the ignition-sensors6 package to use prereleases (see gazebo-tooling/gzdev@c5c59ce)

that gzdev branch name must contain ci_matching_branch/ and the corresponding ign-sensors branch must match it as well. I checked out a new branch with that same name from the tip of this forked branch and pushed it to this repository in 4fb0487

the GitHub action is currently running

@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #192 (e07cef3) into ign-sensors6 (373e971) will decrease coverage by 3.51%.
The diff coverage is 0.70%.

❗ Current head e07cef3 differs from pull request most recent head ac214ea. Consider uploading reports for the commit ac214ea to get more accurate results

@@               Coverage Diff                @@
##           ign-sensors6     #192      +/-   ##
================================================
- Coverage         76.58%   73.06%   -3.52%     
================================================
  Files                29       33       +4     
  Lines              2925     3067     +142     
================================================
+ Hits               2240     2241       +1     
- Misses              685      826     +141     
Impacted Files Coverage Δ
src/BrownDistortionModel.cc 0.00% <0.00%> (ø)
src/Distortion.cc 0.00% <0.00%> (ø)
src/ImageBrownDistortionModel.cc 0.00% <0.00%> (ø)
src/ImageDistortion.cc 0.00% <0.00%> (ø)
src/CameraSensor.cc 75.73% <16.66%> (-1.34%) ⬇️

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 373e971...ac214ea. Read the comment docs.

@scpeters
Copy link
Member

it looks like the Ubuntu build is passing in the Github action workflow and the homebrew builds is passing as well, though there are no tests of distortion in this pull request

Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
test/integration/distortion_camera.cc Outdated Show resolved Hide resolved
test/integration/CMakeLists.txt Show resolved Hide resolved
test/integration/distortion_camera.cc Outdated Show resolved Hide resolved
Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
{
if (_sensorType == "camera" || _sensorType == "depth" ||
_sensorType == "multicamera" || _sensorType == "wideanglecamera" ||
_sensorType == "thermal_camera" || _sensorType == "rgbd_camera")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know the distortion render pass in ign-rendering would work with all these sensors? Maybe we should just limit it to the ones that we know are working for now

{
if (_sensorType == "camera" || _sensorType == "depth" ||
_sensorType == "multicamera" || _sensorType == "wideanglecamera" ||
_sensorType == "thermal_camera" || _sensorType == "rgbd_camera")
Copy link
Contributor

Choose a reason for hiding this comment

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

same question as ImageDistortionFactory, maybe we should limit image distortion to sensors that we know are working

Signed-off-by: William Lew <WilliamMilesLew@gmail.com>
@iche033 iche033 requested a review from ahcorde March 28, 2022 23:19
@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-04-13-fortress-edifice/1367/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants