o3de / sig-core

5 stars 6 forks source link

RFC - ROS2 Gem #33

Closed adamdbrw closed 2 years ago

adamdbrw commented 2 years ago

Summary:

O3DE will support robotic simulation through a dedicated Gem, providing components and tools which make it easier for ROS2 developers to migrate their projects to O3DE.

What is the relevance of this feature?

ROS2 is de facto standard in robotics, with a substantial and quickly growing user base. It supports numerous use-cases in robotics, both academic and industrial, and a variety of platforms such as warehouse logistics robots, agricultural robots, airborne drones, underwater platforms and autonomous vehicles. ROS2 Gem will encourage robotic communities to use O3DE.

Feature design description:

ROS2 Gem RFC can be seen in two perspectives:

  1. A bare minimum Gem - such as proposed in this PR.
  2. Feature set we would like ROS2 Gem to have. Some features have already been proposed (see this query). Each of these issues could benefit form SIG comments.

We can start with (1) first.

Features for the bare minimum Gem:

Discussion for (2) is very important as well and I would like to put that on the radar. The ROS2 Gem will include a number of components such as:

These will provide useful abstractions to be extendable with user types and custom implementations. The Gem should also include a number of Assets to start with (environment and robot models). The Gem should also include tools and extensions such as importing URDF files (and support in Asset Processor). A robotic simulation project template would be useful as well, as well as a demo/tutorial scene.

Technical design description:

For a bare minimum:

  1. ROS2 Gem includes a simple cmake function for project targets (which ROS2 packages does your target depend on?)
    • This allows the user to specify which ROS2 packages to include. Custom messages are a good example of a package that users would want to use with O3DE on the project level.
    • It should respect ROS2 packages visibility in a typical ROS2 fashion (through environment sourcing).
    • It will detect whether ROS2 is installed and sourced while building the Gem, warns and returns if this is not the case
  2. ROS2 Gem includes a simulation clock, which is necessary to correctly timestamp ROS2 messages produced by the simulation. Time source should work well with non-real time modes.
    • The clock publishes on /clock topic
    • The Gem system component should expose time-stamping interface
  3. ROS2 Gem provides an O3DE system component responsible for ROS2 initialization (rclcpp::init), creating the main simulation node, and listening for inbound ROS2 communication (rclcpp::spin).
    • For most users, a single-node approach is optimal, but users are not prevented from creating their own nodes.

What are the advantages of the feature?

Solution for common robotic simulation needs. Users don't need to implement the entire framework repeatedly. ROS2 community is attracted to O3DE.

What are the disadvantages of the feature?

To respect the ROS2 way, the environment needs to be sourced before the build.

How will this be implemented or integrated into the O3DE environment?

Since this is a separate Gem, the integration is quite straightforward.

Are there any alternatives to this feature?

Explain what the impact might be of not doing this.

O3DE would not be a good choice for robotic simulation.

Note that other game engines already have solutions for that.

How will users learn this feature?

Are there any open questions?

SelfishOlex commented 2 years ago

It's not clear if this gem will live outside of o3de's main repository or in it. Which one is it?

adamdbrw commented 2 years ago

My intention is that it will live inside the o3de repository.

adamdbrw commented 2 years ago

Sig-core has decided that the Gem should live here, at least for now.

lemonade-dm commented 2 years ago

The ROS2 Gem has been moved to their repo, so SIG-Core doesn't need to approve this RFC anymore

thefranke commented 2 years ago

@lgleim This I believe is now part of @o3de/sig-simulation ?