Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #786 +/- ##
==========================================
+ Coverage 73.17% 73.39% +0.22%
==========================================
Files 82 82
Lines 3579 3590 +11
==========================================
+ Hits 2619 2635 +16
+ Misses 960 955 -5 ☔ View full report in Codecov by Sentry. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Proposed Changes
src/rai_core/rai/communication/ros2/connectors/base.pyAdded
context: Optional[int | rclpy.Context] = NonetoROS2BaseConnector.__init__None(default)rclpy.init/ROS2Context)intrclpy.Context, initialises it withrclpy.init(context=..., domain_id=value), and owns it.shutdown()callsrclpy.shutdown(context=...)rclpy.Contextshutdown()leaves it untouchedOwnership is tracked via
_owns_context: bool. TheNode, executor (MultiThreadedExecutor/SingleThreadedExecutor), and TF buffer all receive the resolved context, so every ROS2 primitive participates in the correct DDS domain.src/rai_sim/rai_sim/o3de/o3de_bridge.pydomain_id: Optional[int] = NonetoO3DExROS2SimulationConfig. When set,_launch_binaryinjectsROS_DOMAIN_IDinto the O3DE subprocess environment so the simulator joins the right domain.launch_robotic_stackgains a matchingdomain_id: Optional[int] = Noneparameter, forwarded toROS2LaunchManager.start.src/rai_sim/rai_sim/launch_manager.pystart()and_run_process()acceptdomain_id: Optional[int] = None. The child process setsos.environ["ROS_DOMAIN_ID"]before the launch service starts, so every node in theLaunchDescriptionjoins the intended domain.tests/rai_sim/test_o3de_bridge.pytest_launch_binary: updated expectedPopencall to includeenv=ANY.test_launch_robotic_stack: updated expectedmanager.startcall to includedomain_id=None.Issues
Testing
All 18 tests in
tests/rai_sim/test_o3de_bridge.pypass.Running two parallel sim instances on different domains: