switching
This commit is contained in:
parent
490fb8bdba
commit
ec1f6274e3
5 changed files with 246 additions and 69 deletions
|
|
@ -26,6 +26,12 @@ public class NavigationExecutor : IDisposable
|
|||
_config = config ?? new MinimapConfig();
|
||||
_capture = new MinimapCapture(_config);
|
||||
_worldMap = new WorldMap(_config);
|
||||
_capture.ModeChanged += _ =>
|
||||
{
|
||||
_worldMap.Rebootstrap();
|
||||
_stuckCounter = 0;
|
||||
_lastPosition = null;
|
||||
};
|
||||
}
|
||||
|
||||
private void SetState(NavigationState s)
|
||||
|
|
@ -81,7 +87,8 @@ public class NavigationExecutor : IDisposable
|
|||
}
|
||||
|
||||
SetState(NavigationState.Processing);
|
||||
var pos = _worldMap.MatchAndStitch(frame.ClassifiedMat, frame.WallMask);
|
||||
var mode = _capture.DetectedMode;
|
||||
var pos = _worldMap.MatchAndStitch(frame.ClassifiedMat, frame.WallMask, mode);
|
||||
if (_worldMap.LastMatchSucceeded)
|
||||
_capture.CommitWallColors();
|
||||
|
||||
|
|
@ -245,7 +252,7 @@ public class NavigationExecutor : IDisposable
|
|||
if (frame == null) return null;
|
||||
|
||||
var stitchStart = sw.Elapsed.TotalMilliseconds;
|
||||
var pos = _worldMap.MatchAndStitch(frame.ClassifiedMat, frame.WallMask);
|
||||
var pos = _worldMap.MatchAndStitch(frame.ClassifiedMat, frame.WallMask, _capture.DetectedMode);
|
||||
if (_worldMap.LastMatchSucceeded)
|
||||
_capture.CommitWallColors();
|
||||
var stitchMs = sw.Elapsed.TotalMilliseconds - stitchStart;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue