Skip to content

Remove MultiThreadedExecutors and change cluster API#8

Merged
SamuelFoo merged 36 commits into
temp-masterfrom
fix/remove-multithreaded-executor
May 26, 2026
Merged

Remove MultiThreadedExecutors and change cluster API#8
SamuelFoo merged 36 commits into
temp-masterfrom
fix/remove-multithreaded-executor

Conversation

@SamuelFoo

@SamuelFoo SamuelFoo commented May 24, 2026

Copy link
Copy Markdown
Member

@SamuelFoo SamuelFoo marked this pull request as draft May 24, 2026 18:57
@SamuelFoo SamuelFoo self-assigned this May 24, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@SamuelFoo

Copy link
Copy Markdown
Member Author

Remember to squash and merge!

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

SamuelFoo added 2 commits May 25, 2026 05:02
- 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.
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@SamuelFoo SamuelFoo force-pushed the fix/remove-multithreaded-executor branch from 2a379a9 to 1a28dd1 Compare May 25, 2026 05:16
codescene-delta-analysis[bot]

This comment was marked as outdated.

…age, and remove unnecessary dependencies from package.xml
codescene-delta-analysis[bot]

This comment was marked as outdated.

@SamuelFoo SamuelFoo changed the title Remove multithreaded executor Remove multithreaded executor and API change for cluster-search May 25, 2026
@SamuelFoo SamuelFoo changed the title Remove multithreaded executor and API change for cluster-search Remove multithreaded executor and publish cluster stats for search termination May 25, 2026
…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.
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Excess Number of Function Arguments
ClusterPosesNode._start_subscribers has 5 arguments, max arguments = 4

Suppress

@SamuelFoo SamuelFoo force-pushed the fix/remove-multithreaded-executor branch from d4c46d3 to aab7788 Compare May 26, 2026 17:53
@SamuelFoo SamuelFoo force-pushed the fix/remove-multithreaded-executor branch from ae65ba5 to e928bf5 Compare May 26, 2026 19:19
@SamuelFoo

Copy link
Copy Markdown
Member Author
image

This was approved.

@SamuelFoo SamuelFoo changed the title Remove multithreaded executor and publish cluster stats for search termination Remove MultiThreadedExecutors and change cluster API May 26, 2026
@SamuelFoo SamuelFoo merged commit 810f352 into temp-master May 26, 2026
1 check passed
@SamuelFoo SamuelFoo deleted the fix/remove-multithreaded-executor branch May 26, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants