Skip to content
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

Support adding systems that don't come from a plugin #936

Merged
merged 4 commits into from
Jul 29, 2021

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Jul 27, 2021

🎉 New feature

Summary

This is broken off #926 for easier review.

When using the Server API directly, it's often useful to instantiate systems locally without actually loading a plugin's shared library. This PR adds a new Server::AddSystem that takes a raw pointer and behaves just like the existing AddSystem function that takes a plugin.

I changed the test Relay class to use this approach, which should be a bit faster than loading the shared library.

Also added the convenient gazebo::worldEntity function that returns the first world found.

Test it

Take a look at the unit tests added, and see on #926 how the test fixture uses this.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Jul 27, 2021
@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #936 (aabd086) into ign-gazebo3 (eae6b9c) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo3     #936      +/-   ##
===============================================
+ Coverage        77.78%   77.83%   +0.05%     
===============================================
  Files              219      219              
  Lines            12566    12593      +27     
===============================================
+ Hits              9774     9802      +28     
+ Misses            2792     2791       -1     
Impacted Files Coverage Δ
include/ignition/gazebo/Server.hh 100.00% <ø> (ø)
src/Server.cc 84.33% <100.00%> (+1.53%) ⬆️
src/SimulationRunner.cc 94.49% <100.00%> (+0.06%) ⬆️
src/SimulationRunner.hh 100.00% <100.00%> (ø)
src/Util.cc 93.03% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eae6b9c...aabd086. Read the comment docs.

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition. This will be really useful. I have a couple of comments about the API.

src/SimulationRunner.hh Outdated Show resolved Hide resolved
include/ignition/gazebo/Server.hh Outdated Show resolved Hide resolved
src/SimulationRunner.hh Outdated Show resolved Hide resolved
Signed-off-by: Louise Poubel <[email protected]>
Copy link
Contributor

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition! Do you think we should add some documentation/tutorial for developers so that they are aware that this option exists? (Could be done in a follow-up, not going to block this)

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see UNIT_ModelCommandAPI_TEST failed on macOS. Is that a new flake?

@mjcarroll
Copy link
Contributor

I see UNIT_ModelCommandAPI_TEST failed on macOS. Is that a new flake?

It's a new test I believe from the ign model command?

@chapulina
Copy link
Contributor Author

Do you think we should add some documentation/tutorial for developers so that they are aware that this option exists?

I could write up a simple tutorial, but I'm not sure in which context we want to encourage users to use this API directly. The TestFixture class added in #926 uses it internally, and I wrote a tutorial/example using that class because I can see a clear use case.

Signed-off-by: Louise Poubel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants