Skip to content

Factor out topic discovery pattern from managers #44

@rolker

Description

@rolker

Problem

Several managers in CAMP independently implement the same topic discovery pattern:

  • AISManager::scanForSources()
  • GridManager::scanForSources()
  • MarkersManager::scanForSources()

Each one creates a QTimer (1s interval), calls node_->get_topic_names_and_types(), filters by message type string, and subscribes to new matches while tracking seen topics in a map.

PlatformManager currently uses a hardcoded topic name instead of this pattern, but could benefit from discovery too.

Proposal

Factor the scan-and-subscribe pattern into a shared utility (e.g., a base class or helper in camp_ros) that managers can use with just a message type filter and a subscription callback. This would:

  • Eliminate duplicated boilerplate across 3+ managers
  • Make PlatformManager resilient to topic namespace changes
  • Provide a consistent pattern for future managers

Authored-By: Claude Code Agent
Model: Claude Opus 4.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions