Skip to main content

Rule-based navigation command from detections; protocol-agnostic (map output to MAVLink or your system).

Project description

heur-nav-rules

heur-nav-rules is a Python library that converts vision detections into a simple navigation command.

Input: detections + rules JSON
Output: heading + speed scale (+ diagnostics)

Install

pip install heur-nav-rules

For local development:

pip install -e ".[dev]"

Usage

from pathlib import Path
from nav_rules import load_config, compute_navigation, Detection

config = load_config(Path("config_examples/example_rules.json"))
detections = [
    Detection(label="person", confidence=0.9, center_x=160, center_y=120, area_ratio=0.05),
]
cmd = compute_navigation(detections, config, frame_wh=(320, 240))
print(cmd.heading_command_deg, cmd.speed_scale, cmd.goal_visible)

What you provide

  • Detections: label, confidence, center_x, center_y, optional area_ratio, source.
  • Config: rules JSON (goal classes, obstacle classes, sectors, blending).
  • Details: docs/api.md, docs/rules_format.md.

What you get

NavigationCommand with:

  • heading_command_deg
  • speed_scale
  • avoid_side
  • goal_visible
  • selected_goal
  • heading_to_goal_deg
  • obstacle_scores

Map this output to MAVLink, ArduPilot, PX4, or your own controller.

Rule editor

A GUI lets you create and edit rules without writing JSON by hand. Run the editor, fill the form (goal classes, obstacle classes, blending, etc.), then save to generate a rules JSON file.

pip install ".[gui]"
nav-rules-edit                    # new config (defaults)
nav-rules-edit path/to/rules.json # open and edit existing
# or
python -m nav_rules.gui [path]

In the window: use Open to load a JSON file, Import to load rules and merge with defaults for missing fields (useful when fixing or upgrading existing rules), New to reset to defaults, Validate to check the form, and Save as JSON... to write the config. See docs/editor.md for the workflow.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

heur_nav_rules-0.1.3.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heur_nav_rules-0.1.3-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file heur_nav_rules-0.1.3.tar.gz.

File metadata

  • Download URL: heur_nav_rules-0.1.3.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for heur_nav_rules-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0d98a0d9518fb0db9ae75675c58b21a7af127422671b7023fa3d32dedd8c7088
MD5 3fb14590847edc10a6b595ad906ca863
BLAKE2b-256 e80f1763e1a64c6ca96e5bd9e3f2799284310711505c06a008c7e335e20ba3e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for heur_nav_rules-0.1.3.tar.gz:

Publisher: publish.yml on embeir/heur-nav-rules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file heur_nav_rules-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: heur_nav_rules-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for heur_nav_rules-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5811f6c2c15841234df01ad936f7e085a255db2f10bdd5b4264e99bee39824fb
MD5 5452f5b8621bae89de2ceb55652f9fe2
BLAKE2b-256 5662e0c4778d3234d1d1511bf64beffe8eef32e3c3d61801270afef857fe260b

See more details on using hashes here.

Provenance

The following attestation bundles were made for heur_nav_rules-0.1.3-py3-none-any.whl:

Publisher: publish.yml on embeir/heur-nav-rules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page