Skip to content

Commit 81f2b99

Browse files
astrawclaude
andcommitted
flo-bui: show the tracked distance in the phone view (Claude Opus 5)
Follow-up to the phone view. Standing next to FLO, the one number worth having is how far away the thing it is tracking is: it says whether FLO has a subject at a plausible range at all, and it is what the focus follows. Shown at the readout size the full UI's Info block uses, and formatted the same way, rather than as another line of small text beside the mode -- it is read at arm's length. An em dash when there is no estimate, which is a monocular deployment or no pair of detections yet. Deliberately the stereopsis measurement and not the home position's distance, which is a setting. Checked in a browser against the hardware-free simulation, with the synthetic source sweeping the distance: the readout follows it (1.31m, 2.00m, 2.40m) and agrees with the full UI's Info block down to the formatting. The frame counter asked for alongside this is not here: the live view is strand-braid's `CamPreview`, which knows each frame's number but hands its host nothing, so a counter needs either a prop added there or a preview component of our own. Left for a separate decision. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 173e3f8 commit 81f2b99

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ standing next to FLO and nothing else:
199199
tracking cameras' MP4s beside it. That checkbox is the same setting the full
200200
UI carries and defaults to on.
201201
- **Set Home**, **Go Home** and **Track**.
202+
- The stereopsis **Distance**, or an em dash when there is no estimate — a
203+
monocular deployment, or no pair of detections yet.
202204
- A small live view of the main tracking camera.
203205
- The current mode, with the same liveness dot the full UI's Info block has.
204206

‎crates/flo-bui/src/mobile.rs‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,38 @@ impl App {
4242
<Button title="Track" onsignal={ctx.link().callback(|_| Msg::SwitchToClosedLoop)}/>
4343
</div>
4444
</div>
45+
{ self.mobile_distance() }
4546
{ self.mobile_preview() }
4647
</div>
4748
}
4849
}
4950

51+
/// How far away the thing being tracked is, as stereopsis measures it.
52+
///
53+
/// The one number worth having out here: it says whether FLO has a subject
54+
/// at a plausible range, and it is what the focus follows. Shown at the
55+
/// readout size the full UI uses rather than as another line of small text,
56+
/// because it is read at arm's length.
57+
///
58+
/// An em dash when there is no estimate — a monocular deployment, or no
59+
/// pair of detections yet. Deliberately not the home position's distance,
60+
/// which is a setting rather than a measurement.
61+
fn mobile_distance(&self) -> Html {
62+
let distance = match self
63+
.last_state
64+
.as_ref()
65+
.and_then(|state| state.stereopsis_state.as_ref())
66+
{
67+
Some(stereopsis) => format!("{:.2}m", stereopsis.dist),
68+
None => crate::NO_DATA.to_string(),
69+
};
70+
html! {
71+
<div class="border-1px">
72+
{ crate::qqblock("Distance", distance) }
73+
</div>
74+
}
75+
}
76+
5077
/// The one readout the phone view keeps: which mode FLO is in, beside the
5178
/// liveness dot.
5279
///

0 commit comments

Comments
 (0)