Skip to main content

Lightweight Python Star Tracker With Rust Backend

Project description

Lightweight Python Star Tracker With Rust Backend

Based on the methodology used in https://github.com/nasa/COTS-Star-Tracker, with following improvements:

  • Reduced dependencies to opencv and numpy for lightweight usage in a Raspberry Pi.
  • Reimplemented computationally expensive parts in rust. This includes most parts that are not image processing related.
  • Added quadratic inter star angle index look up polynomial for faster triangle search.
  • Added spatial index to look up neighboring stars.

Features:

  • Attitude estimation from image and camera calibration parameters.
  • Attitude estimation from list of star observation coordinates.
  • Star catalog creation with temporal corrections.

Example

import ruststartracker

# Get catalog positions
catalog = ruststartracker.StarCatalog()
star_catalog_vecs = catalog.normalized_positions()

# Define opencv camera parameters, see https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html
camera_params = ruststartracker.CameraParameters(
    camera_matrix=...,
    cam_resolution=...,
    dist_coefs=...,
)

# Create StarTracker instance (reuse this)
st = ruststartracker.StarTracker(
    star_catalog_vecs,
    camera_params,
    max_inter_star_angle=...,
    inter_star_angle_tolerance=...,
    n_minimum_matches=...,
)

# Obtain numpy array image
img = ...

# Find attitude from given image
result = st.process_image(img)

print(result)
# StarTrackerResult(quat=[-0.43977802991867065, -0.439766526222229, -0.4398997128009796, 0.6478340029716492], match_ids=[1435, 1272, 1140, 2035, 1070, 1438, 1338, 903, 260, 2141, 1771, 1727, 385, 1717, 2204, 2062, 1989, 1634, 708, 1357], n_matches=20, duration_s=0.0003700880042742938)

Installation

  • Make sure rust tool chain (cargo) is installed and in the PATH environment variable.
  • Install with pip install git+https://github.com/ntobler/ruststartracker.git.

TODOs

  • Improve error messages.
  • Return more diagnostic data.

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

ruststartracker-0.2.1.tar.gz (5.0 MB view details)

Uploaded Source

Built Distributions

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

ruststartracker-0.2.1-cp312-cp312-manylinux_2_35_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.1-cp312-cp312-manylinux_2_35_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

ruststartracker-0.2.1-cp311-cp311-manylinux_2_35_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.1-cp311-cp311-manylinux_2_35_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

ruststartracker-0.2.1-cp310-cp310-manylinux_2_35_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.1-cp310-cp310-manylinux_2_35_aarch64.whl (5.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ ARM64

File details

Details for the file ruststartracker-0.2.1.tar.gz.

File metadata

  • Download URL: ruststartracker-0.2.1.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ruststartracker-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a33acdf78e6eb5cf6e1cba549b5a2f5b1316c4df2ab86d7bb6baf02f7d02a26c
MD5 5d69657ffb1436a5104364e1e5036d4c
BLAKE2b-256 6e45c3337abac2a35d5bfc24a243a2b281e9eef94f961c76ef89350f245c6838

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.1-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.1-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 bd2c027e104ed7add9fb492935ae8be2ffaafef7fde3603e043dc3962d830821
MD5 ad6d545461f60a6341b21ccb28cc020c
BLAKE2b-256 96e0849d01076a9aac551ecf10e689e327bb98b305b115b07e52fc1abce18e75

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.1-cp312-cp312-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.1-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 aaa321e3f9a8001a529dd15aa36d3c66f023714b52a23551c2000de804021616
MD5 4d1a147fe5bdf254c83b86e32ae4d379
BLAKE2b-256 5822e2baff4854f2793a4bd064be9eee7307e9119572192730876a4d971243ec

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.1-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.1-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 805caebbbc0592ebf701ed744a83c3e3c7dfcd78c2c9c07ffe47f5b4f8e9f906
MD5 a55528063e62cbe994193b057ab30714
BLAKE2b-256 da54744e129fc111eb04353095f06ecb6812d7eb813c55a6970c8ad30c9feb65

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.1-cp311-cp311-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.1-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 b008e96c9858d2fcd318d778e2b756c46b064213ade3c38ec3e97ba80ea7da4c
MD5 c0be6e6935e4023812721ae893d7ec68
BLAKE2b-256 2cc9931c13e12dfa10789bbb3b08e7e54f591ea31a06590e8bf3c7d84ecbbc0d

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.1-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.1-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 acb46868824410c3d5945f450865dfe2d9e15ec1d4e1b4c2ca98abfd4b7e0d31
MD5 3121ab4cab09d37afc0b8f16a128adf2
BLAKE2b-256 b120de179770d2d9b4f7676978f2065c0e70e44d57a051658393ec4c59086f0b

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.1-cp310-cp310-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.1-cp310-cp310-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 98e1db9dd9f9db4c64722d0f9b93f2dc96ea771b791853425923d0e7d35b90b1
MD5 0463bbe37543fb65911015206080aa5f
BLAKE2b-256 62144f6ea00313cf4dd5904e2a2ee9bc86497190b1afc78b884f02a10e5f384d

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