Skip to main content

Robonix Python client library: write Primitive/Service/Skill packages, talk to atlas, serve Driver lifecycle gRPC, wrap rclpy/FastMCP/grpcio middleware.

Project description

robonix-api

Python client library for writing Robonix capability providers — primitives, services, and skills — and talking to the Atlas registry.

Robonix is an embodied-AI operating system. robonix-api is the client-side helper: it gives you Primitive / Service / Skill classes that handle Atlas registration, the Driver lifecycle gRPC server, and thin wrappers over rclpy / FastMCP / grpcio. The Atlas server itself is a separate Rust binary (robonix-atlas, see the main repo).

Install

pip install robonix-api

Optional extras:

pip install "robonix-api[codegen]"   # adds grpcio-tools, only needed if you run `rbnx codegen` from Python

ROS 2 (rclpy, sensor_msgs, geometry_msgs, etc.) is not a pip dependency — install ROS 2 Humble via apt on the host. robonix-api's ROS helpers import rclpy lazily, so the rest of the library works even without a ROS install.

Hello, primitive

from robonix_api import Primitive, Ok, Deferred

primitive = Primitive(
    id="my_lidar",
    namespace="robonix/primitive/lidar",
)

@primitive.on_init
def init(cfg: dict):
    topic = cfg.get("lidar_topic", "/scan")
    if not primitive.wait_for_topic(topic, "LaserScan", 30.0):
        return Deferred(f"no LaserScan on {topic} yet")
    primitive.create_publisher(
        contract_id="robonix/primitive/lidar/lidar2d",
        topic=topic,
        msg_type="LaserScan",
    )
    return Ok()

if __name__ == "__main__":
    primitive.run()

That's a complete Robonix primitive — registers with Atlas, serves the Driver lifecycle, waits for the upstream topic, declares a ROS 2 capability for downstream consumers, and blocks on SIGTERM.

What's in the box

  • ATLAS — module-level singleton client (ATLAS.register, ATLAS.find_primitive, ATLAS.connect, ...)
  • Primitive / Service / Skill — provider base classes with on_init / on_activate / on_deactivate / on_shutdown decorators
  • @provider.provides_grpc(contract) / @provider.provides_mcp(contract) — Layer-2 sugar for typed handlers
  • Ok / Err / Deferred — lifecycle return values
  • mcp_contract — standalone FastMCP decorator (use when you manage your own FastMCP app, e.g. in scene_service)

The Atlas wire protocol (atlas_pb2 / atlas_pb2_grpc) is pre-generated and bundled in the wheel. Per-contract stubs (robonix_contracts_pb2, MCP typed dataclasses) are generated per deployment by rbnx codegen against your contract TOMLs — robonix-api automatically picks them up from <pkg>/rbnx-build/codegen/ at runtime.

Versioning

robonix-api tracks the Robonix v0.1.x series. Wire format and public API are frozen within v0.1.x. Pre-release builds (0.1.0rc*) are published to Test PyPI first; stable releases to PyPI.

The Atlas server (Rust crate robonix-atlas) must be on a compatible minor version. Mixing robonix-api 0.1.x with an Atlas server on a different minor version is unsupported.

Links

License

Mulan PSL v2.

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

robonix_api-0.1.0rc1.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

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

robonix_api-0.1.0rc1-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file robonix_api-0.1.0rc1.tar.gz.

File metadata

  • Download URL: robonix_api-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for robonix_api-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 12b3211826e63b6eb415e8dad8bb4e584890650d61dd2c5bd08ac67ff849f3ac
MD5 72c8ab3e28f9c61ca57ea49f8b9e66d6
BLAKE2b-256 8bb04dabceb52082835470e574e23760cfb62681e6f78387dd5461672b766d13

See more details on using hashes here.

File details

Details for the file robonix_api-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: robonix_api-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for robonix_api-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 62eb2710a4762e722555c1d5ac9daccfd80bfcbfc553502d88463142aa1864aa
MD5 3ba0949ccda2d87bb93a19555a9adb37
BLAKE2b-256 09c52ac2afbccc0e5c064c3524716c35825ffc09236b7d64e727a4aed6239756

See more details on using hashes here.

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