Skip to main content

Crate wifi_densepose_worldmodel

Crate wifi_densepose_worldmodel 

Source
Expand description

wifi-densepose-worldmodel — OccWorld thin-client bridge (ADR-147).

Bridges wifi_densepose_worldgraph PersonTrack history to the OccWorld Python inference subprocess and returns TrajectoryPriors that can be injected into the Kalman pose tracker.

§Quick start

use wifi_densepose_worldmodel::{
    OccWorldBridge, OccupancyWorldModelRequest, OccupancyGrid3D,
    SceneBoundsJson, worldgraph_to_occupancy,
};
use wifi_densepose_worldmodel::occupancy::{PersonPosition, SceneBounds};

let bridge = OccWorldBridge::new("/tmp/occworld.sock");

let bounds = SceneBounds { min_e: -10.0, min_n: -10.0, max_e: 10.0, max_n: 10.0 };
let persons = vec![
    PersonPosition { track_id: 1, east_m: 2.0, north_m: 3.0, up_m: 1.0 },
];
let frame = worldgraph_to_occupancy(&persons, &bounds, 0.1);

let request = OccupancyWorldModelRequest {
    past_frames: vec![frame],
    voxel_resolution_m: 0.1,
    scene_bounds: SceneBoundsJson {
        min_e: bounds.min_e, min_n: bounds.min_n,
        max_e: bounds.max_e, max_n: bounds.max_n,
    },
    prediction_steps: 15,
};

let response = bridge.predict(request).await?;
println!("confidence={:.2}", response.confidence);
for prior in &response.trajectory_priors {
    println!("track {} has {} waypoints", prior.track_id, prior.waypoints.len());
}

Re-exports§

pub use bridge::default_socket_path;
pub use bridge::OccWorldBridge;
pub use error::WorldModelError;
pub use occupancy::worldgraph_to_occupancy;

Modules§

bridge
Async Unix-socket client that sends an OccupancyWorldModelRequest to the OccWorld Python inference server and receives an OccupancyWorldModelResponse (ADR-147).
error
Error types for the OccWorld world-model bridge (ADR-147).
occupancy
Converts WorldGraph PersonTrack ENU positions into an OccupancyGrid3D tensor suitable for submission to the OccWorld inference server (ADR-147).

Structs§

OccupancyGrid3D
A 3-D occupancy grid whose voxel values are class indices (u8).
OccupancyWorldModelRequest
JSON request sent from the Rust bridge to the OccWorld Python server.
OccupancyWorldModelResponse
JSON response returned by the OccWorld Python server.
SceneBoundsJson
Axis-aligned scene footprint sent to the OccWorld server in the IPC request. Mirrors occupancy::SceneBounds but derives Serialize / Deserialize for direct inclusion in the JSON payload.
TrajectoryPrior
Predicted future trajectory for one tracked person.
TrajectoryWaypoint
A single point on a predicted trajectory, with a relative timestamp.

Functions§

persons_from_worldgraph
Extracts all PersonPositions from a WorldGraph by serialising the graph to its canonical JSON form (via WorldGraph::to_json) and scanning the nodes array for PersonTrack entries.