Skip to main content

cyberwave-geometry (Python)

Python binding for the Cyberwave geometry core. It holds no formulas of its own — every function here marshals to the C++ library and back. Adding arithmetic to this package would recreate exactly the duplication the core exists to remove.

Install

pip install cyberwave-geometry

The wheel carries libcyberwave_geometry_c beside the package, so a normal install needs no compiler and no separate build. Wheels are published for CPython 3.10-3.14 on manylinux x86_64/aarch64, macOS arm64/x86_64 and Windows AMD64; there is no sdist, because this package compiles the core from the repository root and cannot build from bindings/python alone.

At import time the package looks for the library, in order:

  1. $CYBERWAVE_GEOMETRY_LIBRARY — an explicit path;
  2. beside the package, or in cyberwave_geometry/_lib/ — how a built wheel ships;
  3. $CYBERWAVE_GEOMETRY_BUILD_DIR — a developer's CMake build tree;
  4. the platform loader's own search path.

For local development, from a checkout of the repository:

cmake -S . -B build && cmake --build build -j
export CYBERWAVE_GEOMETRY_LIBRARY=$PWD/build/libcyberwave_geometry_c.so
pip install -e ./bindings/python

If it cannot find the library the ImportError prints every path it tried.

Use

from cyberwave_geometry import Quaternion, Transform, Vector3
from cyberwave_geometry import quaternion as quat, transform as tf

q = quat.from_rpy(0.1, 0.2, 0.3)          # fixed-axis XYZ, the URDF convention
tf.compose(parent, child)
quat.rotate(q, Vector3(1, 0, 0))

Forward kinematics takes a parsed description — this package does not read the Universal Robot Schema, URDF or MJCF; your schema reader does, and hands the result over:

from cyberwave_geometry import JointType
from cyberwave_geometry.fk import JointDescription, RobotDescription, RobotTree

tree = RobotTree(RobotDescription(
    links=["base_link", "tool"],
    joints=[JointDescription("j", "base_link", "tool", JointType.REVOLUTE,
                             axis=Vector3(0, 0, 1))],
))

pose = tree.frame_pose("tool", joint_positions={"j": 1.57})
if pose.available:
    print(pose.transform)
else:
    print("waiting on", pose.missing_joints)

Three outcomes, kept distinct on purpose: a pose, available=False with missing_joints when the robot has not reported that state yet, and a raised GeometryError for a structural problem. Collapsing any of them into a default pose is the failure mode this library prevents.

GPS poses

A position on Earth is Geodetic(latitude_deg, longitude_deg, altitude_m) -- WGS-84, degrees and metres. A six-degree-of-freedom pose is a GeoPose, whose orientation maps the body frame (forward-left-up) into the local ENU frame at its own position:

from cyberwave_geometry import GeoAnchor, Geodetic, GeoPose
from cyberwave_geometry import geodetic as geo

anchor = GeoAnchor(Geodetic(47.3769, 8.5417, 408.0), heading_deg=30.0)

geo.to_local(anchor, Geodetic(47.3801, 8.5500, 421.0))   # -> Vector3, metres
geo.to_local_pose(anchor, pose)                          # -> Transform, ready for FK
geo.from_local_pose(anchor, transform)                   # -> GeoPose

heading_deg is the true-north bearing of environment +Y, so 0 means the environment frame is ENU. Altitude carries no datum -- MSL vs ellipsoidal is recorded beside the data and never converted here.

Compass bearings and NED attitudes are foreign conventions and go through named adapters, for the same reason wxyz does:

geo.quat_from_compass_heading(137.5)   # degrees CLOCKWISE from true north
geo.quat_from_ned_rpy(roll, pitch, yaw)  # radians; NED pitch is nose-UP

Two traps the adapters exist to prevent: feeding NED angles straight into quat.from_rpy is right at 45 degrees and 90 degrees wrong at every cardinal heading, and NED positive pitch is nose-up where ENU/FLU positive pitch is nose-down. The full convention is CONVENTIONS.md section 9.

Strict by default

Degenerate input raises rather than becoming an identity rotation:

quat.normalize(Quaternion(0, 0, 0, 0))    # GeometryError: invalid_quaternion
geo.validate(Geodetic(91.0, 0.0, 0.0))    # GeometryError: invalid_geodetic

Geodetic values are stricter still: Geodetic.from_dict refuses a missing coordinate rather than defaulting it to zero, because (0, 0) is a real place in the Gulf of Guinea -- a silently relocated robot, not an obvious failure.

Where a call site must stay lenient — parsing persisted JSON that predates any validation — use cyberwave_geometry.compat, which keeps the identity fallback but names it:

from cyberwave_geometry import compat

compat.normalize_quaternion_or_identity(whatever_was_stored)
compat.quaternion_from_wire(values, order="xyzw")   # order is not optional

Component order

A bare four-element array is ambiguous between xyzw (protobuf, ROS, Three.js) and wxyz (MuJoCo, legacy backend payloads), and reading one as the other is silent — you get a real, unit, plausible, wrong rotation. So there is no positional constructor:

Quaternion.from_xyzw(protobuf_values)
Quaternion.from_wxyz(mujoco_values)
q.to_xyzw()

The dataclass fields are declared x, y, z, w — the Cyberwave order, matching cw_geom_quat and the C++ core — so a positional Quaternion(a, b, c, d) is xyzw. Construct with keywords (Quaternion(x=…, y=…, z=…, w=…)) or the named converters above rather than relying on that.

Why ctypes and not a compiled extension

There are no formulas on this side at all -- every function marshals to the C++ core and back -- so a compiled extension would buy nothing but build complexity. The C ABI is the seam a compiled accelerator would slot into later without changing anything above _native.py.

Tests

cd bindings/python && python -m pytest

tests/test_golden.py runs the shared golden vectors — the same file the C++ runner reads, which is what makes "C++ and Python agree" a tested claim. tests/test_binding.py covers what only exists on this side: handle lifetimes, the strict/lenient split, and the named-component discipline. tests/test_geodetic.py covers the geodetic marshalling -- three bare doubles across an ABI, where a field swap would place a robot in the wrong hemisphere without raising anything.

Metadata

Release files for cyberwave-geometry 0.2.5

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

Built distributions (wheels)

Table of built distributions (wheels) for cyberwave-geometry 0.2.5
File Actions
cyberwave_geometry-0.2.5-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for cyberwave_geometry-0.2.5-py3-none-win_amd64.whl
cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details for cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details for cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
cyberwave_geometry-0.2.5-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for cyberwave_geometry-0.2.5-py3-none-macosx_11_0_arm64.whl
cyberwave_geometry-0.2.5-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details for cyberwave_geometry-0.2.5-py3-none-macosx_10_13_x86_64.whl

Total release size: 547.6 kB

Release files / cyberwave_geometry-0.2.5-py3-none-win_amd64.whl

Download URL cyberwave_geometry-0.2.5-py3-none-win_amd64.whl
Size 92.2 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
7ed57c8d5c5a99e7d5b34da829b13ba3d6dccfa8695409ce815723d4fec00488
BLAKE2b-256 checksum
How to use checksums
85b507eff37b17a3ce4c5f3102c9f2549c5ceeabb40cd13f34d24d2a6b260105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 140.1 kB
Tags Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5a540d938dd6bdf04063f94bbfec32ef28d2661c9e470687cd7d3eb3c5ca4acd
BLAKE2b-256 checksum
How to use checksums
3f02e6c535da237c227c06aa2e3d9fc29611731ede47b140cf92c06c5a653cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL cyberwave_geometry-0.2.5-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 120.7 kB
Tags Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
302c21f835d9f1309d565b7264b56d83591ae9cb4a7eed841be9384feb682f0d
BLAKE2b-256 checksum
How to use checksums
4dae6dbc602de1dea0a7ed0489b46460d77eadcc39345828907c39cc85af7383
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / cyberwave_geometry-0.2.5-py3-none-macosx_11_0_arm64.whl

Download URL cyberwave_geometry-0.2.5-py3-none-macosx_11_0_arm64.whl
Size 94.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ff250d8df7c0dfc2936bf3e8eb61c188dbc6d5ceb9108bef58950262560eaf1d
BLAKE2b-256 checksum
How to use checksums
abececf3edc9c35d3830a1da221c4eb846c6dc17e12a783e597c1f8cee7596cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / cyberwave_geometry-0.2.5-py3-none-macosx_10_13_x86_64.whl

Download URL cyberwave_geometry-0.2.5-py3-none-macosx_10_13_x86_64.whl
Size 100.6 kB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
a0167277cdae92667e8bba6912589b2ce255809486bb9ed2371bd83da9aab79d
BLAKE2b-256 checksum
How to use checksums
54e94ce2ef501336bb638c9d4c06912a937a27ee5234fbde6b8ce75bf98fc634
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for cyberwave-geometry 0.2.5

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for cyberwave_geometry-0.2.5-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

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