Skip to content

Commit ffdec5b

Browse files
committed
review comment
Signed-off-by: Michał Pełka <michal.pelka@robotec.ai>
1 parent 105b00a commit ffdec5b

3 files changed

Lines changed: 19 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ set(msg_files
3333
)
3434

3535
set(srv_files
36+
"srv/BatchSpawnEntities.srv"
3637
"srv/DeleteEntity.srv"
3738
"srv/GetAvailableWorlds.srv"
3839
"srv/GetCurrentWorld.srv"

msg/SimulatorFeatures.msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ uint8 WORLD_UNLOADING = 43 # Supports UnloadWorld interface
3838
uint8 WORLD_INFO_GETTING = 44 # Supports GetCurrentWorld interface
3939
uint8 AVAILABLE_WORLDS = 45 # Supports GetAvailableWorlds interface
4040

41-
uint8 SPAWNING_ARRAY = 50 # Support array spawning (SpawnEntities)
41+
uint8 SPAWNING_BATCH = 50 # Support batch spawning (SpawnEntities)
4242

4343
uint16[] features # A list of simulation features as specified by the list above.
4444

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
1-
# Spawn entities (a robot, other object) by name or URI
2-
# Support for this interface is indicated through the SPAWNING_ARRAY value in GetSimulationFeatures.
1+
# Spawn entities (a robot, other object) by name or URI in a batch.
2+
# Support for this interface is indicated through the SPAWNING_BATCH value in GetSimulationFeatures.
33

44
string names[] # A list of names given to every entity
55
# If string is empty, a name field in the uri file or resource_string will be used,
66
# if supported and not empty (e.g. "name" field in SDFormat, URDF).
77
# If the name is still empty or not unique (as determined by the simulator),
88
# the service returns a generated name in the entity_name response field if the
99
# allow_renaming field is set to true. Otherwise, the service call fails and an
10-
# error is returned.
10+
# error is returned.
1111
bool allow_renaming[] # Determines whether the spawning succeeds with a non-unique name.
1212
# If it is set to true, the user should always check entity_name response field
13-
# and use it for any further interactions.
13+
# and use it for any further interactions. Number of elements have to match Number
14+
# of elements in names.
1415

1516
Resource entity_resources[] # List of resources such as SDFormat, URDF, USD or MJCF file, a native prefab, etc.
1617
# Valid URIs can be determined by calling GetSpawnables first.
1718
# Check simulator format support via the spawn_formats field in GetSimulatorFeatures.
1819
# Using resource_string is supported if GetSimulatorFeatures includes
19-
# the SPAWNING_RESOURCE_STRING feature.
20+
# the SPAWNING_RESOURCE_STRING feature. Number of elements have to match Number
21+
# of elements in names.
2022

21-
string entity_namespaces[] # Spawn entities with theirs interfaces under those namespaces.
23+
string entity_namespaces[] # Spawn entities with theirs interfaces under those namespaces. Number of elements have to match Number
24+
# of elements in names.
2225
geometry_msgs/PoseStamped initial_poses[] # Array of initial poses for every enttiy.
2326
# The header contains a reference frame, which defaults to global "world" frame.
2427
# This frame must be known to the simulator, e.g. of an object spawned earlier.
25-
# The timestamp field in the header is ignored.
28+
# The timestamp field in the header is ignored. Number of elements have to match Number
29+
# of elements in names.
2630

2731
---
2832

2933
# Additional result.result_code values for this service. Check result.error_message for further details.
30-
uint8 NAME_NOT_UNIQUE = 101 # Given name is already taken by entity and allow_renaming is false.
31-
uint8 NAME_INVALID = 102 # Given name is invalid in the simulator (e.g. does not meet naming
32-
# requirements such as allowed characters). This is also returned if name is
33-
# empty and allow_renaming is false.
34-
uint8 UNSUPPORTED_FORMAT = 103 # Format for uri or resource string is unsupported. Check supported formats
35-
# through GetSimulatorFeatures service, in spawn_formats field.
36-
uint8 NO_RESOURCE = 104 # Both uri and resource string are empty.
37-
uint8 NAMESPACE_INVALID = 105 # Namespace does not meet namespace naming standards.
38-
uint8 RESOURCE_PARSE_ERROR = 106 # Resource file or string failed to parse.
39-
uint8 MISSING_ASSETS = 107 # At least one of resource assets (such as meshes) was not found.
40-
uint8 UNSUPPORTED_ASSETS = 108 # At least one of resource assets (such as meshes) is not supported.
41-
uint8 INVALID_POSE = 109 # initial_pose is invalid, such as when the quaternion is invalid or position
42-
# exceeds simulator world bounds.
4334

44-
Result results[]
35+
uint8 BATCH_SPAWN_MISMATCH = 110 # There is a mismatch in number of elements in names, allow_renaming, entity_resources,
36+
# entity_namespaces, initial_poses.
37+
uint8 BATCH_SPAWN_FAILED = 120 # There was at least one failed spawn request. Check individual results in results.
38+
39+
Result result # If all spawning request succeeded it will give RESULT_OK or BATCH_SPAWN_FAILED
40+
Result results[] # Individual spawn request results. Supported return codes are in SpanwEntity.srv.
4541
string entity_names[] # List of names of spawned entities, guaranteed to be unique in the simulation.
4642
# If allow_renaming is true, it may differ from the request name field.

0 commit comments

Comments
 (0)