| Crates.io | CartesianTree |
| lib.rs | CartesianTree |
| version | 0.3.0 |
| created_at | 2025-08-06 17:22:37.626179+00 |
| updated_at | 2025-12-05 16:54:00.645048+00 |
| description | Build hierarchical Cartesian coordinate systems to easily transform poses. |
| homepage | https://github.com/Kn0g/cartesian-tree |
| repository | https://github.com/Kn0g/cartesian-tree |
| max_upload_size | |
| id | 1784096 |
| size | 92,727 |
cartesian-tree is a library for managing and transforming poses in a tree-structured hierarchy of 3D coordinate frames in rust as well as python.
+ x(1.0)) or rotations (* rz(PI/4)).The project can be found on crates.io and pypi.org
Rust:
use cartesian_tree::{Frame, Pose};
use nalgebra::{Vector3, UnitQuaternion};
fn main() {
// Create root frame
let world = Frame::new_origin("world");
// Add a child frame
let child = world.add_child(
"child",
Vector3::new(1.0, 0.0, 0.0),
UnitQuaternion::from_euler_angles(0.0, 0.0, std::f64::consts::FRAC_PI_2),
).unwrap();
// Create a pose in the world frame
let pose = world.add_pose(Vector3::new(0.0, 1.0, 0.0), UnitQuaternion::identity());
// Transform the pose to the child frame
let pose_in_child = pose.in_frame(&child).unwrap();
println!("Pose in child: {:?}", pose_in_base.transformation());
Python:
from cartesian_tree import Frame, Rotation, Vector3
# Create root frame
world = Frame("world")
# Add a child frame
child = world.add_child(
"child",
Vector3(1.0, 0.0, 0.0),
Rotation.identity()
)
# Create a pose in the world frame
pose = world.add_pose(
Vector3(0.0, 1.0, 0.0), Rotation.identity()
)
# Transform the pose to the child frame
pose_in_child = pose.in_frame(child)
print(f"Pose in child: {pose_in_child}")