Skip to content

Commit 26d2361

Browse files
jhanca-robotecaimichalpelkaPawelLiberadzki
committed
External code review changes
Signed-off-by: Jan Hanca <[email protected]> Co-authored-by: Michał Pełka <[email protected]> Co-authored-by: Paweł Liberadzki <[email protected]> Signed-off-by: Jan Hanca <[email protected]>
1 parent 735bb3d commit 26d2361

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

rfcs/RFC Simulation Interfaces.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ As a rule of thumb, receiving encouraging feedback from long-standing project de
1414
### Summary:
1515
<!-- Single paragraph explanation of the feature -->
1616

17-
This RFC is a follow-up to an effort at [ros-simulation/simulation_interfaces](https://github.com/ros-simulation/simulation_interfaces/pull/1) to standardize simulation interfaces existing robotics simulators in [ROS 2](https://docs.ros.org/en/jazzy/index.html). Current implementation of similar interfaces is limited to `ROS2SpawnerComponent`, that utilizes *Gazebo* messages for ROS 2 communication. The messages were marked deprecated in the latest ROS 2 release and should be superseded. Proposed approach includes three new *Components* that will fulfill the design presented in [ros-simulation/simulation_interfaces](https://github.com/ros-simulation/simulation_interfaces/pull/1), and that are planned to be developed alongside updates to simulation interfaces. Backward compatibility will be ensured for `ROS2SpawnerComponent` and `ROS2ContactSensor` through CMake configuration with the deprecation information.
17+
This RFC is a follow-up to an effort at [ros-simulation/simulation_interfaces](https://github.com/ros-simulation/simulation_interfaces/pull/1) to standardize [ROS 2](https://docs.ros.org/en/jazzy/index.html) simulation interfaces for robotics simulators. Current implementation of similar interfaces is limited to `ROS2SpawnerComponent`, that utilizes *Gazebo* messages for ROS 2 communication. The messages were marked deprecated in the latest ROS 2 release and should be superseded. Proposed approach includes three new *Components* that will fulfill the design presented in [ros-simulation/simulation_interfaces](https://github.com/ros-simulation/simulation_interfaces/pull/1), and that are planned to be developed alongside updates to simulation interfaces. Backward compatibility will be ensured for `ROS2SpawnerComponent` and `ROS2ContactSensor` through CMake configuration with the deprecation information.
1818

1919

2020
### What is the relevance of this feature?
@@ -39,7 +39,7 @@ The following terminology that was created in [RFC-410](https://github.com/ros-i
3939
| --------- | -------------------------------------------------------------------------------- |
4040
| Spawnable | Robot or other object that can be spawned in simulation runtime. |
4141
| Entity | Spawned spawnable, it has a unique name. |
42-
| Bound | A region that is defined by an axis-aligned box shape, convex hull, or a sphere. |
42+
| Bounds | A volume that is defined by an axis-aligned box shape, convex hull, or a sphere. |
4343
| NamedPose | SE3 (translation and rotation) transform with a unique name |
4444
| Tag | A string that allows filtering entities and named poses |
4545

@@ -52,6 +52,7 @@ The implementation will be split into three (or more) system components:
5252
We will decouple the implementation of those features from their ROS 2 interfaces. Every manager will expose public methods that:
5353
- will be callable from C++,
5454
- will be handled through dedicated ROS 2 interface and exposed as service.
55+
5556
The purpose of that approach is to enable testability without the need for a ROS framework and ensure the whole system can be used with any middleware in the future.
5657

5758
# ROS 2 API
@@ -68,18 +69,17 @@ The following features are the subject of this RFC:
6869
- NAMED_POSES
6970
- POSE_BOUNDS
7071
- ENTITY_BOUNDS
72+
- ENTITY_TAGS
7173

7274
- ENTITY_STATE_LISTING
7375
- ENTITY_STATE_SETTING
7476

7577
- SIMULATION_RESET
7678
- SIMULATION_RESET_TIME
7779
- SIMULATION_RESET_SPAWNED
78-
- SIMULATION_RESET_STATE
79-
8080
- SIMULATION_PAUSE
8181

82-
The features *SIMULATION_RESET_STATE*, *STEP_SIMULATION_SINGLE*, *STEP_SIMULATION_MULTIPLE*, *STEP_SIMULATION_ACTION* will be introduced in the next RFC since they require multiple changes in the *PhysX Gem* and *AzPhysics API*. Action [SimulateSteps.action](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/action/SimulateSteps.action) will not be supported.
82+
The features *STEP_SIMULATION_SINGLE*, *STEP_SIMULATION_MULTIPLE*, and *STEP_SIMULATION_ACTION* will be introduced in the next RFC since they require multiple changes in the *PhysX Gem* and *AzPhysics API*. Action [SimulateSteps.action](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/action/SimulateSteps.action) will not be supported.
8383

8484
Only `[.spawnable]` format will be supported for spawning (field `spawn_formats` of [SimulatorFeatures.msg](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/msg/SimulatorFeatures.msg)). Other formats, such as `URDF` and `SDF`, are supported only in the Editor mode in ROS 2 Gem. Spawning `SDF` and `URDF` would require support for the Game mode:
8585
- handling mesh importing in game mode and preparing it to use with the *Mesh Feature Processor*,
@@ -121,6 +121,7 @@ A simulation interfaces user who calls the `GetSpawnables` service against GameL
121121
* the bound information copied from `Robots/FooRobot.SimulationInfo`,
122122
* tag list copied from `Robots/FooRobot.SimulationInfo`,
123123
* category copied from `Robots/FooRobot.SimulationInfo`.
124+
124125
Prepared response will be returned to the ROS 2 user.
125126

126127
## SpawnEntity service
@@ -193,8 +194,8 @@ Some of those methods respect calls to `TranformComponentRequests`, but some of
193194
| Kinematic PhysX Rigid Body | supports | | |
194195
| TransformComponent due to parent-child | supports | | |
195196
| TransformComponent (custom calls) | | | |
196-
| PhysX character component | | | ? |
197-
| PhysX ragdoll | | | ? |
197+
| PhysX character component | | | TBD |
198+
| PhysX ragdoll | | | TBD |
198199
| PhysX articulations | | | supports |
199200

200201
The correct API needs to be chosen to get the expected outcome it can be quite tricky.
@@ -240,14 +241,16 @@ Service definition: [DeleteEntity.srv](https://github.com/adamdbrw/simulation_in
240241
241242
The `AZ::EntityId` will be discovered by calling `SimulationInfoComponentRequestBus` with the name provided in the request. Next, the corresponding API will be called to despawn and remove the corresponding spawn ticket.
242243
243-
**Note:** This mechanism will allow to delete the entities that are part of the level prefab (e.g., prefab instantiated in Editor).
244+
**Note:** This mechanism will **not** allow to delete the entities that are the part of the level prefab (e.g., prefab instantiated in Editor).
244245
245246
## GetEntityBounds service
246247
247248
This service allows to get the bounds of the previously spawned entities. \
248249
Service definition: [GetEntityBounds.srv](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/srv/GetEntityBounds.srv)
249250
250-
The bound for the particular entity will be obtained by calling `SimulationInfoComponentRequestBus` with the name of the entity provided in the request. The information about entity's bounds will be stored within the `.simulationinfo` product asset, and it will be generated based on the source asset data provided by the simulation engineer.
251+
The bounds for the particular entity will be obtained by calling `SimulationInfoComponentRequestBus` with the name of the entity provided in the request. The information about entity's bounds will be stored within the `.simulationinfo` product asset, and it will be generated based on the source asset data provided by the simulation engineer.
252+
253+
**Note:** Convex hull bounds shape will not be supported in this implementation. This subject will be cover by another RFC when necessary.
251254
252255
## GetEntityInfo service
253256
@@ -269,12 +272,12 @@ This information will be obtained by calling a respective bus of `ROS 2 Named po
269272
270273
## GetNamedPoseBounds service
271274
272-
This service allows to get the boundaries defined in the predefined pose object. \
275+
This service allows to get the bounds defined in the predefined pose object. \
273276
Service definition [GetNamedPoseBounds.srv](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/srv/GetNamedPoseBounds.srv)
274277
275-
The information about the boundaries will be obtained by calling a respective bus of `ROS 2 Named poses manager`. Additionally, the aggregation will be filtered based on the parameters of the call. The boundaries of the pose will be predefined by a simulation expert using O3DE Editor by adding `TransformService` and dependent services `BoxShapeService` and `SphereShapeService` alongside with the `NamedPoseComponent`.
278+
The information about the bounds will be obtained by calling a respective bus of `ROS 2 Named poses manager`. Additionally, the aggregation will be filtered based on the parameters of the call. The bounds of the pose will be predefined by a simulation expert using O3DE Editor by adding `TransformService` and dependent services `BoxShapeService` and `SphereShapeService` alongside with the `NamedPoseComponent`.
276279
277-
**Note:** Convex hull bound shape will not be supported in this implementation. This subject will be cover by another RFC when necessary.
280+
**Note:** Convex hull bounds shape will not be supported in this implementation. This subject will be cover by another RFC when necessary.
278281
279282
## Reset Simulation service
280283
@@ -329,12 +332,12 @@ During this effort some components will be retired, and some moved outside of sc
329332
330333
The `ROS2SpawnerComponent` can co-exist with managers for *Simulation Interfaces* proposed in this RFC, but ROS 2 dependencies (namely `gazebo_msgs`) will be removed from upcoming ROS 2 distribution (`Kilted Kaiju`). The component will be marked deprecated (instead of completely removed from the codebase) to make the transition to Simulation Interfaces an easier experience. The component will be hidden away from users with the *CMake variable*. This variable will be first set to *enabled* by default, and toggled to *disabled* after the deprecation period into the retirement period. Finally, the component will be completely removed from ROS 2 Gem.
331334
332-
**Note:** Additional message during the *configure* step will be shown to the user if `gazebo_msgs` package is not detected, but the *variable* is set *true*.
335+
**Note:** Additional message during the *configure* step will be shown to the user if `gazebo_msgs` package is not detected, but the *variable* is set *enabled*.
333336
334337
Users of `Kilted Kaiju` (and newer) ROS 2 releases will be able to use the deprecated component by building the package manually in their custom ROS 2 workspace. This involves:
335338
- cloning and building the latest [gazebo_ros_pkgs/gazebo_msgs](https://github.com/ros-simulation/gazebo_ros_pkgs/tree/3.9.0/gazebo_msgs)
336339
- sourcing custom workspace
337-
- setting CMake flag
340+
- setting *CMake variable* (after deprecation period)
338341
- building ROS2 gem from source.
339342
340343
The deprecation period and the retirement period of the component are yet to be decided.
@@ -343,12 +346,12 @@ The deprecation period and the retirement period of the component are yet to be
343346
344347
The `ROS2ContactSensorComponent` is independent of *Simulation Interfaces* proposed in this RFC, but ROS 2 dependencies (namely `gazebo_msgs`) will be removed from upcoming ROS 2 distribution (`Kilted Kaiju`). In particular, this component uses [`ContactState` message](https://github.com/ros-simulation/gazebo_ros_pkgs/blob/3.9.0/gazebo_msgs/msg/ContactState.msg). The component will be hidden away from users with the *CMake variable*. This variable will be first set to *enabled* by default, and toggled to *disabled* after the deprecation period into the retirement period. Finally, the component will be completely removed from ROS 2 Gem.
345348
346-
**Note:** Additional message during the *configure* step will be shown to the user if `gazebo_msgs` package is not detected, but the *variable* is set *true*.
349+
**Note:** Additional message during the *configure* step will be shown to the user if `gazebo_msgs` package is not detected, but the *variable* is set to *enabled*.
347350
348351
Users of `Kilted Kaiju` (and newer) ROS 2 releases will be able to use the deprecated component by building the package manually in their custom ROS 2 workspace. This involves:
349352
- cloning and building the latest [gazebo_ros_pkgs/gazebo_msgs](https://github.com/ros-simulation/gazebo_ros_pkgs/tree/3.9.0/gazebo_msgs)
350353
- sourcing custom workspace
351-
- setting CMake flag
354+
- setting *CMake variable* (after deprecation period)
352355
- building ROS2 gem from source.
353356
354357
The deprecation period and the retirement period of the component are yet to be decided.
@@ -382,7 +385,9 @@ The *Simulation Interfaces* feature will build over the ROS 2 Gem. In particular
382385
### Are there any alternatives to this feature?
383386
<!-- - Provide any other designs that have been considered. Explain what the impact might be to not doing this.
384387
- If there is any prior art or approaches with other frameworks in the same domain, explain how they may have solved this problem or implemented this feature. -->
385-
The effort needs to be taken to adjust the existing code to the deprecation of Gazebo Classic and `gazebo_msgs`. *ROS 2 Simulation Interfaces* are the upcoming simulation standard that was primarily designed by O3DE *sig-simulation* developers. It will be integrated into all simulation engines and, therefore, it makes no sense to
388+
The effort needs to be taken to adjust the existing code to the deprecation of Gazebo Classic and `gazebo_msgs`. *ROS 2 Simulation Interfaces* are the upcoming simulation standard that was primarily designed by O3DE *sig-simulation* developers. It will be integrated into all major simulation engines and, therefore, should be integrated into O3DE.
389+
390+
The proposed approach allows for a smooth transition from the previous implementation to the standard. We are open for suggestions on the architecture of the O3DE integration.
386391
387392
388393
### How will users learn this feature?

0 commit comments

Comments
 (0)