feat: stabilize OpenSim interactions and landmarks
This commit is contained in:
@@ -275,7 +275,7 @@ async fn run_live(
|
||||
AgentControlTarget, BehaviorObservation, ControlEventKind, ControlPlane, ControlTarget,
|
||||
GridSessionBackend, LibremetaverseClientOwner, OperatingMode, RuntimeControlCommand,
|
||||
SessionControl, SessionObservation, SessionState, SessionSupervisor, TcpControlConfig,
|
||||
TcpControlServer,
|
||||
TcpControlServer, WorldSnapshotSource,
|
||||
};
|
||||
|
||||
let connection = config.grid.clone().ok_or_else(|| {
|
||||
@@ -449,6 +449,24 @@ async fn run_live(
|
||||
if let SessionObservation::Transition { status, reason, retry_in } = event {
|
||||
live.vision.set_generation(status.generation);
|
||||
control_target.update_session(status);
|
||||
if status.agent_ready
|
||||
&& let Ok(snapshot) = live
|
||||
.world
|
||||
.capture(
|
||||
status.generation,
|
||||
libremetaverse_types::compat::CancellationToken::default(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
control_target.update_region(
|
||||
Some(snapshot.region_id.to_string()),
|
||||
live.world.current_region_handle(),
|
||||
Some(snapshot.region_name),
|
||||
snapshot.agent.position.map(|position| {
|
||||
[position.x, position.y, position.z]
|
||||
}),
|
||||
);
|
||||
}
|
||||
live.landmark_roaming
|
||||
.update_pause(|pause| pause.degraded = !status.agent_ready);
|
||||
control_plane.publish(ControlEventKind::StateChanged {
|
||||
@@ -582,6 +600,7 @@ struct LiveInteractions {
|
||||
build_control: Arc<dyn metacrate_grid_agent::BuildControl>,
|
||||
vision:
|
||||
Arc<metacrate_grid_agent::VisionService<metacrate_grid_agent::LibremetaverseSceneSource>>,
|
||||
world: Arc<metacrate_grid_agent::LibremetaverseWorldSnapshotSource>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "live-grid")]
|
||||
@@ -612,8 +631,9 @@ fn start_live_interactions(
|
||||
..LlmTransportLimits::default()
|
||||
};
|
||||
let conversation = Arc::new(ConversationStore::from_config(config)?);
|
||||
let world = Arc::new(owner.world_snapshot_source());
|
||||
let perception = Arc::new(PerceptionBackend::new(
|
||||
Arc::new(owner.world_snapshot_source()),
|
||||
world.clone(),
|
||||
Arc::clone(&conversation),
|
||||
config.limits.observable_queue,
|
||||
)?);
|
||||
@@ -760,6 +780,7 @@ fn start_live_interactions(
|
||||
landmark_roaming,
|
||||
build_control,
|
||||
vision,
|
||||
world,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user