cartesian_tree/
lib.rs

1//! Cartesian Tree Library
2//!
3//! This crate provides a tree-based coordinate system where each frame has a position
4//! and orientation relative to its parent. You can create hierarchical transformations
5//! and convert poses between frames.
6
7pub mod errors;
8pub mod frame;
9pub mod orientation;
10pub mod pose;
11
12pub mod tree;
13pub use errors::CartesianTreeError;
14pub use frame::Frame;
15pub use pose::Pose;
16
17// The bindings module and the PyO3 initialization are only compiled when the
18// "bindings" feature is enabled.
19#[cfg(feature = "bindings")]
20pub mod bindings;
21#[cfg(feature = "bindings")]
22use pyo3::prelude::*;
23
24#[cfg(feature = "bindings")]
25#[pymodule]
26#[pyo3(name = "_cartesian_tree")]
27fn cartesian_tree(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
28    m.add_class::<bindings::frame::PyFrame>()?;
29    m.add_class::<bindings::pose::PyPose>()?;
30    m.add_class::<bindings::utils::PyPosition>()?;
31    m.add_class::<bindings::utils::PyRPY>()?;
32    m.add_class::<bindings::utils::PyQuaternion>()?;
33    Ok(())
34}