Closed yosagi closed 2 weeks ago
Thank you for raising the issue. I will try to replicate it on my setup.
In the meanwhile please find an answer for your comment below:
I can't test this issue on development branch because I cannot build any project with ROS2 gem enabled on them. (I could't find PhysX5 Gem stated on ROS2/gem.json on development branch)
As of today (2310.3), the PhysX engine is changed based on the compile flag - it is PhysX4 by default and PhysX5 when requested with compile flag -DAZ_USE_PHYSX5:=ON
. In case of any newer code (stabilization/2409
or development
), PhysX4 and PhysX5 are available as Gems, hence can be changed without rebuilding the whole codebase. You need to match versions of o3de-extras with o3de. Personally, I use the newest development
branch from o3de-extras with stabilization/2409
branch from o3de.
Thank you for your comment. I have managed to build using the develop branch and I was able to reproduce this issue.
o3de: 8fb30d990acc08bb2f83b78724d1ca22f739bf4b o3de-extrans: d6e6f5ccd520fd10018c3ea3991bf9c7f284ebe5
@yosagi thank you for raising the issue. It should be straightforward to fix and points to an untested case as we only use "Play" to run simulations.
I am curious about your use-case if you would like to share, as obviously this was not tried before.
Hello, I can confirm that have a crash on simulate-in-editor usage scenario. I will investigate and test your proposed solution @yosagi ! I've tested stabilization/2409 branch
The fix is in development.
Thanks for the fix. I'd like to follow the background a bit. I am a beginner with O3DE and have been exploring various features. I assumed that the Simulate function would be similar to the Simulate feature in Unreal Engine (UE), where the world continues to run without grabbing the mouse and keyboard, allowing navigation through the Editor's UI. However, this does not seem to be the case in O3DE. While I understand that the Editor might not function fully during simulation, is there a way to simulate the world without grabbing the mouse and keyboard?
While I understand that the Editor might not function fully during simulation, is there a way to simulate the world without grabbing the mouse and keyboard?
I fully understand your problem, as we have been facing it for a while. O3DE was primarily designed as a game engine assuming that the mouse and keyboard belong to the game when turned on (i.e. when the game mode is turned on). It was only later that the game engine became a simulation engine. I do not have much experience with Unreal, but I can say for sure that O3DE tries to separate Editor from the Gameplay as much as possible. This is the reason why Editor is not usable in the Gameplay.
We used to change some things in the O3DE code to be sure the mouse was always available and very recently we decided to add a proper solution: https://github.com/o3de/o3de/pull/18042 This is primarily meant for the situations, in which we use O3DE to simulate sensors and to visualize the scene. When this happens, we use the keyboard and mouse inputs to play with Foxglove/RViz or a terminal to interface with ROS2. In short: this code unlocks the mouse and keyboard, but mainly for other apps. The Editor stays unusable.
The code is already merged to development
branch and we will cherry-pick it into stabilization
to enable it in the next release (planned for the first week of October). You could cherry-pick it to your solution in case you build the code from source.
Describe the bug Editor with ROS2 gem enabled crash on simulate.
Assets required Any project with ROS2 gem added.
Steps to reproduce
Expected behavior No crash.
Actual behavior Crash.
Screenshots/Video The following is a first few lines of backtrace on gdb session.
Found in Branch 2310.3 on both o3de and o3de-extras
Commit ID from o3de/o3de and o3de/o3de-extras repositories
o3de-extras: a30c72f7668c39d138f83754ebe128b1fad5beed (2310.3) o3de: 1577b1e742358461d8b2e6cfafd937637315c9d5 (2310.3)
I can't test this issue on development branch because I cannot build any project with ROS2 gem enabled on them. (I could't find PhysX5 Gem stated on ROS2/gem.json on development branch)
Desktop/Device (please complete the following information):
Additional context According to the comment found here, the EndPlayInEditor event may be called without a prior call to StartPlayInEditor. However, ROS2SystemComponent::Deactivate function cannot be called if Activate was not called beforehand. This is because several members such as m_simulationClock are not available without Activate call.
Possible fix: https://github.com/yosagi/o3de-extras/commit/bd86a9bc1cf50b63ac70001d56851ad2d2f6bf0c