-
Notifications
You must be signed in to change notification settings - Fork 276
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
Prototype: specify order of execution for System::Update callbacks #2394
Conversation
Specifying an integer value in a <gz:system_priority> tag for a system will control the order in which System Update callbacks are executed, with lower values executing first. Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gz-sim8 #2394 +/- ##
========================================
Coverage 65.91% 65.91%
========================================
Files 327 327
Lines 31314 31320 +6
========================================
+ Hits 20641 20646 +5
- Misses 10673 10674 +1 ☔ View full report in Codecov by Sentry. |
@scpeters I think this PR might have some minor conflicts with #2232. It might be worthwhile discussing the On another note, is it really needed to extend this to Also related: #1815 |
yes, these will conflict; we should figure out an integrated design for both controlling system execution order and removing systems
Yes, I think the changes in this PR could address the concerns of #1815 without adding a new phase to the World step |
now that I've thought about it some, I think the conflicts should be resolvable. The |
CC @traversaro |
this is targeting harmonic; I'm going to open a separate PR for ionic |
we can consider back porting to harmonic eventually, but I've closed this for now |
🎉 New feature
Part of #2268
Summary
This is a prototype for specifying an integer priority value for a
System
using a<gz:system_priority/>
tag in its XML content. TheSystemManager
parses this tag and stores vectors of system callbacks in astd::map
indexed by this priority value. The prototype only implements controllable execution order for theSystem::Update
callbacks, but should be extended to supportPreUpdate
andPostUpdate
as well (I'm not sure it's relevant for other callbacks likeConfigure
,ConfigureParameters
, orReset
but it could be implemented for those as well).TODO:
System.hh
headerPreUpdate
as wellPostUpdate
/Update
/PreUpdate
Test it
Follow the instructions for the
priority_printer
example to run an example world with a plugin that illustrates this feature.Checklist
codecheck
passed (See contributing)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.