refactor: running and killing ros2 processes #581
Merged
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.
Purpose
Current implementation of running and shutting down ros2 stack gives little control from python level.
Besides that i refactored simulation config logic as it was not best suited for current code.
the SimulationConfig contained both entities which is required for scene setup and settings for simulation and robotic stack which are needed only when launching. This was not the cleanest by itself but also resulted in confusing configurations:
Proposed Changes
Introduced Ros2LaunchManager which manages the launching and shutting down of ros nodes via LaunchService object from ros2 api.
Field
robotic_stack_command
removed from o3de_config as it was weird that user need to provide this. Now it is LaunchDescription is assigned to benchmarks.Refactored Simulation config that into:
O3DExROS2SimulationConfig is now without
robotic_stack_command
field as it no longer neededIssues
#571
Testing
python src/rai_bench/rai_bench/examples/test_models.py
with settings: