Conversation
Signed-off-by: Michał Pełka <michal.pelka@robotec.ai>
jhanca-robotecai
left a comment
There was a problem hiding this comment.
Please bump the version of the package.
peci1
left a comment
There was a problem hiding this comment.
Hmm, I don't like this approach of making each field an array. However, given the fact that a service request (IMO) cannot be reused elsewhere, it is probably the best possible solution without going awkward (like specifying a standalone message type for the request part).
Please, see the inline comments.
I guess version bumps are done when releasing the package, so I wouldn't expect the bump to be a part of this PR. |
|
Hi @michalpelka, when you get a chance could you review the comments by @peci1? Once we have those resolved I think it would be good to merge this in soon! |
Signed-off-by: Michał Pełka <michal.pelka@robotec.ai>
peci1
left a comment
There was a problem hiding this comment.
A few style changes and more info, but otherwise it looks good now!
Co-authored-by: Martin Pecka <peci1@seznam.cz>
| 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. |
There was a problem hiding this comment.
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
| # 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, |
There was a problem hiding this comment.
Is this saying the names array can be empty or that individual elements of the array can be the empty string?
|
At a high level I have a few questions. I agree that the parallel construction of arrays in this case doesn't really make sense. It would make more sense to support a single array with all the variables captured in a single message aka make simulation_interfaces/srv/SpawnEntity.srv Lines 4 to 25 in 5af2e29 into SpawningEntity.msg and then have SpawnEntities contain And if we do that. Is there a reason to support two interfaces one for a single entity and one for batch processing. Can the single entity not just be the redundant case of multiple entities where the iterator is just length 1. If the message is supporting multiple entities, then you can also group the return type as per entity and return an array of { Results + name } => With a multiple entity spawning capability defined this way I would then suggest deprecating the singular version of the interface as it will increase the burden for all implementations. And for the deprecation cycle the implementers can provide backwards compatibilty by wrapping the single version into an array and reuse the batch processing interface. |
At least in CLI usage there may be a big difference. Usually tab completion just completes an empty array and that's it. |
Simulation interfaces can be used to populate scene with assets or props, depending on the scenario.
I would like to propose the way to ask underlying simulator to spawn multiple objects.
Motivation: