Skip to content

Add per-marker size configuration for STag pose estimation#285

Open
RokPre wants to merge 7 commits into
UbiquityRobotics:jazzy-develfrom
RokPre:jazzy-devel
Open

Add per-marker size configuration for STag pose estimation#285
RokPre wants to merge 7 commits into
UbiquityRobotics:jazzy-develfrom
RokPre:jazzy-devel

Conversation

@RokPre

@RokPre RokPre commented Apr 28, 2026

Copy link
Copy Markdown

This pull request adds support for using different physical sizes for different STag IDs.

Previously, stag_detect assumed a single global marker_size for all detected markers. That worked only
when every marker in the environment had the same printed size. With this change, the node can
optionally load a YAML config file that maps marker IDs to sizes, and use the configured size for pose
estimation on a per-marker basis.

This allows mixed deployments such as:

  • larger markers for long-range detection
  • smaller markers for close-range detection

Implementation summary:

  • adds a new config_file parameter to stag_detect
  • loads marker sizes from YAML at startup into an id -> size map
  • uses the configured size for each detected marker when building the marker’s 3D corner model before
    pose estimation
  • keeps marker_size as the fallback when a marker ID is not listed in the config
  • uses a square-marker PnP path for pose estimation

Example config:

default_marker_size: 0.175
markers:
- id: 0
size: 0.175
- id: 5
size: 0.09
- id: 6
size: 0.09

Example launch usage:

ros2 launch stag_detect stag_detect.launch.py config_file:=/path/to/marker_sizes.yaml

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.

1 participant