Remove MultiThreadedExecutors and change cluster API#8
Merged
Conversation
- spike detection - race fix using guard_condition - reorg to reduce number of folders
…m cluster poses node
Member
Author
|
Remember to squash and merge! |
…proper interleaving and minimize PR changes
- Renamed `cluster_poses_node.py` to `cluster_poses_action_node.py` and implemented action server functionality for pose clustering. - Updated `CMakeLists.txt` to install the new action node and retain the original node for backward compatibility. - Enhanced `ClusterResult` class to include additional metrics: `num_cluster_poses` and `num_input_poses`. - Refactored `ClusterPosesNode` to remove action server logic and focus on data collection. - Introduced a new service node `ClusterPosesServiceNode` to handle service-triggered clustering with improved parameter management. - Added periodic clustering functionality to `ClusterPosesServiceNode` for continuous data processing. - Updated README.md to reflect changes in node usage and clarify the purpose of the new action node.
…ements are installed
2a379a9 to
1a28dd1
Compare
…age, and remove unnecessary dependencies from package.xml
…topic support - Introduced ClusterSortKey enum for consistent sorting of cluster results. - Refactored get_largest_cluster to get_all_clusters for retrieving all clusters. - Updated action and service nodes to handle multiple pose topics and return structured results. - Enhanced test cases to validate new functionality, including handling of multiple pose topics and empty results. - Adjusted message structures to accommodate new cluster result formats.
… in clustering logic
There was a problem hiding this comment.
Code Health Improved
(2 files improve in Code Health)
Gates Failed
Enforce advisory code health rules
(2 files with Excess Number of Function Arguments, Complex Conditional)
Gates Passed
3 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| cluster_poses_action_node.py | 1 advisory rule | 9.69 | Suppress |
| cluster_poses_node.py | 1 advisory rule | 8.96 → 9.69 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| cluster_poses_node.py | 8.96 → 9.69 | Complex Method, Bumpy Road Ahead |
| cluster_poses_service_node.py | 8.71 → 10.00 | Complex Method, Large Method, Bumpy Road Ahead |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Comment on lines
+195
to
+229
| def _start_subscribers( | ||
| self, | ||
| *, | ||
| odom_topic: str, | ||
| pose_topics: list[str], | ||
| sync_tolerance: float, | ||
| sync_queue_size: int | None = None, | ||
| max_detection_age_s: float = 0.0, | ||
| ) -> None: | ||
| """Subscribe to one odom topic and N pose topics, all feeding one buffer.""" | ||
| if not pose_topics: | ||
| raise ValueError("pose_topics must contain at least one topic") | ||
| self._max_detection_age_s = float(max_detection_age_s) | ||
| qsize = int(sync_queue_size or self._sync_queue_size) | ||
| self._odom_subscriber = Subscriber( | ||
| self, | ||
| Odometry, | ||
| odom_topic, | ||
| qos_profile=qos_profile_sensor_data, | ||
| ) | ||
| for topic in pose_topics: | ||
| pose_sub = Subscriber( | ||
| self, | ||
| PoseStamped, | ||
| topic, | ||
| qos_profile=qos_profile_sensor_data, | ||
| ) | ||
| self._pose_subscribers.append(pose_sub) | ||
| time_synchronizer = ApproximateTimeSynchronizer( | ||
| [self._odom_subscriber, pose_sub], | ||
| queue_size=qsize, | ||
| slop=float(sync_tolerance), | ||
| ) | ||
| time_synchronizer.registerCallback(self._synchronized_callback) | ||
| self._time_synchronizers.append(time_synchronizer) |
There was a problem hiding this comment.
❌ New issue: Excess Number of Function Arguments
ClusterPosesNode._start_subscribers has 5 arguments, max arguments = 4
d4c46d3 to
aab7788
Compare
ae65ba5 to
e928bf5
Compare
…nd remove unnecessary package installation
Member
Author
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.

rclpy.spinsince we got a performance jump by just switching to single threaded executor. (See Performance issues withMultiThreadedExecutorros2/rclpy#1452)