feat: Populate scene using batch spawning#41
Conversation
f99172c to
51eda9e
Compare
c665064 to
688d9e3
Compare
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
688d9e3 to
743de23
Compare
zakmat
left a comment
There was a problem hiding this comment.
Great work and I really like such optimizations!
Can you ensure the units test are working? I have put some statically noticed things as comments - havent run the build myself
| offset_yaw = 0.0 | ||
|
|
||
| simulation_name = self.spawn_on_spot( | ||
| req = self.make_spawn_entity_msg_for_spot( |
There was a problem hiding this comment.
I left the old spawning function for spawning single objects, so the tests don't need updating - tests only spawned a small amount of objects for testing specific features, so they don't need it.
| for res in result.results: | ||
| if res.result.result != 1: | ||
| print(f"ERROR: {res.result.error_message}") | ||
| return [res.entity_name for res in result.results] |
There was a problem hiding this comment.
what is res.entity_name in case of failed spawn?
There was a problem hiding this comment.
We don't expect this function to fail, so correct error handling was not implemented here - I just modified the implementation so that it's compatible with the previous version in the codebase. That print was only for debugging.
If we wanted to handle those errors, we would have to refactor the code further and that should be in a seperate PR IMO.
| # No cwd override: the script path is project-root-relative and the script cd's | ||
| # into $DEMO_ROOT/sim itself. | ||
| cmd = "bash scripts/build_sim.sh" | ||
| inputs = ["scripts/build_sim.sh", "sim/Gem/Source/*", "sim/Gem/Include/*", "sim/Gem/CMakeLists.txt", "sim/Gem/gem.json", "sim/Gem/*.cmake"] |
There was a problem hiding this comment.
was the blanket solution necessary?
We could leave with that although its bit sad.
Notice sim/Gem/Source/* - this is fine for a single layer and will not recurse, right?
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
Signed-off-by: Kacper Dąbrowski <kacper.dabrowski@robotec.ai>
New simulation interfaces supports batch spawning, we can use it to populate the scene in a single frame.
A custom service handler for SpawnEntities is provided in the project gem for registering gripping points, in the same way as in #25 .
You can test using