inference/
plugin.rs

1use bevy::prelude::*;
2use sim_core::ModeSet;
3use vision_core::interfaces::DetectionResult;
4
5#[derive(Resource, Default)]
6pub struct InferenceState {
7    pub last: Option<DetectionResult>,
8}
9
10fn inference_stub(mut state: ResMut<InferenceState>) {
11    // Placeholder: real inference scheduling/polling to be implemented.
12    if state.last.is_none() {
13        state.last = Some(DetectionResult {
14            frame_id: 0,
15            positive: false,
16            confidence: 0.0,
17            boxes: Vec::new(),
18            scores: Vec::new(),
19        });
20    }
21}
22
23/// Placeholder plugin for inference systems; to be wired when Burn detector is ready.
24pub struct InferencePlugin;
25
26impl Plugin for InferencePlugin {
27    fn build(&self, app: &mut App) {
28        app.insert_resource(InferenceState::default())
29            .configure_sets(Update, (ModeSet::Inference,))
30            .add_systems(Update, inference_stub.in_set(ModeSet::Inference));
31    }
32}