-
Notifications
You must be signed in to change notification settings - Fork 53
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
Heightmap for Ogre 1 #180
Heightmap for Ogre 1 #180
Conversation
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #180 +/- ##
==========================================
+ Coverage 53.01% 57.29% +4.28%
==========================================
Files 143 147 +4
Lines 13600 14769 +1169
==========================================
+ Hits 7210 8462 +1252
+ Misses 6390 6307 -83
Continue to review full report at Codecov.
|
Geometry vs Object: looking at threejs as another example, it treats heightmap as a geometry. I think semantically it makes sense. The OgreObject() will then just return null. We may have to update Multiple heightmaps: sounds good Scene API: If it's derived from Geometry, we could create a general GeometryStorage class. It looks like currently other geometries (e.g. text and markers, etc) are not stored in a storage. So we could start storing them and offer APIs for retrieving and destroying geometries. This can be ticketed as an issue and addressed separately. If Heightmap is derived from Visual, then we can just call Scene::RegisterVisual to store it in the visual store Descriptor: HeightmapDescriptor class is a good idea Material ogre heightmap material is tricky. It may not be trivial to make it work with a generic |
Thanks for the input, @iche033 . I'll revert to inheriting from |
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
…forced Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
….9.0 but not 1.9.1 Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
I'm getting a couple of compile errors, which are also happening on jenkins:
|
Signed-off-by: Louise Poubel <[email protected]>
Ahh sorry, it should be fixed now: b3efe1c |
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 for me! Did a first pass and left some minor comments
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
@osrf-jenkins run tests please |
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.
looks good! waiting for one more round of CI builds
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[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.
I see lots of greens!
This is a port of Gazebo classic's heightmap implementation.
I'm testing this locally with Ogre 1.9.1.
Update: Also got it to work with 1.9.0 (debs or source with this patch)
Implementation considerations / questions
Geometry vs Object
My initial implementation had heightmaps as a new geometry type that can be attached to visuals. That's different from Gazebo classic, but it matches the SDF spec.However, Ogre terrains don't seem to have an Ogre::MovableObject, which is required forOgreGeometry
s. Looking online, it doesn't seem like terrains are meant to be attached to nodes and moved around. So I stopped pursuing that direction, but left it on branchchapulina/5/heightmap
. I don't think we should make decisions aboutign-rendering
's API based solely on Ogre though, so I'm open to bringing that back if we think that it will fit well with other engines.For now, heightmaps are extendingObject
, which seemed to be the correct class for entities that won't be moving too much.Heightmaps are now a Geometry, see conversation below.
Multiple heightmaps
The current implementation leaves room for loading multiple heightmaps at the same time. It currently loads the geometry well, but the materials can't be loaded yet. I'm planning to keep looking into fixing that.Multiple heightmaps are now working, see example.
Scene API
The only function added to Scene so far wasCreateHeightmap
and it's storing the heightmaps in a simple vector. I didn't want to go too far until we ruled out the geometry approach. If we keep heightmaps as objects that are managed by the scene, I think we should:Create aHeightmapStorage
classAddHasHeightmap*
/HeightmapBy*
/HeightmapCount
/DestroyHeightmap
APIs toScene
I can do that as part of this PR if we want to take this direction.Punting on this now that heightmaps are geometries.
Descriptor
I took some inspiration from
MeshDescriptor
and stored all the information for the heightmap intoHeightmapDescriptor
. Some key differences:HeightmapDescriptor
is a first-class element ofHeightmap
, whileMesh
doesn't know aboutMeshDescriptor
.Heightmap
stores a copy ofHeightmapDescriptor
and exposes that through theDescriptor()
function. That's different to storing and accessing each property separately. If this is an acceptable pattern, I can look into PIMPLizing it so it can be extended in the future.Material
Admittedly, I blindly copied the terrain material code from Gazebo classic and haven't looked closely into it yet. There may be potential for using
ignition::rendering::Material
insideHeightmap
, but judging by all the customTerrainMaterial
code, that may not be possible or desirable. I just wanted to make sure I brought this up.Functionality