-
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
Add entity and sdf parameters to Server's AddSystem interface #2324
Add entity and sdf parameters to Server's AddSystem interface #2324
Conversation
6ca5766
to
aafaa1e
Compare
aafaa1e
to
6d3211d
Compare
Amended to fix linting issues |
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 great! Thanks for the contribution!
I have a few minor comments, but otherwise this is good to go!
One thing I noticed is that adding a plugin through Server
is still overly complicated. A follow up PR would be to have a new API:
public: std::optional<bool> AddSystem(
const std::Plugin &_plugin,
std::optional<Entity> _entity,
const unsigned int _worldIndex = 0);
That would encapsulate loading the plugin and extracting the _sdf
element from sdf::Plugin
. Thoughts?
Sounds good to me. May I do it in this PR ? |
Go for it! |
6d3211d
to
2c6f4bd
Compare
@azeey Comments have been addressed. Thank you for the review! |
5cd3710
to
bf4a8db
Compare
@azeey Had to amend again because of another linter issue, sorry about that. BTW, the contribution guide mentions a $ make codecheck
make: *** No rule to make target 'codecheck'. Stop. How should I run cpplint and cppcheck on gz-sim properly? |
bf4a8db
to
8ce19f5
Compare
You must install |
Got it. I think we are good to go now. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## gz-sim8 #2324 +/- ##
===========================================
+ Coverage 65.97% 65.98% +0.01%
===========================================
Files 327 327
Lines 31328 31339 +11
===========================================
+ Hits 20668 20680 +12
+ Misses 10660 10659 -1 ☔ View full report in Codecov by Sentry. |
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.
Just one small comment. Thanks!
Signed-off-by: Gabriel Arjones <[email protected]>
8ce19f5
to
4e739b8
Compare
No problem. Amended again. |
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 to me. Thanks for the contribution!
…sim#2324) Signed-off-by: Gabriel Arjones <[email protected]> Signed-off-by: Gaurav Kumar <[email protected]>
🦟 Bug fix
Fixes #2322
Summary
Entity and XML content information are lost when adding systems through the
Server::AddSystem(system)
API. To reproduce it:SystemLoader
(extracted from here):Without this patch, the code above will output:
After the patch, you will be able to use the extended
Server::AddSystem(plugin, entity, sdf)
API and get: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.