跳转到正文

navigation API ​

完整接口目录 · 移动与导航用法 · 工具包下载

模块说明 ​

text
Bounded static flat-ground routing over known cells and native movement.

No terrain inference, dynamic replanning, teleporting, or unknown-action replay.
The cooperative ActionControl must be shared by all controllers in this worker.

FlatGrid ​

python
@dataclass(frozen=True)
class FlatGrid

SDK 说明:

text
Known traversable cells at a single feet Y; absent cells are blocked.

Each (x,z) cell requires full solid floor and two empty body cells. Callers
classify actual block observations, not names guessed from missing blocks.
The snapshot is connection/dimension-bound and expires during execution.

字段(包含继承字段):

FlatGrid.connection_id ​

python
connection_id: str

数据类字段;声明于 navigation.FlatGrid。

FlatGrid.dimension ​

python
dimension: int

数据类字段;声明于 navigation.FlatGrid。

FlatGrid.y ​

python
y: int

数据类字段;声明于 navigation.FlatGrid。

FlatGrid.cells ​

python
cells: frozenset

数据类字段;声明于 navigation.FlatGrid。

FlatGrid.observed_monotonic ​

python
observed_monotonic: float

数据类字段;声明于 navigation.FlatGrid。

FlatGrid.from_clearance ​

python
@classmethod
def from_clearance(cls, *, connection_id, dimension, y, columns, observed_monotonic)

SDK 说明:

text
columns maps (x,z) to (solid_floor, clear_feet, clear_head).

Only three literal True values admit a cell; unknown/partial observations
are not walkable. Classification remains with the block-aware adapter.

FlatGrid.route ​

python
def route(self, start, target, *, max_steps=64)

SDK 说明:

text
Deterministic shortest 4-neighbour route; centres avoid corner cuts.

FlatNavigation ​

python
class FlatNavigation

SDK 说明:

text
Single-use sequential native movement, journalled before every admission.

observe() returns current position, connection_id, dimension, initial_tick,
auth_input_revision and observed_monotonic. It must use independent current
position and native audit evidence, never spawn position or predicted ticks.
Each waypoint is one Host operation with its own stop/stall observation.
Unknown, disconnect, stale map, correction or unconfirmed stop ends the route.

FlatNavigation.__init__ ​

python
def __init__(self, ctx)

FlatNavigation.run ​

python
async def run(
    self,
    grid,
    start,
    target,
    *,
    observe,
    journal,
    control,
    auth_input_height_offset,
    cancel = None,
    timeout = 60,
    max_map_age = 30,
    max_sample_age = 0.5,
    max_steps = 64,
    step_timeout_ms = 5000,
    speed = 0.1,
    tolerance = 0.2,
)

FlatNavigation.ctx ​

python
self.ctx

公开实例属性,在 __init__ 中设置。

FlatNavigation.started ​

python
self.started

公开实例属性,在 __init__、run 中设置。

FlatNavigation.record ​

python
self.record

公开实例属性,在 __init__、run 中设置。

Neomega · 使用、开发与参考文档