-
Notifications
You must be signed in to change notification settings - Fork 58
Enable ray query for depth, segmentation and thermal cameras #483
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
Enable ray query for depth, segmentation and thermal cameras #483
Conversation
Codecov Report
@@ Coverage Diff @@
## main #483 +/- ##
==========================================
- Coverage 53.52% 53.48% -0.04%
==========================================
Files 194 198 +4
Lines 19655 19679 +24
==========================================
+ Hits 10520 10526 +6
- Misses 9135 9153 +18
Continue to review full report at Codecov.
|
Converting to draft: while this works I'm concerned that using RTTI will result in maintenance problems later. Using a virtual function to access the (There is also a problem with variable shadowing in the |
looks like the problem is that the depth, thermal, segmentation camera etc does not derive from Not sure what the consequence of changing them to derive from Another workaround I can think off is to add a function function called open to other ideas. |
This might be a good way forward. It retains some type safety and doesn't require a change to the inheritance structure. All the ignition cameras contain the ogre camera object required so can implement the function. We could add a parameter to request the type of object needed (similar to the |
- Enable depth, segmentation and thermal cameras to set a ray query for ogre and ogre2 render engines - Make the RayQuery a friend of the various camera classes - Update the mouse handling in the segmentation_camera and thermal_camera examples Signed-off-by: Rhys Mainwaring <[email protected]>
- Remove line end whitespace and shorten long lines. Signed-off-by: Rhys Mainwaring <[email protected]>
sounds good, thanks |
- Enable depth, segmentation and thermal cameras to set a ray query for ogre and ogre2 render engines - Introduce mixin classes to the cameras to expose the underlying Ogre objects - Implement methods to access Ogre::Camera and Ogre::MovableObject pointers on camera implementations - Update ray query to use the new interface Signed-off-by: Rhys Mainwaring <[email protected]>
6af944a
to
f6a6e09
Compare
I took a slightly different tack here: The mix-in class has two accessors. A specific one to access an Coming up with a mix-in class name that makes sense and does not clash with existing objects is always a challenge, I went with |
- Fix code check errors Signed-off-by: Rhys Mainwaring <[email protected]>
- Fix code check errors - unused parameters. Signed-off-by: Rhys Mainwaring <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok yeah your approach is fine. Given that the OgreMovableObject
accessor function is currently not used, one suggestion is to make it non-pure-virtual and just return nullptr
inline so that the derived classes do not have to implement it. I think it may break ABI if the derived classes decide to override the function later but I'm leaning towards reducing the overhead of adding new camera classes for now.
inline namespace IGNITION_RENDERING_VERSION_NAMESPACE { | ||
|
||
/// \brief Mixin class to provide direct access to Ogre objects. | ||
class Ogre2ObjectInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll need to add IGNITION_RENDERING_OGRE2_VISIBLE
here for ignition to export the symbols, i.e.
class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2ObjectInterface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added export declarations and provided a default implementation for the OgreMovableObject
method. Removed empty methods from the camera classes.
I'm not sure that a const char* _typename
parameter is the best choice, something like the Ogre::IdString
would be better but I'm not sure of the Ignition equivalent. Given that the function is a placeholder to signal intent, and that any changes to implement the method in camera classes would require a major release in any case, it's probably ok to leave it as is for now.
- Provide default implementation for method `OgreMovableObject` and add file for definition. - Remove empty implementation of `OgreMovableObject` from cameras - Add export declaration to class Signed-off-by: Rhys Mainwaring <[email protected]>
- Fix incorrect include path Signed-off-by: Rhys Mainwaring <[email protected]>
- Fix issue with the configuration of class exports Signed-off-by: Rhys Mainwaring <[email protected]>
- Fix code check errors - unused parameters in default implementation. Signed-off-by: Rhys Mainwaring <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works well for me. Just one minor comment, otherwise good to go.
- Fix code check errors - unused parameters in default implementation. Signed-off-by: Rhys Mainwaring <[email protected]>
🦟 Bug fix
Fixes #414
Summary
This PR enables depth, segmentation and thermal cameras to set a ray query for the
ogre
andogre2
render engines.The approach Introduces mix-in classes to provide access to underlying Ogre objects in the
OgreCamera
/Ogre2Camera
and related camera classes.Update the mouse handling in the
segmentation_camera
andthermal_camera examples
.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge