Skip to content

Commit 105b00a

Browse files
committed
Add array spawn service.
Signed-off-by: Michał Pełka <michal.pelka@robotec.ai>
1 parent cb76e09 commit 105b00a

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

msg/SimulatorFeatures.msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ 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)
42+
4143
uint16[] features # A list of simulation features as specified by the list above.
4244

4345
# A list of additional supported formats for spawning, which might be empty. Values may include

srv/SpawnEntities.srv

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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.
3+
4+
string names[] # A list of names given to every entity
5+
# If string is empty, a name field in the uri file or resource_string will be used,
6+
# if supported and not empty (e.g. "name" field in SDFormat, URDF).
7+
# If the name is still empty or not unique (as determined by the simulator),
8+
# the service returns a generated name in the entity_name response field if the
9+
# allow_renaming field is set to true. Otherwise, the service call fails and an
10+
# error is returned.
11+
bool allow_renaming[] # Determines whether the spawning succeeds with a non-unique name.
12+
# If it is set to true, the user should always check entity_name response field
13+
# and use it for any further interactions.
14+
15+
Resource entity_resources[] # List of resources such as SDFormat, URDF, USD or MJCF file, a native prefab, etc.
16+
# Valid URIs can be determined by calling GetSpawnables first.
17+
# Check simulator format support via the spawn_formats field in GetSimulatorFeatures.
18+
# Using resource_string is supported if GetSimulatorFeatures includes
19+
# the SPAWNING_RESOURCE_STRING feature.
20+
21+
string entity_namespaces[] # Spawn entities with theirs interfaces under those namespaces.
22+
geometry_msgs/PoseStamped initial_poses[] # Array of initial poses for every enttiy.
23+
# The header contains a reference frame, which defaults to global "world" frame.
24+
# This frame must be known to the simulator, e.g. of an object spawned earlier.
25+
# The timestamp field in the header is ignored.
26+
27+
---
28+
29+
# 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.
43+
44+
Result results[]
45+
string entity_names[] # List of names of spawned entities, guaranteed to be unique in the simulation.
46+
# If allow_renaming is true, it may differ from the request name field.

0 commit comments

Comments
 (0)