Skip to content

Rust Wrapper Overview

The Rust wrapper provides access to libCalibGeom calibration functionality through an idiomatic Rust API.

A typical calibration flow in Rust follows a clear setup → detect → solve pattern.

  1. Validate your license first using the wrapper entry point (for example, validate_license_with_certificate(...) or validate_license_with_env()).
  2. Create the calibration session (for example Calibration::new(...)) and keep that object alive for the full workflow.
  3. Register your calibration graph by adding entities such as targets, cameras, and poses (for example add_target(...), add_camera(...), add_pose(...)), plus optional lidar or robot nodes when needed.
  4. Build detections from input data (images, point clouds, or both), then insert them into the session with APIs like add_image_detection(...) or related detection calls.
  5. Run solving in two phases: call initialize(...) to get a stable starting point, then call optimize(...) for final parameter refinement.
  6. Inspect outputs and diagnostics by reading optimized parameters, reprojection/error statistics, and comparison results from returned result objects.

In practice, your control flow usually looks like validate -> create -> add nodes -> add detections -> initialize -> optimize -> inspect.

See the runnable walkthroughs in Single Camera Example and Stereo Calibration Example, and use Rustdoc for detailed type and method signatures.