Skip to content

Commit 2b18eda

Browse files
committed
WIP
Signed-off-by: Michał Pełka <[email protected]>
1 parent 2e3930d commit 2b18eda

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

rfcs/RFC Simulation Interfaces.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,97 @@ Standardization would improve user experience when using their validation, testi
3131
3232
- If there is any new terminology, it should be defined here. -->
3333

34+
The ROS 2 simulator that is compatible with simulation interfaces has a number of requirements to follow.
35+
36+
It needs to advertise supported features via the ROS 2 service [GetSimulatorFeatures.srv](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/srv/GetSimulatorFeatures.srv)
37+
That service in its response provides the caller with a list of features [SimulatorFeatures.msg](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/msg/SimulatorFeatures.msg)
38+
In this RFC we are proposing to support the following features:
39+
40+
- SPAWNING
41+
- DELETING
42+
- NAMED_POSES
43+
- POSE_BOUNDS
44+
- ENTITY_BOUNDS
45+
46+
- ENTITY_STATE_LISTING
47+
- ENTITY_STATE_SETTING
48+
49+
- SIMULATION_RESET
50+
- SIMULATION_RESET_TIME
51+
- SIMULATION_RESET_SPAWNED
52+
53+
- SIMULATION_PAUSE
54+
55+
We do not plan to support the moment:
56+
- SIMULATION_RESET_STATE
57+
- STEP_SIMULATION_SINGLE
58+
- STEP_SIMULATION_MULTIPLE
59+
- STEP_SIMULATION_ACTION
60+
61+
Following formats will be supported for spawnaning (field `spawn_formats` of [SimulatorFeatures.msg](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/msg/SimulatorFeatures.msg)):
62+
```
63+
[`.spawnables`]
64+
```
65+
66+
**Note** other formats e.g. `URDF` and `SDF` are supported by ROS 2 Gem but only in Editor.
67+
Those tools are not available in the game mode, so spawning `SDF` and `URDF` would require:
68+
- Handling mesh importing in Game Launcher and preparing it to use with Mesh Feature processor
69+
- Creating materials and texture assets in runtime
70+
- PhysX (or other Physics engine) collider mesh cooking with decomposition.
71+
72+
Such feature, would be usefull, but it is out of scope of this RFC.
73+
3474
### Technical design description:
3575

76+
Spawning, gathering information and despawning will be carried by
77+
`ROS 2 Entity manager`.
78+
This manager will be a system component that will be part of ROS 2 Gem.
79+
It will advertise following services:
80+
81+
#### GetSpawnables
82+
Service definition : [GetSpawnables](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/srv/GetSpawnables.srv)
83+
```
84+
# Return a list of resources which are valid as SpawnEntity uri fields (e.g. visible to or registered in simulator).
85+
# This interface is an optional extension and might not be implemented by your simulator, check the result_code.
86+
87+
string[] sources # Optional field for additional sources (local or remote) to search.
88+
# By default, each simulator has visibility of spawnables through
89+
# some mechanisms, e.g. a set of paths, registered assets etc.
90+
# Since the simulator cannot possibly look everywhere,
91+
# this field allows the user to specify additional sources.
92+
# Unrecognized values are listed as such in the result.error_message,
93+
# but do not hinder success of the response.
94+
# Sources may include subcategories and be simulator-specific.
95+
96+
---
97+
98+
Result result
99+
Spawnable[] spawnables # Spawnable objects with URI and additional information.
100+
```
101+
Definition of individual spawnable [Spawnable.msg](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/msg/Spawnable.msg)
102+
```
103+
# Robot or other object which can be spawned in simulation runtime.
104+
105+
string uri # URI which will be accepted by SpawnEntity service.
106+
string description # Optional description for the user, e.g. "robot X with sensors A,B,C".
107+
Bounds spawn_bounds # Optional spawn area bounds which fully encompass this object.
108+
```
109+
110+
This service is advertising available spawnables that can be used in simulation.
111+
We will take asset catalog to find spawnables.
112+
There is usefull API in the Engine to get products assets:
113+
```cpp
114+
AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequests::EnumerateAssets, nullptr, enumerateCallback, nullptr);
115+
```
116+
Asset catalog contains product assets (such as spawnables, azmodel, azbuffer).
117+
We will introduce a product assets called `SimulationInfo`.
118+
119+
120+
121+
#### GetEntitiesStates
122+
Service definition : [GetEntitiesStates](https://github.com/adamdbrw/simulation_interfaces/blob/simulation_interfaces/srv/SetEntityState.srv)
123+
-
124+
36125
<!-- - Explain the technical portion of the work in enough detail that members can implement the feature.
37126
38127
- Explain any API or process changes required to implement this feature

0 commit comments

Comments
 (0)