Skip to content

Add ATR mavlink messages#2

Open
vlad-serbanica wants to merge 1 commit into
Dronecode:mainfrom
vlad-serbanica:add-atr-support
Open

Add ATR mavlink messages#2
vlad-serbanica wants to merge 1 commit into
Dronecode:mainfrom
vlad-serbanica:add-atr-support

Conversation

@vlad-serbanica

@vlad-serbanica vlad-serbanica commented Jun 2, 2026

Copy link
Copy Markdown

This PR adds an initial version of MAVLink messages for supporting ATR integration with AMC and other consumers.

Sequence example:

Drone processes frame F=12345, algorithm finds 3 targets. Drone emits, in order:

ATR_FRAME_INFO  { frame_id=12345, num_detections=3, frame_width=1920, frame_height=1080, sensor_id=0, ... }
ATR_DETECTION   { frame_id=12345, track_id=42, bbox=(810,420,120,80), class=MBT_1, confidence=87, status=ACTIVE }
ATR_DETECTION   { frame_id=12345, track_id=43, bbox=(1100,500,60,40), class=IFV_2, confidence=72, status=ACTIVE }
ATR_DETECTION   { frame_id=12345, track_id=44, bbox=(300,300,200,150), class=STRUCTURE, confidence=91, status=NEW }

Frame F=12346 — algorithm runs, finds nothing. Drone still emits:

ATR_FRAME_INFO { frame_id=12346, num_detections=0, ... }
That "empty header" is useful — it tells the consumer "I processed this frame, found nothing" vs. "you just didn't hear from me." Without it, silence is ambiguous.

Consumer-side state machine (the AMC video pipeline)

on receive ATR_FRAME_INFO(F, n, ...):
    state[F] = { expected: n, received: [], frame_meta: ... }

on receive ATR_DETECTION(F, ...):
    if F not in state: state[F] = { expected: ?, received: [], frame_meta: null }   # detection arrived first
    state[F].received.append(detection)

on video decoder produces frame F:
    if F in state and state[F].complete():
        render(frame, state[F].received)
    else:
        wait up-to-jitter-budget, then render with what we have
    drop state[F]

complete() is true when received.length == expected and frame_meta != null. The structure makes "we received the partial-burst" detectable without any timestamp arithmetic.

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