Skip to main content

NimbusOS Python SDK

This is the first narrow Python SDK surface for NimbusOS pubsub.

V1 supports:

  • Subscribe to arm_state
  • Subscribe to telemetry
  • Subscribe to selected_state
  • Subscribe to the shadow df_esekf_state
  • Read latest-only frames from camera
  • Subscribe to camera_overlay
  • Subscribe to waypoint_status
  • Subscribe to autonomy_status
  • Publish arm_state
  • Publish autonomy_request
  • Publish waypoint_speed
  • Publish yaw_turn_command
  • Publish absolute yaw headings with optional persistent hold
  • Publish camera_overlay

It does not expose raw pubsub publishing, all-topic subscription, legacy route messages, navigation request messages, or internal control topics.

Install

cd NimbusOS/sdk
uv sync

Local Development Without PyPI

Use this loop before publishing. It builds the SDK exactly as a package, then installs that local wheel into the sandbox environment.

cd /Users/davidcrabtree/projects/droneforge_mvp/NimbusOS/sdk
uv run python scripts/refresh_schema.py --check
uv build

Create the sandbox virtualenv if it does not already exist:

cd /Users/davidcrabtree/projects/NimbusOS-sdk-sandbox
uv venv --python 3.12

Install the local SDK wheel into that sandbox:

cd /Users/davidcrabtree/projects/droneforge_mvp/NimbusOS/sdk
uv run python scripts/install_local_wheel.py /Users/davidcrabtree/projects/NimbusOS-sdk-sandbox/.venv/bin/python

Run sandbox checks directly from .venv/bin after installing the local wheel:

cd /Users/davidcrabtree/projects/NimbusOS-sdk-sandbox
.venv/bin/python examples_v0/smoke_import.py
.venv/bin/nimbusos-subscribe --help
.venv/bin/nimbusos-arm --help
.venv/bin/nimbusos-autonomy-request --help
.venv/bin/nimbusos-waypoint-speed --help
.venv/bin/nimbusos-yaw-turn-command --help

Do not run uv sync between the local wheel install and the sandbox checks. The sandbox dependency pin is for released packages, so syncing can replace the local wheel with the PyPI version.

Release Process

  1. Bump version in pyproject.toml and refresh uv.lock.
  2. Run uv run python scripts/refresh_schema.py --check.
  3. Run uv build.
  4. Install the built wheel into a clean environment with scripts/install_local_wheel.py.
  5. Run the import and CLI smoke checks above.
  6. Run the live sandbox examples against NimbusOS when the app/core is running.
  7. Publish to TestPyPI.
  8. Install from TestPyPI in a clean environment and repeat the smoke checks.
  9. Publish the same artifacts to PyPI.
  10. Update the sandbox package pin to the released version and run uv sync.

Subscribe

cd NimbusOS/sdk
uv run nimbusos-subscribe telemetry
uv run nimbusos-subscribe arm_state
uv run nimbusos-subscribe selected_state
uv run nimbusos-subscribe df_esekf_state
uv run nimbusos-subscribe camera_overlay
uv run nimbusos-subscribe waypoint_status
uv run nimbusos-subscribe autonomy_status

Camera frame access is latest-only. Use the core-selected stream by default:

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
    for frame in client.latest_camera_frames():
        process(frame.jpeg)

Publish Camera Overlays

camera_overlay is an inference visualization layer. It keeps camera pixels on the camera topic and sends only drawing instructions to NimbusOS/ui. Overlay coordinates are in the image coordinate system described by frame_width and frame_height; the UI scales them to the current camera frame before drawing.

from nimbusos_sdk import NimbusClient, box

with NimbusClient() as client:
    for frame in client.latest_camera_frames():
        client.publish_camera_overlay(
            camera_seq=frame.seq,
            frame_width=frame.width,
            frame_height=frame.height,
            source="my_detector",
            layers=[
                {
                    "name": "detections",
                    "primitives": [
                        box(120, 80, 180, 240, label="person", confidence=0.91),
                        {
                            "type": "arrow",
                            "tone": "warning",
                            "x": 210,
                            "y": 200,
                            "x2": 280,
                            "y2": 170,
                            "label": "motion",
                        },
                    ],
                }
            ],
        )

Python callers can decode waypoint status into a small typed object:

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
    for status in client.waypoint_status():
        print(status.active, status.reached, status.held, status.distance_m)

Python callers can decode selected state into a small typed object:

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
    for state in client.selected_state():
        print(state.valid, state.position.z_m, state.velocity.z_mps)

Python callers can decode autonomy status into a small typed object:

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
    for status in client.autonomy_status():
        if status.status == "landing_low_battery":
            print("landing because of low battery")

Publish Arm State

cd NimbusOS/sdk
uv run nimbusos-arm
uv run nimbusos-arm --disarm

Python callers use the same arm_state message:

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
    client.publish_arm_state(True)

Publish Autonomy Requests

cd NimbusOS/sdk
uv run nimbusos-autonomy-request takeoff
uv run nimbusos-autonomy-request land
uv run nimbusos-autonomy-request return_home

Autonomy can also request a relative waypoint:

cd NimbusOS/sdk
uv run nimbusos-autonomy-request relative_waypoint --mode override --forward 1.5 --right 0.0 --down 0.0
uv run nimbusos-autonomy-request relative_waypoint --mode queue --forward 1.0 --right 0.5 --down 0.0 --hold-time 0.5

Relative waypoint fields are body-frame offsets:

  • forward: meters forward/back in the drone's current body heading
  • right: meters right/left in the drone's current body heading
  • down: meters down/up relative to the current or queued waypoint base
  • mode=override: replace the active waypoint
  • mode=queue: append after the active waypoint

Publish Waypoint Speed

cd NimbusOS/sdk
uv run nimbusos-waypoint-speed 0.45

Python callers can change the waypoint path speed any time during a flight:

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
	client.publish_waypoint_speed(0.25)
	client.publish_relative_waypoint(
		mode="override",
		forward=1.5,
		right=0.0,
		down=0.0,
	)

    if target_detected:
        client.publish_waypoint_speed(0.60)
    else:
        client.publish_waypoint_speed(0.20)

The SDK uses the same speed range as the UI: 0.05 to 0.50 m/s.

Publish Yaw Turn Commands

cd NimbusOS/sdk
uv run nimbusos-yaw-turn-command 0.52

Python callers use the same relative yaw turn command:

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
    client.publish_yaw_turn_command(0.52)

To hold an absolute heading in the same local frame as selected_state().attitude.yaw_deg, publish a yaw heading in radians:

import math

from nimbusos_sdk import NimbusClient

with NimbusClient() as client:
    client.publish_yaw_heading(math.radians(90.0), hold=True)

Absolute headings are one-shot by default. With hold=True, the heading remains active after it is reached and corrects later disturbances. Publishing another yaw heading replaces it. Disarming or switching to manual control clears it.

Endpoints

The client uses these defaults:

  • publish: tcp://127.0.0.1:7771
  • subscribe: tcp://127.0.0.1:7772

You can override them with:

  • DF_ZMQ_PUB_ENDPOINT
  • DF_ZMQ_SUB_ENDPOINT

Custom MSP

with NimbusClient() as client:
    client.send_msp(function=YOUR_FUNCTION_ID, payload=your_24_bytes, rate_hz=1)

The function is the exact firmware MSP ID. Payloads contain 0–32 opaque bytes. The default rate is 1 Hz; higher rates up to 10 Hz require both an explicit rate_hz and a backend profile enabling them (DF_MSP_MAX_RATE_HZ). Each call submits one fresh value. Newer unsent data replaces older pending data for the same function; the SDK does not repeat a lone payload or automatically retry.

No response subscription is required. The returned receipt optionally exposes wait_transmitted(timeout_sec=2) for the local serial-write outcome, independent of FC replies. To receive bytes, use a separate context-managed inbox:

with NimbusClient() as client:
    with client.subscribe_msp(function=YOUR_FUNCTION_ID) as replies:
        client.send_msp(function=YOUR_FUNCTION_ID, payload=your_24_bytes)
        reply = replies.get(timeout_sec=2)
        if reply is not None:
            print(reply.payload, reply.is_error)

Responses are raw and not correlated to individual submissions. Firmware remains responsible for implementing the selected function and interpreting its payload. Functions 4/88/89 are reserved for core board/VTX management; function 200 needs DF_MSP_ALLOW_RC_OVERRIDE=1. See bench examples for the send-only/optional-response DShot beacon test and four-note doorbell example.

Metadata

Release files for nimbusos-sdk 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nimbusos-sdk 0.1.13
File Size Uploaded Provenance Actions
nimbusos_sdk-0.1.13.tar.gz 44.9 kB Without provenance Details for nimbusos_sdk-0.1.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nimbusos-sdk 0.1.13
File Interpreter ABI Platform Actions
nimbusos_sdk-0.1.13-py3-none-any.whl Python 3 none any Details for nimbusos_sdk-0.1.13-py3-none-any.whl

Total release size: 113.2 kB

Release files / nimbusos_sdk-0.1.13.tar.gz

Download URL nimbusos_sdk-0.1.13.tar.gz
Size 44.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7a147693fc47d5c87e48a4ee625e689b8bd9ad6874fa6da3eff7832cf2ddcec0
BLAKE2b-256 checksum
How to use checksums
2179d2109a58c6f5109dc7d2462bc0c92ce6ef13dd9ce5a89a5ab3703c84caba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / nimbusos_sdk-0.1.13-py3-none-any.whl

Download URL nimbusos_sdk-0.1.13-py3-none-any.whl
Size 68.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e94829f0c161f4b140b387e7a9146c107f26120f1349e2e310473f1c812d13d
BLAKE2b-256 checksum
How to use checksums
31f3f816b2bb93d3714522dd065ebd4f83851464c977f17479fd4963c0384e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for nimbusos-sdk 0.1.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page