work on navigation

This commit is contained in:
Boki 2026-02-13 11:23:30 -05:00
parent 468e0a7246
commit 802f1030d5
12 changed files with 582 additions and 64 deletions

View file

@ -147,6 +147,22 @@ public class NavigationExecutor : IDisposable
public byte[] GetMapSnapshot() => _worldMap.GetMapSnapshot();
public byte[] GetViewportSnapshot(int viewSize = 400) => _worldMap.GetViewportSnapshot(_tracker.Position, viewSize);
/// <summary>
/// Capture one frame, track position, stitch into world map.
/// Returns viewport PNG bytes, or null on failure.
/// </summary>
public byte[]? ProcessFrame()
{
using var frame = _capture.CaptureFrame();
if (frame == null) return null;
var pos = _tracker.UpdatePosition(frame.GrayMat);
_worldMap.StitchFrame(frame.ClassifiedMat, pos);
return _worldMap.GetViewportSnapshot(pos);
}
public void SaveDebugCapture() => _capture.SaveDebugCapture();
public void Dispose()
{
_capture.Dispose();