-
Notifications
You must be signed in to change notification settings - Fork 14
Add array spawn service. #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||||||||||||||||||||||||
| # Spawn entities (a robot, other object) by name or URI in a batch. | ||||||||||||||||||||||||||||
| # Support for this interface is indicated through the SPAWNING_BATCH value in GetSimulationFeatures. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| string names[] # A list of names given to every entity | ||||||||||||||||||||||||||||
| # If string is empty, a name field in the uri file or resource_string will be used, | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| # if supported and not empty (e.g. "name" field in SDFormat, URDF). | ||||||||||||||||||||||||||||
| # If the name is still empty or not unique (as determined by the simulator), | ||||||||||||||||||||||||||||
| # the service returns a generated name in the entity_name response field if the | ||||||||||||||||||||||||||||
| # allow_renaming field is set to true. Otherwise, the service call fails and an | ||||||||||||||||||||||||||||
| # error is returned. | ||||||||||||||||||||||||||||
| bool allow_renaming[] # Determines whether the spawning succeeds with a non-unique name. | ||||||||||||||||||||||||||||
| # If it is set to true, the user should always check entity_name response field | ||||||||||||||||||||||||||||
| # and use it for any further interactions. Number of elements have to match Number | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| # of elements in names. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Resource entity_resources[] # List of resources such as SDFormat, URDF, USD or MJCF file, a native prefab, etc. | ||||||||||||||||||||||||||||
| # Valid URIs can be determined by calling GetSpawnables first. | ||||||||||||||||||||||||||||
| # Check simulator format support via the spawn_formats field in GetSimulatorFeatures. | ||||||||||||||||||||||||||||
| # Using resource_string is supported if GetSimulatorFeatures includes | ||||||||||||||||||||||||||||
| # the SPAWNING_RESOURCE_STRING feature. Number of elements have to match Number | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| # of elements in names. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| string entity_namespaces[] # Spawn entities with theirs interfaces under those namespaces. Number of elements have to match Number | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| # of elements in names. | ||||||||||||||||||||||||||||
| geometry_msgs/PoseStamped initial_poses[] # Array of initial poses for every enttiy. | ||||||||||||||||||||||||||||
| # The header contains a reference frame, which defaults to global "world" frame. | ||||||||||||||||||||||||||||
| # This frame must be known to the simulator, e.g. of an object spawned earlier. | ||||||||||||||||||||||||||||
| # The timestamp field in the header is ignored. Number of elements have to match Number | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| # of elements in names. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Additional result.result_code values for this service. Check result.error_message for further details. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| uint8 BATCH_SPAWN_MISMATCH = 110 # There is a mismatch in number of elements in names, allow_renaming, entity_resources, | ||||||||||||||||||||||||||||
| # entity_namespaces, initial_poses. | ||||||||||||||||||||||||||||
| uint8 BATCH_SPAWN_FAILED = 120 # There was at least one failed spawn request. Check individual results in results. | ||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these error codes start from a larger number (e.g. 150 or 200) so that there's more room for error codes in simulation_interfaces/srv/SpawnEntity.srv Lines 29 to 41 in 5af2e29
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Result result # If all spawning request succeeded it will give RESULT_OK or BATCH_SPAWN_FAILED | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| Result results[] # Individual spawn request results. Supported return codes are in SpanwEntity.srv. | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
| string entity_names[] # List of names of spawned entities, guaranteed to be unique in the simulation. | ||||||||||||||||||||||||||||
| # If allow_renaming is true, it may differ from the request name field. | ||||||||||||||||||||||||||||
|
michalpelka marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.