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

Add support for wide angle camera in sensors system #1215

Merged
merged 25 commits into from
Mar 14, 2022
Merged

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Nov 18, 2021

🎉 New feature

depends on:

Summary

supports parsing and loading wide angle camera sensors

Test it

you can test with the wide_angle_camera.sdf example world:

ign gazebo -v 4 wide_angle_camera.sdf

wide_angle_camera_ign_gazebo

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

@iche033 iche033 requested a review from chapulina as a code owner November 18, 2021 01:38
@chapulina chapulina added the 🌱 garden Ignition Garden label Nov 18, 2021
@chapulina chapulina added rendering Involves Ignition Rendering sensors Sensors and sensor data labels Nov 18, 2021
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.

is this targeting the right branch ?

@iche033
Copy link
Contributor Author

iche033 commented Nov 18, 2021

is this targeting the right branch ?

yeah, this targets garden and requires the version bumps for gui, sensors and rendering done in #1183

Signed-off-by: Ian Chen <[email protected]>
Base automatically changed from bump_garden_ign-gazebo7 to main November 19, 2021 17:46
@scpeters scpeters requested a review from mabelzhang as a code owner November 19, 2021 17:46
Signed-off-by: Ian Chen <[email protected]>
@WilliamLewww WilliamLewww self-requested a review December 3, 2021 17:01
@WilliamLewww
Copy link
Contributor

All components (ign-rendering, ign-sensors, ign-gazebo) are working as expected. The test world is also working as expected.

@chapulina chapulina added the needs upstream release Blocked by a release of an upstream library label Dec 6, 2021
@scpeters
Copy link
Member

scpeters commented Dec 7, 2021

I tried adding a dependencies.yaml file in 77a0f60 in branch wide_angle_camera_vcs to build ign-rendering and ign-sensors from source to see if that fixes the GitHub actions workflow CI

Ubuntu CI

@scpeters
Copy link
Member

scpeters commented Dec 7, 2021

I tried adding a dependencies.yaml file in 77a0f60 in branch wide_angle_camera_vcs to build ign-rendering and ign-sensors from source to see if that fixes the GitHub actions workflow CI

Ubuntu CI

it built ign-sensors7 successfully and ign-gazebo7 configured correctly. It later failed with an unrelated linking error due to branches being out of date with main

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

We need to add the wide angle camera package to https://github.com/ignition-release/ign-sensors7-release for the nightlies to work.

@scpeters
Copy link
Member

We need to add the wide angle camera package to https://github.com/ignition-release/ign-sensors7-release for the nightlies to work.

indeed, that's why this build is unstable:

Build Status https://build.osrfoundation.org/view/ign-garden/job/ign-sensors7-debbuilder/58/

I'll fix it

@scpeters
Copy link
Member

We need to add the wide angle camera package to https://github.com/ignition-release/ign-sensors7-release for the nightlies to work.

indeed, that's why this build is unstable:

Build Status https://build.osrfoundation.org/view/ign-garden/job/ign-sensors7-debbuilder/58/

I'll fix it

gazebo-release/gz-sensors7-release#4

@scpeters
Copy link
Member

scpeters commented Jan 4, 2022

does this need an integration test before merging? I can find someone to add that to this branch if so

@iche033
Copy link
Contributor Author

iche033 commented Jan 4, 2022

one simple integration test I can think of is to load the wide angle camera world file and make sure data are published to the topic. ign-sensors and ign-rendering already have integration tests to check the content of the published images so we probably don't need to duplicate that here.

yeah it would be nice to get some help on adding the test.

@scpeters
Copy link
Member

looks like the test is fixed in d6a39d0, though there are some unrelated cmake warnings

@WilliamLewww
Copy link
Contributor

Still running into a segfault from using an incorrect pixel format. Currently trying to fix the error so it runs smoothly like the depth camera integration test.

@scpeters
Copy link
Member

the test seems to fail after writing the test_result xml file, so jenkins doesn't notice that it failed, but it does show a seg-fault in the console log. I've collected a backtrace:

[       OK ] WideAngleCameraTest.WideAngleCameraBox (5536 ms)
[Thread 0x7ffff26c2700 (LWP 995858) exited]
[----------] 1 test from WideAngleCameraTest (5536 ms total)

[----------] Global test environment tear-down
[Thread 0x7ffff2ec3700 (LWP 995857) exited]
[==========] 1 test from 1 test suite ran. (5536 ms total)
[  PASSED  ] 1 test.
[Thread 0x7ffff36c4700 (LWP 995856) exited]
[Thread 0x7ffff3ec5700 (LWP 995855) exited]
[Thread 0x7ffff46c6700 (LWP 995854) exited]
[Thread 0x7ffff4ec7700 (LWP 995853) exited]
[Thread 0x7ffff56c8700 (LWP 995852) exited]

Thread 1 "INTEGRATION_wid" received signal SIGSEGV, Segmentation fault.
0x00007fffce39dc49 in ?? () from /lib/x86_64-linux-gnu/libGLdispatch.so.0
(gdb) bt
#0  0x00007fffce39dc49 in ?? () from /lib/x86_64-linux-gnu/libGLdispatch.so.0
#1  0x00007fffcc2d0984 in Ogre::GLSL::GLSLProgram::unloadHighLevelImpl() () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so
#2  0x00007fffce86fd1a in Ogre::HighLevelGpuProgram::unloadHighLevel() () from /lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#3  0x00007fffce990028 in Ogre::Resource::unload() () from /lib/x86_64-linux-gnu/libOgreMain.so.1.9.0
#4  0x00007fffcc2d08a5 in Ogre::GLSL::GLSLProgram::~GLSLProgram() () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so
#5  0x00007fffcc2d08bd in Ogre::GLSL::GLSLProgram::~GLSLProgram() () from /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/RenderSystem_GL.so
#6  0x00007fffce619752 in ?? () from /lib/x86_64-linux-gnu/libOgreRTShaderSystem.so.1.9.0
#7  0x00007fffce6156f7 in Ogre::RTShader::ProgramManager::releasePrograms(Ogre::Pass*, Ogre::RTShader::TargetRenderState*) () from /lib/x86_64-linux-gnu/libOgreRTShaderSystem.so.1.9.0
#8  0x00007fffce60288d in Ogre::RTShader::ShaderGenerator::SGTechnique::~SGTechnique() () from /lib/x86_64-linux-gnu/libOgreRTShaderSystem.so.1.9.0
#9  0x00007fffce603751 in Ogre::RTShader::ShaderGenerator::_destroy() () from /lib/x86_64-linux-gnu/libOgreRTShaderSystem.so.1.9.0
#10 0x00007fffce603abe in Ogre::RTShader::ShaderGenerator::destroy() () from /lib/x86_64-linux-gnu/libOgreRTShaderSystem.so.1.9.0
#11 0x00007fffcee0f739 in ignition::rendering::v7::OgreRTShaderSystem::Fini() () from /usr/lib/x86_64-linux-gnu/ign-rendering-7/engine-plugins/libignition-rendering-ogre.so
#12 0x00007fffcee0f902 in ignition::rendering::v7::OgreRTShaderSystem::~OgreRTShaderSystem() () from /usr/lib/x86_64-linux-gnu/ign-rendering-7/engine-plugins/libignition-rendering-ogre.so
#13 0x00007ffff7064a27 in __run_exit_handlers (status=0, listp=0x7ffff7206718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#14 0x00007ffff7064be0 in __GI_exit (status=<optimized out>) at exit.c:139
#15 0x00007ffff70420ba in __libc_start_main (main=0x5555555657b0 <main(int, char**)>, argc=1, argv=0x7fffffffe288, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe278) at ../csu/libc-start.c:342
#16 0x000055555556586e in _start ()
(gdb)

could there be a memory problem with one of the shaders?

@iche033
Copy link
Contributor Author

iche033 commented Jan 27, 2022

The crash happens after exit. It could be that the OgreRTShaderSystem is trying to destroy its resources after ogre has already been deleted.

@WilliamLewww
Copy link
Contributor

The crash happens after exit. It could be that the OgreRTShaderSystem is trying to destroy its resources after ogre has already been deleted.

I created an integration test for the distortion camera and I am getting the same segfault, but when I delete the following line in ign-rendering, the program exits without a segfault:
https://github.com/ignitionrobotics/ign-rendering/blob/1258280eae5834f5687ad5be78e073e73efb47a2/ogre/src/OgreRTShaderSystem.cc#L156

I think you are correct; the resources (for shaders) are deleted and then Ogre::RtShader::ShaderGenerator tries to delete them again. Removing the destroy() might cause memory leaks if there are still allocated resources but I currently don't see any other solutions if it isn't an ordering of destructors issue.

@WilliamLewww
Copy link
Contributor

The segfault seems to occur with every test that uses OGRE1.

@chapulina
Copy link
Contributor

2 approvals and happy CI, merging!

@chapulina chapulina merged commit b9206e2 into main Mar 14, 2022
@chapulina chapulina deleted the wide_angle_camera branch March 14, 2022 16:59
@j-rivero j-rivero mentioned this pull request Sep 16, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden rendering Involves Ignition Rendering sensors Sensors and sensor data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants