Skip to content

[Simulation Interfaces] Support for Worlds#956

Merged
jhanca-robotecai merged 17 commits intoo3de:developmentfrom
RobotecAI:nprokopiuk/SimulationInterfacesWorlds
Aug 28, 2025
Merged

[Simulation Interfaces] Support for Worlds#956
jhanca-robotecai merged 17 commits intoo3de:developmentfrom
RobotecAI:nprokopiuk/SimulationInterfacesWorlds

Conversation

@norbertprokopiuk
Copy link
Contributor

What does this PR do?

This PR adds support to Worlds introduced by the simulation_interfaces standard. This PR is created based on version of the standard which is going to be published on ROS 2 humble/jazzy/kilted (ros-simulation/simulation_interfaces#15)

How was this PR tested?

Test performed by calling ROS 2 services, running existing tests ensuring none of them was broken during development of the support for Worlds

@norbertprokopiuk norbertprokopiuk force-pushed the nprokopiuk/SimulationInterfacesWorlds branch from 5e26336 to a7b0405 Compare August 20, 2025 09:05
@norbertprokopiuk
Copy link
Contributor Author

Force pushed to resolve conflicts with the development branch

Copy link
Contributor

@jhanca-robotecai jhanca-robotecai left a comment

Choose a reason for hiding this comment

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

Great work! The code works as expected and I could only find some details to complain about. You might want to implement some of the suggestions.

The only problem I have are tests. They fail on my machine:

145/146 Testing: Gem::SimulationInterfaces.TestApp.main::TEST_RUN
145/146 Test: Gem::SimulationInterfaces.TestApp.main::TEST_RUN
Command: "/home/jhanca/devroot/projects/AllTemplates2510/build/dev/bin/profile/AzTestRunner" "/home/jhanca/devroot/projects/AllTemplates2510/build/dev/bin/profile/libSimulationInterfaces.TestApp.so" "AzRunUnitTests" "--gtest_output=xml:/home/jhanca/devroot/projects/AllTemplates2510/build/dev/Testing/Gtest/Gem_SimulationInterfaces.TestApp.xml" "--gtest_filter=-*SUITE_smoke*:*SUITE_periodic*:*SUITE_benchmark*:*SUITE_sandbox*:*SUITE_awsi*" "--platform" "minimal"
Directory: /home/jhanca/devroot/projects/AllTemplates2510/build/dev/External/SimulationInterfaces-efb1f50b/Code
"Gem::SimulationInterfaces.TestApp.main::TEST_RUN" start time: Aug 26 18:34 CEST
Output:
----------------------------------------------------------
cwd = /home/jhanca/devroot/projects/AllTemplates2510/build/dev/External/SimulationInterfaces-efb1f50b/Code
LIB: /home/jhanca/devroot/projects/AllTemplates2510/build/dev/bin/profile/libSimulationInterfaces.TestApp.so
Loading: /home/jhanca/devroot/projects/AllTemplates2510/build/dev/bin/profile/libSimulationInterfaces.TestApp.so
OKAY Library loaded: /home/jhanca/devroot/projects/AllTemplates2510/build/dev/bin/profile/libSimulationInterfaces.TestApp.so
OKAY Symbol found: AzRunUnitTests
Note: Google Test filter = -*SUITE_smoke*:*SUITE_periodic*:*SUITE_benchmark*:*SUITE_sandbox*:*SUITE_awsi*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SimulationInterfaceTestFixture
[ RUN      ] SimulationInterfaceTestFixture.SpawnAppTest
/home/jhanca/devroot/2510/o3de-extras/Gems/SimulationInterfaces/Code/Tests/Tools/SimulationIterfaceAppTest.cpp:91: Failure
Value of: completed
  Actual: false
Expected: true

/home/jhanca/devroot/2510/o3de-extras/Gems/SimulationInterfaces/Code/Tests/Tools/SimulationIterfaceAppTest.cpp:108: Failure
Value of: completed2
  Actual: false
Expected: true

/home/jhanca/devroot/2510/o3de-extras/Gems/SimulationInterfaces/Code/Tests/Tools/SimulationIterfaceAppTest.cpp:116: Failure
Expected equality of these values:
  entities.size()
    Which is: 0
  1

/home/jhanca/devroot/2510/o3de-extras/Gems/SimulationInterfaces/Code/Tests/Tools/SimulationIterfaceAppTest.cpp:118: Failure
Value of: entities.empty()
  Actual: true
Expected: false
Simulated Entities Empty

[  FAILED  ] SimulationInterfaceTestFixture.SpawnAppTest (5 ms)
[----------] 1 test from SimulationInterfaceTestFixture (5 ms total)

[----------] Global test environment tear-down
<end of output>
Test time =   0.61 sec
----------------------------------------------------------
Test Failed.
"Gem::SimulationInterfaces.TestApp.main::TEST_RUN" end time: Aug 26 18:34 CEST
"Gem::SimulationInterfaces.TestApp.main::TEST_RUN" time elapsed: 00:00:00
----------------------------------------------------------

@byrcolin byrcolin added the sig/simulation Categorizes an issue or PR as relevant to SIG Simulation label Aug 26, 2025
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Added GetCurrentWorld Handler

Added LoadWorld Handler

Added UnloadWorld Handler

Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
…encies

Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
@norbertprokopiuk norbertprokopiuk force-pushed the nprokopiuk/SimulationInterfacesWorlds branch from 2bb3190 to eaa691a Compare August 27, 2025 07:15
@norbertprokopiuk
Copy link
Contributor Author

norbertprokopiuk commented Aug 27, 2025

@jhanca-robotecai This test you mentioned, passes on my machine. This test uses Asset TestSimulationEntity.prefab which needs to be processed correctly. I assume asset on your machine might be unprocessed or invisible for the test runner. It would be great if you could confirm that the issue preserves after clean rebuild of the assets

I also added changes for all your other comments

Signed-off-by: Norbert Prokopiuk <norbert.prokopiuk@robotec.ai>
@norbertprokopiuk
Copy link
Contributor Author

norbertprokopiuk commented Aug 28, 2025

@jhanca-robotecai I noticed some miss-match between this implementation and the standard. This note is related resetting simulation with SCOPE_ALL. Standard says that this reset supposed to restore simulation as it would be closed and started again. Previously this reset always caused reload of level, even if simulator started without loaded level. I added one commit which fixes this behaviour, and reloads level only if simulator started with loaded level. If level wasn't loaded at launch level is unloaded and reset finishes in state NO_WORLD_LOADED. It would be great if you could check out my latest changes

Copy link
Contributor

@jhanca-robotecai jhanca-robotecai left a comment

Choose a reason for hiding this comment

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

Thank you for fixing the nitpicks!

As for the tests: rebuiding the simulation after your force-push fixed the issue on my side. Most probably the assets were not fully build when I tried the first time. Sorry for the confusion.

@jhanca-robotecai jhanca-robotecai merged commit 6066828 into o3de:development Aug 28, 2025
1 check passed
@jhanca-robotecai jhanca-robotecai deleted the nprokopiuk/SimulationInterfacesWorlds branch August 28, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig/simulation Categorizes an issue or PR as relevant to SIG Simulation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants