Skip to main content

Advanced Navigation Python SDK

Project description

Advanced Navigation Python SDK

Welcome to the Advanced Navigation Python SDK!

This SDK provides a comprehensive suite of tools for interfacing with Advanced Navigation Inertial Navigation Systems (INS). It simplifies the process of establishing communication over Serial, TCP, or UDP, decoding Advanced Navigation Packet Protocol (ANPP) packets, and programmatically configuring Advanced Navigation devices.

Features

  • ANPP Protocol Support: Complete implementation of the Advanced Navigation Packet Protocol (ANPP) for encoding and decoding binary data streams.
  • Asynchronous & Synchronous I/O: Supports both asyncio for high-performance concurrent applications, and synchronous serial/TCP communication for simpler scripts.
  • Device Management: Easily configure sensors, offsets, baud rates, and request state variables.
  • Cross-Platform: Works on Linux, Windows, and macOS.

Installation

The SDK is available on PyPI and can be installed via pip:

pip install advanced_navigation

(Note: Requires Python 3.10+)


Quickstart

Here is a quick example of how to connect to an Advanced Navigation device (such as Certus or Spatial) over a serial port, read the device information, and continuously listen to the system state asynchronously using the AnDevice interface:

import asyncio
from datetime import datetime, timezone
from advanced_navigation.an_devices.an_device_async import AnDevice
from advanced_navigation.anpp_packets.an_packet_3 import DeviceInformationPacket
from advanced_navigation.anpp_packets.an_packet_20 import SystemStatePacket

async def handle_state_packet(state: SystemStatePacket):
    """Callback function triggered every time a SystemStatePacket is received."""
    device_time = datetime.fromtimestamp(
        state.unix_time_seconds + (state.microseconds / 1000000), 
        tz=timezone.utc
    )
    print(f"[{device_time}] Lat: {state.latitude:.6f}, Lon: {state.longitude:.6f}, Height: {state.height:.2f}m")

async def main():
    # Initialize the device
    device = AnDevice()
    
    # Connect via Serial Port (replace with your port, e.g. COM3 or /dev/ttyUSB0)
    await device.connect_serial(port="/dev/ttyUSB0", baud_rate=115200)
    
    print("Connecting to device...")
    await device.wait_online()
    
    # Request Device Information (Packet 3)
    info = await device.request(DeviceInformationPacket)
    if info:
        print(f"Connected! Device ID {info.device_id} | Hardware v{info.hardware_revision/1000} | Software v{info.software_version/1000}")

    # Register a callback to listen to the continuous System State stream (Packet 20)
    device.register_callback(SystemStatePacket, handle_state_packet)
    
    print("Listening for state updates... (Press Ctrl+C to stop)")
    try:
        # Keep the event loop running
        await asyncio.Future()
    except asyncio.CancelledError:
        pass
    finally:
        device.close()

if __name__ == "__main__":
    asyncio.run(main())

For more comprehensive examples—including synchronous operations, TCP logging, firmware updating, and specific device configurations—check out the examples/ directory in this repository.


Product Manuals

The Advanced Navigation SDK supports all INS devices using the ANPP protocol. For further detail on specific product configurations, mounting instructions, and operational capabilities, please see the following documentation:


Contributing

We welcome contributions to the Advanced Navigation Python SDK!

If you are developing a new feature, or addressing a bug:

  1. Fork the repository and create a feature branch.
  2. Implement your changes.
  3. Run the tests locally to verify that your changes pass successfully without breaking existing logic:
    pip install pytest
    pytest tests/
    
  4. Format and lint your code (we use standard Python linting like ruff).
  5. Open a Pull Request describing your changes.

For deeper insights into how the testing suite operates, refer to tests/README.md.

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

advanced_navigation-0.2.0.tar.gz (59.5 kB view details)

Uploaded Source

Built Distribution

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

advanced_navigation-0.2.0-py3-none-any.whl (176.4 kB view details)

Uploaded Python 3

File details

Details for the file advanced_navigation-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for advanced_navigation-0.2.0.tar.gz
Algorithm Hash digest
SHA256 921882f937916b4dbca0c809bd71cebc4fefe65fd9c5a2f7c80b5530be5e6a23
MD5 d62a00fc835aee919c2d08b09d8a9ce4
BLAKE2b-256 13a00befe40bdb37894dfa852f0e49f504e16d868e72ea6901aced3c84d0ece0

See more details on using hashes here.

Provenance

The following attestation bundles were made for advanced_navigation-0.2.0.tar.gz:

Publisher: publish.yml on advanced-navigation/python

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

File details

Details for the file advanced_navigation-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for advanced_navigation-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79cd27bfe132424cad65c6531a357d5465657f01daa981bef18d28450023555f
MD5 628229aa22446cd1f649ad3b0c841891
BLAKE2b-256 d0990703995d89fd449ee7397606191722a965b11512cecbeb88ba63dc46a4fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for advanced_navigation-0.2.0-py3-none-any.whl:

Publisher: publish.yml on advanced-navigation/python

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