Expose blocked Move tracker initialization

This commit is contained in:
Meta Vens 2026-07-13 00:44:16 +01:00
commit 964f05ba2d
2 changed files with 55 additions and 0 deletions

View file

@ -4795,6 +4795,13 @@ fn start_psmoveapi_tracker_worker(
let (sender, receiver) = mpsc::sync_channel(1);
let (health_sender, health_receiver) = mpsc::sync_channel(1);
thread::spawn(move || {
let _ = health_sender.try_send(MuninnMoveTrackerHealthRecord {
health_id: format!("muninn:{host_id}:{camera_id}:move-tracker-health"), host_id: host_id.clone(), camera_id: camera_id.clone(), camera_index,
state: "opening".to_string(), camera_name: String::new(), camera_api: String::new(), width: 0, height: 0, exposure,
calibrated_controller_count: 0, update_count: 0, observation_count: 0, latest_observation_count: 0,
last_observation_at: String::new(), detail: "waiting for PSMoveAPI tracker initialization".to_string(),
updated_at: timestamp().unwrap_or_else(|_| "unix-0".to_string()),
});
let mut tracker = match PSMOVE_API_TRACKER_AUTHORITY
.lock()
.map_err(|_| "PSMoveAPI tracker authority lock was poisoned".to_string())

View file

@ -0,0 +1,48 @@
use anyhow::{Context, Result};
use cultmesh_rs::{CultMesh, CultMeshNodeOptions};
use odin_core::{MuninnMoveTrackerHealthRecord, OdinDocuments};
use std::{env, path::PathBuf};
fn main() -> Result<()> {
let store = PathBuf::from(
env::args()
.nth(1)
.context("usage: dump_move_tracker_health STORE")?,
);
let node = CultMesh::create_node(
&store,
OdinDocuments,
CultMeshNodeOptions {
runtime_id: "odin-dump-move-tracker-health".to_string(),
pull_on_start: true,
},
)
.with_context(|| format!("opening {}", store.display()))?;
let mut records = node
.cache()
.get_all::<MuninnMoveTrackerHealthRecord>()
.unwrap_or_default();
records.sort_by(|left, right| left.camera_id.cmp(&right.camera_id));
for record in records {
println!(
"camera={} index={} state={} backend={}/{} size={}x{} exposure={} calibrated={} updates={} observations={} latest={} last_observation={} updated={} detail={}",
record.camera_id,
record.camera_index,
record.state,
record.camera_api,
record.camera_name,
record.width,
record.height,
record.exposure,
record.calibrated_controller_count,
record.update_count,
record.observation_count,
record.latest_observation_count,
record.last_observation_at,
record.updated_at,
record.detail,
);
}
Ok(())
}