gz-sim icon indicating copy to clipboard operation
gz-sim copied to clipboard

Add EnvironmentalData component

Open hidmic opened this issue 2 years ago • 3 comments

🎉 New feature

Summary

This patch adds an EnvironmentalData component that can hold a DataFrame worth of user-defined data for plugins to leverage. Additionally, preload and (interactive) load plugins are included.

Needs https://github.com/gazebosim/gz-common/pull/402.

Test it

Reviewers may try the loader GUI plugin manually.

Checklist

  • [x] Signed all commits for DCO
  • [x] Added tests
  • [ ] Added example and/or tutorial
  • [ ] Updated documentation (as needed)
  • [ ] Updated migration guide (as needed)
  • [ ] Consider updating Python bindings (if the library has them)
  • [x] codecheck passed (See contributing)
  • [x] All tests passed (See test coverage)

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.

hidmic avatar Jul 27 '22 14:07 hidmic

Removed the Garden label because we're past feature freeze ❄️ .

This PR can either be merged into main and backported to gz-sim7 after the stable release, or retargeted to gz-sim7 and merged after the stable release (i.e. October).

chapulina avatar Aug 10 '22 18:08 chapulina

It doesn't look like CI will pass. I'll go ahead and cherry-pick this to our custom branch for the time being. We can come back and merge this once CI stabilizes again.

hidmic avatar Aug 18 '22 13:08 hidmic

Oh well then it's fine.

On Mon, Sep 5, 2022 at 8:14 PM Michel Hidalgo @.***> wrote:

@.**** commented on this pull request.

In src/systems/environment_preload/EnvironmentPreload.cc https://github.com/gazebosim/gz-sim/pull/1616#discussion_r962842524:

+////////////////////////////////////////////////// +void EnvironmentPreload::Configure(

  • const Entity &/_entity/,
  • const std::shared_ptr<const sdf::Element> &_sdf,
  • EntityComponentManager &/_ecm/,
  • EventManager &/_eventMgr/) +{
  • this->dataPtr->sdf = _sdf; +}

+////////////////////////////////////////////////// +void EnvironmentPreload::PreUpdate(

  • const gz::sim::UpdateInfo &,
  • gz::sim::EntityComponentManager &_ecm) +{
  • if (!std::exchange(this->dataPtr->loaded, true))

@arjo129 https://github.com/arjo129 it used to be that way. Thing is, we can't query the world SDF (root) path until it's fully loaded, and that has to wait for all world plugins (including this one) to load and configure.

— Reply to this email directly, view it on GitHub https://github.com/gazebosim/gz-sim/pull/1616#discussion_r962842524, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEEMQCSUKRQZN5UF4C3QRDV4XPY7ANCNFSM54ZZQFOQ . You are receiving this because you were mentioned.Message ID: @.***>

arjo129 avatar Sep 05 '22 13:09 arjo129

Pending on https://github.com/gazebosim/gz-common/pull/460.

hidmic avatar Oct 17 '22 15:10 hidmic

Re-targeting to Garden.

hidmic avatar Oct 17 '22 20:10 hidmic

@osrf-jenkins run tests

nkoenig avatar Oct 20 '22 12:10 nkoenig

@osrf-jenkins retest this please

hidmic avatar Oct 20 '22 12:10 hidmic

Hmm, was that a bot or did we actually re-triggered CI at roughly same time @nkoenig ?

hidmic avatar Oct 20 '22 12:10 hidmic

aha. Looks like we timed it perfectly.

nkoenig avatar Oct 20 '22 16:10 nkoenig

@hidmic , now the problem is that the io component is not being built in the release process.

nkoenig avatar Oct 20 '22 16:10 nkoenig

@osrf-jenkins run tests

hidmic avatar Oct 21 '22 12:10 hidmic

Codecov Report

Merging #1616 (7f38d57) into gz-sim7 (39520a1) will increase coverage by 0.02%. The diff coverage is 74.19%.

@@             Coverage Diff             @@
##           gz-sim7    #1616      +/-   ##
===========================================
+ Coverage    64.24%   64.26%   +0.02%     
===========================================
  Files          336      340       +4     
  Lines        26900    26963      +63     
===========================================
+ Hits         17282    17329      +47     
- Misses        9618     9634      +16     
Impacted Files Coverage Δ
.../systems/environment_preload/EnvironmentPreload.cc 70.90% <70.90%> (ø)
include/gz/sim/components/Environment.hh 100.00% <100.00%> (ø)
src/components/Environment.cc 100.00% <100.00%> (ø)
.../systems/environment_preload/EnvironmentPreload.hh 100.00% <100.00%> (ø)
src/EntityComponentManager.cc 90.05% <0.00%> (+0.01%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Oct 26 '22 12:10 codecov[bot]

We have some failures on Jenkins:

  • https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/9791 fails a bunch of tests, seemingly unrelated to this patch.
  • https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-homebrew-amd64/9405 fails the build with #include nested too deeply. I suspect a case sensitivity issue: it's mixing up io.hh (generated) with Io.hh (checked out).
  • https://build.osrfoundation.org/job/ign_gazebo-pr-win/5169/ same as above.
  • https://build.osrfoundation.org/job/ignition_gazebo-abichecker-any_to_any-ubuntu_auto-amd64/5792/ fails to unknown reasons. I suspect the same as above.

@nkoenig @caguero I can change the header name over at gz-common, but I'm not sure what's going with those failing tests.

hidmic avatar Oct 26 '22 13:10 hidmic

See https://github.com/gazebosim/gz-common/pull/471.

hidmic avatar Oct 26 '22 19:10 hidmic

Let's try again:

@osrf-jenkins run tests

hidmic avatar Oct 27 '22 12:10 hidmic

@caguero @nkoenig the integration test is failing on Windows CI with:

99: [Err] [C:\Jenkins\workspace\ign_gazebo-pr-win\ws\gz-sim\src\SystemLoader.cc:103] Failed to load system plugin: (Reason: Could not find shared library)
99: - Requested plugin name: [gz::sim::systems::Physics]
99: - Requested library name: [gz-sim-physics-system]
99: - Library search paths:
99:   - C:/Jenkins/workspace/ign_gazebo-pr-win/ws/build/gz-sim7/test/fake_home/.gz/sim/plugins/
99:   - C:/Jenkins/workspace/ign_gazebo-pr-win/ws/build/gz-sim7/test/fake_home/.ignition/gazebo/plugins/
99:   - C:/Jenkins/workspace/ign_gazebo-pr-win/ws/install/gz-sim7/lib/gz-sim-7/plugins/
99:   - C:/Jenkins/workspace/ign_gazebo-pr-win/ws/build/gz-sim7/lib/
99: [Err] [C:\Jenkins\workspace\ign_gazebo-pr-win\ws\gz-sim\src\SystemLoader.cc:103] Failed to load system plugin: (Reason: Could not find shared library)
99: - Requested plugin name: [gz::sim::systems::SceneBroadcaster]
99: - Requested library name: [gz-sim-scene-broadcaster-system]

I managed to reproduce in a VM. DLL names start with gz-sim7 instead of gz-sim. This is breaking a lot of tests, not just the one this patch adds. Was this naming change intentional?

hidmic avatar Nov 10 '22 15:11 hidmic

I managed to reproduce in a VM. DLL names start with gz-sim7 instead of gz-sim. This is breaking a lot of tests, not just the one this patch adds. Was this naming change intentional?

I think there are large swath of Windows tests that are disabled. This is likely the root cause.

This is out of the scope of what you are trying to do here. Can you open an issue noting this is happening and I think you can disable your test here.

mjcarroll avatar Nov 11 '22 14:11 mjcarroll

Alright, CI is finally mostly green. Test failures on Windows are unrelated. @arjo129 @caguero may I ask you to do a final review?

hidmic avatar Nov 14 '22 14:11 hidmic

Hi @hidmic @caguero

We're having a build regression on gz-sim7 debbuilder

Reference build: https://build.osrfoundation.org/job/gz-sim7-debbuilder/184/

Log output:

CMake Warning at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "Findgz-common5-io.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "gz-common5-io", but CMake did not find one.

And then

CMake Error at /usr/share/cmake/gz-cmake3/cmake3/GzConfigureBuild.cmake:73 (message):
  -- BUILD ERRORS: These must be resolved before compiling.
Call Stack (most recent call first):
  CMakeLists.txt:231 (gz_configure_build)


CMake Error at /usr/share/cmake/gz-cmake3/cmake3/GzConfigureBuild.cmake:75 (message):
  -- 	Missing dependency [gz-common5] (Components: profiler, events, av, io)
Call Stack (most recent call first):
  CMakeLists.txt:231 (gz_configure_build)


CMake Error at /usr/share/cmake/gz-cmake3/cmake3/GzConfigureBuild.cmake:77 (message):
  -- END BUILD ERRORS

I think it could be caused by io component added in this PR

Crola1702 avatar Nov 15 '22 15:11 Crola1702

@Crola1702 looks like the io component in gz-common5 was not built/released.

hidmic avatar Nov 15 '22 15:11 hidmic

@Crola1702 looks like the io component in gz-common5 was not built/released.

@Crola1702 and I looked at this together, the dependency on libgz-common5-io-dev wasn't added to the debian build dependency data for this package which caused the regression. https://github.com/gazebo-release/gz-sim7-release/pull/18 should resolve that.

nuclearsandwich avatar Dec 02 '22 19:12 nuclearsandwich