You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/RFC Simulation Interfaces.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ As a rule of thumb, receiving encouraging feedback from long-standing project de
14
14
### Summary:
15
15
<!-- Single paragraph explanation of the feature -->
16
16
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.
18
18
19
19
20
20
### 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
| Spawnable | Robot or other object that can be spawned in simulation runtime. |
41
41
| 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. |
43
43
| NamedPose | SE3 (translation and rotation) transform with a unique name |
44
44
| Tag | A string that allows filtering entities and named poses |
45
45
@@ -52,6 +52,7 @@ The implementation will be split into three (or more) system components:
52
52
We will decouple the implementation of those features from their ROS 2 interfaces. Every manager will expose public methods that:
53
53
- will be callable from C++,
54
54
- will be handled through dedicated ROS 2 interface and exposed as service.
55
+
55
56
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.
56
57
57
58
# ROS 2 API
@@ -68,18 +69,17 @@ The following features are the subject of this RFC:
68
69
- NAMED_POSES
69
70
- POSE_BOUNDS
70
71
- ENTITY_BOUNDS
72
+
- ENTITY_TAGS
71
73
72
74
- ENTITY_STATE_LISTING
73
75
- ENTITY_STATE_SETTING
74
76
75
77
- SIMULATION_RESET
76
78
- SIMULATION_RESET_TIME
77
79
- SIMULATION_RESET_SPAWNED
78
-
- SIMULATION_RESET_STATE
79
-
80
80
- SIMULATION_PAUSE
81
81
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.
83
83
84
84
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:
85
85
- 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
121
121
* the bound information copied from `Robots/FooRobot.SimulationInfo`,
122
122
* tag list copied from `Robots/FooRobot.SimulationInfo`,
123
123
* category copied from `Robots/FooRobot.SimulationInfo`.
124
+
124
125
Prepared response will be returned to the ROS 2 user.
125
126
126
127
## SpawnEntity service
@@ -193,8 +194,8 @@ Some of those methods respect calls to `TranformComponentRequests`, but some of
193
194
| Kinematic PhysX Rigid Body | supports |||
194
195
| TransformComponent due to parent-child | supports |||
195
196
| TransformComponent (custom calls) ||||
196
-
| PhysX character component |||? |
197
-
| PhysX ragdoll |||? |
197
+
| PhysX character component |||TBD|
198
+
| PhysX ragdoll |||TBD|
198
199
| PhysX articulations ||| supports |
199
200
200
201
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
240
241
241
242
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.
242
243
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).
244
245
245
246
## GetEntityBounds service
246
247
247
248
This service allows to get the bounds of the previously spawned entities. \
248
249
Service definition: [GetEntityBounds.srv](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/srv/GetEntityBounds.srv)
249
250
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.
251
254
252
255
## GetEntityInfo service
253
256
@@ -269,12 +272,12 @@ This information will be obtained by calling a respective bus of `ROS 2 Named po
269
272
270
273
## GetNamedPoseBounds service
271
274
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. \
273
276
Service definition [GetNamedPoseBounds.srv](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/srv/GetNamedPoseBounds.srv)
274
277
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`.
276
279
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.
278
281
279
282
## Reset Simulation service
280
283
@@ -329,12 +332,12 @@ During this effort some components will be retired, and some moved outside of sc
329
332
330
333
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.
331
334
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*.
333
336
334
337
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:
335
338
- cloning and building the latest [gazebo_ros_pkgs/gazebo_msgs](https://github.com/ros-simulation/gazebo_ros_pkgs/tree/3.9.0/gazebo_msgs)
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
343
346
344
347
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.
345
348
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*.
347
350
348
351
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:
349
352
- cloning and building the latest [gazebo_ros_pkgs/gazebo_msgs](https://github.com/ros-simulation/gazebo_ros_pkgs/tree/3.9.0/gazebo_msgs)
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
382
385
### Are there any alternatives to this feature?
383
386
<!-- - Provide any other designs that have been considered. Explain what the impact might be to not doing this.
384
387
- 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.
0 commit comments