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

ROS2 Manipulation crashes as the game mode starts #796

Open
fjnn opened this issue Nov 19, 2024 · 6 comments
Open

ROS2 Manipulation crashes as the game mode starts #796

fjnn opened this issue Nov 19, 2024 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical Critical priority. Must be actively worked on as someone's top priority right now. sig/simulation Categorizes an issue or PR as relevant to SIG Simulation triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@fjnn
Copy link

fjnn commented Nov 19, 2024

Describe the bug
I have installed O3DE using .deb on my Ubuntu 24.04 and I have ROS2 Jazzy. I created a new project using ROS2 Manipulation template. There were a few missing gems (ROS2, WarehouseAssets and WarehouseAutomation) and I added them using the editor. My project was successfully built and I can see the Panda robot in the editor.

However, when I press the "Play Game (Ctrl+G)" or in full mode, the editor crashes. No crash report, no log, nothing to provide here. Since I run O3DE via terminal, I see that i enters the game mode, but nothing shows up.

PS. I am very new to O3DE and I assume that I need to run the simulation to see the relevant ROS topics right? Or am I missing something?

@fjnn fjnn added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 19, 2024
@jhanca-robotecai
Copy link
Contributor

I can confirm the problem on Ubuntu 24.04 with ROS 2 Jazzy when using o3de binaries.

Ubuntu 24.04 with ROS 2 Jazzy (the manipulation template):

  • o3de 2409.0 binary with ROS 2 Gem (3.2.2) downloaded using GUI - does not work
  • o3de 2409.1 binary with ROS 2 Gem (3.2.2) downloaded using GUI - does not work
  • o3de 2409.1 binary with ROS 2 Gem (3.2.2) from the repository - does not work
  • o3de 2409.0 from source with ROS 2 Gem (3.2.2) from the repository - works correctly
  • o3de 2409.1 from source with ROS 2 Gem (3.2.2) from the repository - works correctly

Ubuntu 22.04 with ROS 2 Humble (the manipulation template):

  • o3de 2409.0 binary with ROS 2 Gem (3.2.2) downloaded using GUI - works correctly
  • o3de 2409.1 binary with ROS 2 Gem (3.2.2) downloaded using GUI - works correctly

From what I know o3de binaries are built on Ubuntu 22.04...

@jhanca-robotecai jhanca-robotecai added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/critical Critical priority. Must be actively worked on as someone's top priority right now. sig/simulation Categorizes an issue or PR as relevant to SIG Simulation and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 21, 2024
@michalpelka
Copy link
Contributor

@jhanca-robotecai
please check if the issue is not caused by camera pipeline modification.
Modify registry to :

{
    "O3DE":
    {
        "InputSystem":
        {
            "Mouse":
            {
                "CaptureMouseCursor": false
            }
        },
        "ROS2":
        {
            "SteadyClock" : true,
            "Camera":
            {
                "AllowPipelineModification": false
            }
        }
    }
}

@jhanca-robotecai
Copy link
Contributor

The registry does not change anything, camera is not a problem. The template is not a problem either.

I managed to replicate the issue with an empty project with ROS2 Gem and a single entity with ROS 2 Frame component.

@fjnn
Copy link
Author

fjnn commented Nov 22, 2024

Update: I see here that for ROS2 projects, we need to build O3DE from source: https://docs.o3de.org/docs/user-guide/interactivity/robotics/project-configuration/

I am trying doing it right now although I have other issues on that as I created another issue #797
I would like to keep this issue open since it would be nice be able to create ROS2 projects via debian installation.

@jhanca-robotecai
Copy link
Contributor

The issue should stay open until it is solved.

There is no reason to build O3DE from the source in many cases. The gem should work with o3de-sdk. I can confirm it works correctly with Ubuntu 22.04 and ROS 2 Humble. I can also confirm it does not in the case of Ubuntu 24.04 and ROS 2 Jazzy. I am trying to debug it, it looks like a problem with the ROS 2 Clock implementation:

<14:33:45> Entered game mode
Process 12422 stopped
* thread #1, name = 'o3de.editor', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x10)
    frame #0: 0x00007ffed91efd5e libROS2.Editor.so`ROS2::ROS2Clock::GetROSTimestamp() const [inlined] std::__uniq_ptr_impl<ROS2::ITimeSource, std::default_delete<ROS2::ITimeSource>>::_M_ptr(this=0x0000000000000010) const at unique_ptr.h:199:51
   196 	      _GLIBCXX23_CONSTEXPR
   197 	      pointer&   _M_ptr() noexcept { return std::get<0>(_M_t); }
   198 	      _GLIBCXX23_CONSTEXPR
-> 199 	      pointer    _M_ptr() const noexcept { return std::get<0>(_M_t); }
   200 	      _GLIBCXX23_CONSTEXPR
   201 	      _Dp&       _M_deleter() noexcept { return std::get<1>(_M_t); }
   202 	      _GLIBCXX23_CONSTEXPR

@jhanca-robotecai
Copy link
Contributor

More debugging info, as someone else might want to try to debug the issue as well. Very strange.

The problem is caused by the ROS2EditorSystemComponent, which should activate ROS2SystemComponent when the game mode starts (this way ROS2 clock does not run in the Editor). To do that, the component handles OnStartPlayInEditorBegin() notification from EditorEntityContextNotificationBus. This method is not called when running the binary on Ubuntu 24.04 (we tried OnStartPlayInEditor() as well). It is called when running the same binary package on Ubuntu 22.04 or when building o3de engine from source on Ubuntu 24.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical Critical priority. Must be actively worked on as someone's top priority right now. sig/simulation Categorizes an issue or PR as relevant to SIG Simulation triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants