-
Notifications
You must be signed in to change notification settings - Fork 3
feat(cie_thread_configurator): spawn_cie_thread for non-ros2 thread #22
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
base: main
Are you sure you want to change the base?
Conversation
…lated rclcpp context Remove node dependency from spawn_cie_thread function and create an isolated rclcpp context within each spawned thread. This change allows threads to be spawned without requiring the caller to manage ROS node dependencies, while maintaining callback group registration capabilities through autonomous context initialization and shutdown. The implementation: - Initializes a dedicated rclcpp Context with auto logging disabled - Creates a temporary node for publishing callback group information - Properly shuts down the context after publishing - Executes the user-provided function with forwarded arguments - Simplifies the API by removing node parameter requirements Update sample application to demonstrate usage with a non-ROS worker thread that leverages the simplified spawn_cie_thread API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new spawn_cie_thread function that enables thread scheduling management for non-ROS2 worker threads by automatically creating an isolated rclcpp context within each spawned thread, eliminating the need for callers to provide a ROS node.
Key Changes:
- Added templated
spawn_cie_threadfunction to spawn threads with automatic CIE thread configurator integration - Created sample non-ROS process demonstrating standalone thread spawning
- Integrated
spawn_cie_threadinto existing sample node to demonstrate usage within ROS2 components
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cie_thread_configurator/include/cie_thread_configurator/cie_thread_configurator.hpp | Adds spawn_cie_thread template function with isolated rclcpp context creation |
| cie_sample_application/src/sample_non_ros_process.cpp | New sample demonstrating standalone non-ROS thread spawning |
| cie_sample_application/src/sample_node.cpp | Integrates spawn_cie_thread to spawn a non-ROS worker thread within the node |
| cie_sample_application/include/cie_sample_application/sample_node.hpp | Adds destructor and non-ROS thread member to SampleNode class |
| cie_sample_application/package.xml | Adds cie_thread_configurator dependency |
| cie_sample_application/CMakeLists.txt | Updates build configuration for cie_thread_configurator dependency and new executable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cie_thread_configurator/include/cie_thread_configurator/cie_thread_configurator.hpp
Outdated
Show resolved
Hide resolved
cie_thread_configurator/include/cie_thread_configurator/cie_thread_configurator.hpp
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cie_thread_configurator/include/cie_thread_configurator/cie_thread_configurator.hpp
Show resolved
Hide resolved
|
better? |
Description
This PR adds a new
spawn_cie_threadfunction that enables thread scheduling management for non-ROS2 worker threads. The function automatically creates an isolated rclcpp context within each spawned thread, allowing threads to publish their information to the CIE thread configurator without requiring the caller to provide a ROS node.Key Changes
NonRosThreadInfo.msgto distinguish non-ROS worker threads from ROS callback groupsThreadConfigfor both ROS callback groups and non-ROS threadsnon_ros_threadssection alongsidecallback_groupsRelated links
How was this PR tested?
Notes for reviewers