-
Notifications
You must be signed in to change notification settings - Fork 277
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 GUI entity creation #1122
Add support for GUI entity creation #1122
Conversation
Signed-off-by: Ashton Larkin <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-gazebo6 #1122 +/- ##
===============================================
+ Coverage 63.84% 64.02% +0.18%
===============================================
Files 256 255 -1
Lines 20076 20065 -11
===============================================
+ Hits 12817 12847 +30
+ Misses 7259 7218 -41
Continue to review full report at Codecov.
|
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.
this fixes the issue for me when new entities are created.
As discussed, we still need a way to propagate new ECM changes to other GUI plugins but that's outside the scope of this PR.
I'm concerned that the changes I proposed in this PR aren't actually a proper "fix". As we discussed offline, we run the chance of other GUI plugins not being aware of new entities that were added in a GUI plugin's
The problem with the scenario above is that I think the proper solution is to follow the pattern of server systems. We should give GUI plugins a The solution I've proposed would involve updating other GUI plugin logic as needed (for example, having the Another solution proposed by @iche033 is to send any changes made on the GUI back to the server, and then have the server broadcast the changes out to all GUI plugins. While this solution would not break ABI, I worry that this would be difficult code to maintain, and also wonder how much performance overhead would be introduced by going from GUI -> Server -> GUI for every GUI change. I think that implementing this approach would be just as much (or possibly even more) work than giving GUI systems a I'm open to other suggestions/thoughts if anyone has them! |
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.
One minor suggestion.
Signed-off-by: Ashton Larkin <[email protected]>
…tion Signed-off-by: Ashton Larkin <[email protected]>
Merge conflicts have been resolved in 98b5e2d. I have set this PR to auto-merge (squash). As a follow-up to #1122 (comment), the solution we discussed offline is to use gui events to notify other gui systems of new/removed entities. This will prevent us from breaking ABI. When we forward port this work to Garden, we will upate the |
Signed-off-by: Ashton Larkin <[email protected]>
Signed-off-by: Ashton Larkin [email protected]
🎉 New feature
Related to #1106
Summary
In order to create entities in the GUI (while paused) and then share these new entities with the server, we need to:
RenderUtil
will try to create entities that were already created.Item 1 above was resolved through a hack that sets the GUI ECM's entity creation ID offset to one that is (probably) larger than the server ECM's entity creation ID offset (I left a
TODO
note in the code about improving this). Item 2 above actually appears to be a bug that was never fixed. The fix for this is to move the GUI ECM'sClearNewlyCreatedEntities
andProcessRemoveEntityRequests
calls to theGuiRunner::Implementation::UpdatePlugins
method. This allows the GUI ECM's state to be properly updated when simulation is both running and paused (the previous approach of having these ECM method calls inGuiRunner::Implementation::ProcessState
meant that these ECM method calls were only made when simulation is running).Test it
@iche033 can you try to test this with your GUI model editor work in ign-gazebo6...model_editor_add_link? You should be able to remove these lines from your branch because this PR sets the entity creation offset for the ECM that's used by all GUI plugins.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge