🦀 Apex Solver
A high-performance Rust-based nonlinear least squares optimization library designed for computer vision applications including bundle adjustment, SLAM, and pose graph optimization. Built with focus on zero-cost abstractions, memory safety, and mathematical correctness.
Key Features (v0.1.4)
- 🛡️ 15 Robust Loss Functions: Comprehensive outlier rejection (Huber, Cauchy, Tukey, Welsch, Barron, and more)
- ✅ Enhanced Termination Criteria: 8-9 comprehensive convergence checks with relative tolerances that scale with problem magnitude
- 📌 Prior Factors & Fixed Variables: Anchor poses with known values and constrain specific parameter indices
- 🎨 Real-time Visualization: Integrated Rerun support for live debugging of optimization progress
- 📊 Uncertainty Quantification: Covariance estimation for both Cholesky and QR solvers (LM algorithm)
- ⚖️ Jacobi Preconditioning: Automatic column scaling for robust convergence on mixed-scale problems
- 🚀 Three Optimization Algorithms: Levenberg-Marquardt, Gauss-Newton, and Dog Leg with unified interface
- 📐 Manifold-Aware: Full Lie group support (SE2, SE3, SO2, SO3) with analytic Jacobians
- ⚡ High Performance: Sparse linear algebra with persistent symbolic factorization (10-15% speedup)
- 📝 G2O I/O: Read and write G2O format files for seamless integration with SLAM ecosystems
- 🔧 Production Tools: Binary executables (
optimize_3d_graph,optimize_2d_graph) for command-line workflows
🚀 Quick Start
use ;
use ;
use LinearSolverType;
// Load a pose graph from file
let graph = load?;
let = graph.to_problem;
// Configure optimizer with new features
let config = new
.with_linear_solver_type
.with_max_iterations
.with_cost_tolerance
.with_compute_covariances // Enable uncertainty estimation
.with_jacobi_scaling // Enable preconditioning (default)
.with_visualization; // Enable Rerun visualization
// Create and run optimizer
let mut solver = with_config;
let result = solver.optimize?;
// Check results
println!;
println!;
println!;
println!;
// Access uncertainty estimates
if let Some = &result.covariances
Result:
Status: CostToleranceReached
Initial cost: 2.317e+05
Final cost: 3.421e+02
Iterations: 12
x0: uncertainty = 0.000124
x1: uncertainty = 0.001832
...
🎯 What This Is
Apex Solver is a comprehensive optimization library that bridges the gap between theoretical robotics and practical implementation. It provides:
- Manifold-aware optimization for Lie groups commonly used in computer vision
- Multiple optimization algorithms with unified interfaces (Levenberg-Marquardt, Gauss-Newton, Dog Leg)
- Flexible linear algebra backends supporting both sparse Cholesky and QR decompositions
- Industry-standard file format support (G2O, TORO, TUM) for seamless integration with existing workflows
- Analytic Jacobian computations for all manifold operations ensuring numerical accuracy
When to Use Apex Solver
✅ Perfect for:
- Visual SLAM systems
- Pose graph optimization (2D/3D)
- Bundle adjustment in photogrammetry
- Multi-robot localization
- Factor graph optimization
⚠️ Consider alternatives for:
- General-purpose nonlinear optimization (use
argminor call to C++ Ceres) - Small-scale problems (<100 variables) - overhead may not be worth it
- Real-time embedded systems - consider lightweight alternatives
- Problems requiring automatic differentiation - Apex uses analytic Jacobians
🏗️ Architecture
The library is organized into five core modules, each designed for specific aspects of optimization:
src/
├── core/ # Problem formulation and residual blocks
│ ├── problem.rs # Optimization problem definitions
│ ├── variable.rs # Variable management and constraints
│ ├── factors.rs # Between factors, prior factors
│ └── residual_block.rs # Factor graph residual computations
├── optimizer/ # Optimization algorithms
│ ├── levenberg_marquardt.rs # LM algorithm with adaptive damping
│ ├── gauss_newton.rs # Fast Gauss-Newton solver
│ ├── dog_leg.rs # Dog Leg trust region method
│ └── visualization.rs # Real-time Rerun visualization
├── linalg/ # Linear algebra backends
│ ├── cholesky.rs # Sparse Cholesky decomposition
│ └── qr.rs # Sparse QR factorization
├── manifold/ # Lie group implementations
│ ├── se2.rs # SE(2) - 2D rigid transformations
│ ├── se3.rs # SE(3) - 3D rigid transformations
│ ├── so2.rs # SO(2) - 2D rotations
│ ├── so3.rs # SO(3) - 3D rotations
│ └── rn.rs # Euclidean space (R^n)
└── io/ # File format support
├── g2o.rs # G2O format parser (read-only)
├── toro.rs # TORO format support
└── tum.rs # TUM trajectory format
Key Design Patterns
- Configuration-driven solver creation: Use
OptimizerConfigwithSolverFactory::create_solver() - Unified solver interface: All algorithms implement the
Solvertrait with consistentSolverResultoutput - Type-safe manifold operations: Lie groups provide
plus(),minus(), and Jacobian methods - Flexible linear algebra: Switch between Cholesky and QR backends via
LinearSolverType
📊 Examples and Usage
Basic Solver Usage
use ;
use LinearSolverType;
use SE3;
// Create solver configuration
let config = new
.with_linear_solver_type
.with_max_iterations
.with_cost_tolerance
.with_verbose
.with_jacobi_scaling; // Automatic preconditioning
let mut solver = with_config;
// Work with SE(3) manifolds
let pose = SE3identity;
let tangent = random;
let perturbed = pose.plus;
Creating Custom Factors
Apex Solver is extensible - you can create your own factors:
use Factor;
// Use it in your problem
problem.add_residual_block;
Loading and Analyzing Pose Graphs
use ;
// Load pose graph from file
let graph = load?;
println!;
println!;
// Build optimization problem from graph
let = graph.to_problem;
Available Examples
Run these examples to explore the library's capabilities:
# NEW: Binary executables for production use
# Load and analyze graph files
# Real-time optimization visualization with Rerun
# Covariance estimation and uncertainty quantification
# NEW: Compare all 15 robust loss functions on datasets with outliers
# NEW: Demonstrate prior factors and fixed variables
# Visualize pose graphs (before/after optimization)
# Compare different optimizers
# Profile optimization performance
Example Datasets Included:
parking-garage.g2o- Small indoor SLAM dataset (1,661 vertices)sphere2500.g2o- Large-scale pose graph (2,500 nodes)m3500.g2o- Complex urban SLAM scenariogrid3D.g2o,torus3D.g2o,cubicle.g2o- Various 3D test cases- TUM RGB-D trajectory samples
🧮 Technical Implementation
Manifold Operations
Apex Solver implements mathematically rigorous Lie group operations following the manif C++ library conventions:
// SE(3) operations with analytic Jacobians
let pose1 = SE3from_translation_euler;
let pose2 = SE3random;
// Composition with Jacobian computation
let mut jacobian_self = zeros;
let mut jacobian_other = zeros;
let composed = pose1.compose;
// Logarithmic map (Lie group to Lie algebra)
let tangent = composed.log;
// Exponential map (Lie algebra to Lie group)
let reconstructed = tangent.exp;
Supported Manifolds
| Manifold | Description | DOF | Representation | Use Case |
|---|---|---|---|---|
| SE(3) | 3D rigid transformations | 6 | Translation + Quaternion | 3D SLAM, VO |
| SO(3) | 3D rotations | 3 | Unit quaternion | Orientation tracking |
| SE(2) | 2D rigid transformations | 3 | Translation + Angle | 2D SLAM, mobile robots |
| SO(2) | 2D rotations | 1 | Unit complex number | 2D orientation |
| R^n | Euclidean space | n | Vector | Landmarks, parameters |
Robust Loss Functions
New in v0.1.4: 15 robust loss functions for handling outliers in pose graph optimization.
Robust loss functions reduce the influence of outlier measurements (e.g., loop closures with incorrect data association, GPS measurements with multipath errors). They modify the residual weighting to prevent bad measurements from dominating the optimization.
| Loss Function | Parameters | Best For | Characteristics |
|---|---|---|---|
| L2Loss | None | No outliers | Standard least squares, quadratic growth |
| L1Loss | None | Light outliers | Linear growth, less sensitive than L2 |
| HuberLoss | k (threshold) |
Moderate outliers | Quadratic near zero, linear after threshold |
| CauchyLoss | k (scale) |
Heavy outliers | Logarithmic growth, aggressive downweighting |
| FairLoss | c (scale) |
Moderate outliers | Smooth transition, balanced robustness |
| GemanMcClureLoss | c (scale) |
Extreme outliers | Non-convex, very aggressive |
| WelschLoss | c (scale) |
Symmetric outliers | Bounded influence, Gaussian-like |
| TukeyBiweightLoss | c (threshold) |
Extreme outliers | Hard rejection beyond threshold |
| AndrewsWaveLoss | c (scale) |
Periodic errors | Sine-based, good for cyclic data |
| RamsayEaLoss | a, b |
Asymmetric outliers | Different treatment for +/- errors |
| TrimmedMeanLoss | quantile |
Known outlier % | Ignores worst residuals |
| LpNormLoss | p |
Custom robustness | Generalized Lp norm (0 < p ≤ 2) |
| BarronGeneralLoss | alpha, c |
Adaptive | Unifies many loss functions |
| TDistributionLoss | dof |
Statistical outliers | Student's t-distribution |
| AdaptiveBarronLoss | alpha, c |
Unknown outliers | Learns robustness from data |
Usage Example:
use ;
use BetweenFactorSE3;
// Create Huber loss with threshold k=1.345 (95% efficiency)
let loss = new;
// Add factor with robust loss
let factor = new;
problem.add_residual_block;
Choosing a Loss Function:
- No outliers: Use
L2Loss(default, most efficient) - < 5% outliers: Use
HuberLosswithk=1.345 - 5-20% outliers: Use
CauchyLossorFairLoss - > 20% outliers: Use
TukeyBiweightLossorGemanMcClureLoss - Unknown outlier rate: Use
AdaptiveBarronLoss(learns automatically)
See examples/loss_function_comparison.rs for a comprehensive comparison on real datasets.
Optimization Algorithms
1. Levenberg-Marquardt (Recommended)
- Adaptive damping parameter adjusts between gradient descent and Gauss-Newton
- Robust convergence even from poor initial estimates
- 9 comprehensive termination criteria (gradient norm, relative parameter change, relative cost change, trust region radius, etc.)
- Supports covariance estimation for uncertainty quantification
- Jacobi preconditioning for mixed-scale problems (enabled by default)
- Best for: General-purpose pose graph optimization
- Configuration:
new .with_max_iterations .with_cost_tolerance .with_gradient_tolerance .with_parameter_tolerance .with_compute_covariances .with_jacobi_scaling
2. Gauss-Newton
- Fast convergence near the solution
- Minimal memory requirements
- 8 comprehensive termination criteria (no trust region - uses line search)
- Best for: Well-initialized problems, online optimization
- Warning: May diverge if far from solution
3. Dog Leg Trust Region
- Combines steepest descent and Gauss-Newton
- Global convergence guarantees
- 9 comprehensive termination criteria (includes trust region radius)
- Adaptive trust region management
- Best for: Problems requiring guaranteed convergence
Enhanced Termination (v0.1.4): All optimizers now use comprehensive convergence checks with relative tolerances that scale with problem magnitude:
- Gradient Norm: First-order optimality check
- Parameter Tolerance: Relative parameter change (stops when updates become negligible)
- Cost Tolerance: Relative cost change (detects when improvement stagnates)
- Trust Region Radius: Only for LM and Dog Leg (detects trust region collapse)
- Min Cost Threshold: Optional early stopping when cost is "good enough"
- Numerical Safety: Detects NaN/Inf before returning convergence status
New status codes: TrustRegionRadiusTooSmall, MinCostThresholdReached, IllConditionedJacobian, InvalidNumericalValues
Linear Algebra Backends
Built on the high-performance faer library (v0.22):
Sparse Cholesky (Default)
- Fast: O(n) for typical SLAM problems with good sparsity
- Requirements: Positive definite Hessian (J^T * J)
- Features: Computes parameter covariance for uncertainty quantification
- Best for: Well-conditioned pose graphs
Sparse QR
- Robust: Handles rank-deficient or ill-conditioned systems
- Slower: ~1.3-1.5x Cholesky for same problem
- Best for: Poorly conditioned problems, debugging
Automatic pattern detection: Efficient symbolic factorization with fill-reducing orderings (AMD, COLAMD)
Uncertainty Quantification
New in v0.1.3: Covariance estimation for per-variable uncertainty analysis.
use ;
let config = new
.with_compute_covariances; // Enable uncertainty estimation
let mut solver = with_config;
let result = solver.optimize?;
// Access covariance matrices
if let Some = &result.covariances
How It Works:
- Computes covariance by inverting the Hessian:
Cov = (J^T * J)^-1 - Returns tangent-space covariance matrices (3×3 for SE2, 6×6 for SE3)
- Diagonal elements are variances; off-diagonal elements show correlations
- Smaller values indicate higher confidence (less uncertainty)
Requirements:
- Available for Levenberg-Marquardt with Sparse Cholesky or Sparse QR solvers
- Not yet supported for Gauss-Newton or DogLeg algorithms (planned for v0.2.0)
- Adds ~10-20% computational overhead when enabled
- Requires Hessian to be positive definite (optimization must converge)
Use Cases:
- State estimation and sensor fusion (e.g., Kalman filtering)
- Active loop closure and exploration planning
- Data association and outlier rejection
- Uncertainty propagation in robotics
See examples/covariance_estimation.rs for a complete workflow.
Prior Factors and Fixed Variables
New in v0.1.4: Anchor poses with known values and constrain specific parameter indices.
Prior Factors allow you to add soft constraints on variables with known or measured values. This is essential for:
- Anchoring the first pose to prevent gauge freedom
- Incorporating GPS measurements
- Adding initial pose estimates with uncertainty
- Regularizing under-constrained problems
Fixed Variables allow you to hard-constrain specific DOF during optimization:
- Fix x, y, z translation while optimizing rotation
- Lock specific poses (e.g., known landmarks)
- Constrain subsets of parameters
Usage Example:
use PriorFactor;
use Variable;
use SE3;
use ;
// Add prior factor to anchor first pose
let prior_pose = SE3identity;
let prior_data = prior_pose.to_vector;
let prior_factor = new;
problem.add_residual_block;
// Fix specific indices in a variable (e.g., fix Z translation)
let mut initial_values = new;
initial_values.insert;
// After initializing variables
let mut variables = problem.initialize_variables;
if let Some = variables.get_mut
Comparison:
- Prior Factor: Soft constraint with weight (can be violated if other measurements disagree)
- Fixed Variable: Hard constraint (parameter never changes during optimization)
See examples/compare_constraint_scenarios_3d.rs for a detailed comparison.
G2O File Writing
New in v0.1.3+: Export optimized pose graphs to G2O format.
use ;
use ;
// Load and optimize graph
let graph = load?;
let = graph.to_problem;
let mut solver = with_config;
let result = solver.minimize?;
// Write optimized graph to file
write?;
Supported Elements:
- SE3 vertices (
VERTEX_SE3:QUAT) - 3D poses with quaternion rotations - SE3 edges (
EDGE_SE3:QUAT) - 3D pose constraints - SE2 vertices (
VERTEX_SE2) - 2D poses (x, y, θ) - SE2 edges (
EDGE_SE2) - 2D pose constraints - Information matrices - Full 6×6 or 3×3 covariance information
Use Cases:
- Save optimized graphs for downstream processing
- Compare results with other SLAM systems (g2o, GTSAM, Ceres)
- Iterative optimization workflows (load → optimize → save → reload)
- Ground truth generation for simulations
Command-Line Usage:
# Optimize and save in one command
🔍 Key Files
Understanding the codebase:
src/core/problem.rs(1,066 LOC) - Central problem formulation and optimization interfacesrc/manifold/se3.rs(1,400 LOC) - SE(3) Lie group implementation with comprehensive testssrc/optimizer/levenberg_marquardt.rs(842 LOC) - LM algorithm with adaptive dampingsrc/linalg/cholesky.rs(415 LOC) - High-performance sparse Cholesky solversrc/io/g2o.rs(428 LOC) - Robust G2O file format parser with parallel processingexamples/- Comprehensive usage examples and benchmarks
🎨 Interactive Visualization with Rerun
New in v0.1.3: Real-time optimization debugging with integrated Rerun visualization.
Enable Visualization in Your Code
use ;
let config = new
.with_visualization; // Enable real-time visualization
let mut solver = with_config;
let result = solver.optimize?;
What Gets Visualized
The Rerun viewer displays comprehensive optimization diagnostics:
Time Series Plots (separate panels for each metric):
- Cost: Objective function value over iterations
- Gradient Norm: L2 norm of the gradient vector
- Damping (λ): Levenberg-Marquardt damping parameter
- Step Quality (ρ): Ratio of actual vs predicted cost reduction
- Step Norm: L2 norm of parameter updates
Matrix Visualizations:
- Hessian Heat Map: 100×100 downsampled visualization of sparse Hessian structure
- Gradient Vector: 100-element bar chart showing gradient magnitude
3D Pose Visualization:
- SE3 poses rendered as camera frusta (updated each iteration)
- SE2 poses shown as 2D points in the XY plane
Launch Visualization
# Automatic Rerun viewer (recommended)
# Save to file for later viewing
# Choose dataset
# Adjust optimization parameters
Visualization Features
- ✅ Zero overhead when disabled: No runtime cost in release builds without the flag
- ✅ Automatic fallback: Saves to file if Rerun viewer can't be launched
- ✅ Efficient downsampling: Large matrices automatically scaled to 100×100 for performance
- ✅ Live updates: Metrics stream in real-time during optimization
- ✅ Persistent recording: Save sessions for offline analysis
Performance Impact: ~2-5% overhead when enabled (mostly Rerun logging)
🔧 Development
Build and Test
# Build with all features
# Run comprehensive test suite (240+ tests)
# Run with optimizations
# Generate documentation
# Run benchmarks
# Check code quality
Project Structure
apex-solver/
├── src/ # Source code (~23,000 LOC)
├── examples/ # Usage examples and benchmarks
├── tests/ # Integration tests
├── data/ # Test datasets (G2O files)
├── doc/ # Extended documentation
│ ├── COMPREHENSIVE_ANALYSIS.md # Code quality analysis
│ ├── LEVENBERG_MARQUARDT_DOCUMENTATION.md
│ ├── PERFORMANCE_OPTIMIZATION_REPORT.md
│ ├── JACOBI_SCALING_EXPLANATION.md
│ ├── Lie_theory_cheat_sheet.md
│ └── profiling_guide.md
└── CLAUDE.md # AI assistant guide
Dependencies
Core Math:
nalgebra(0.33) - Linear algebra and geometry primitivesfaer(0.22) - High-performance sparse matrix operations
Parallel Computing:
rayon(1.11) - Data parallelism for optimization loops
Visualization (optional):
rerun(0.26) - 3D visualization and real-time optimization debugging
Utilities:
thiserror(2.0) - Ergonomic error managementmemmap2(0.9) - Memory-mapped file I/O for large datasets
Performance Features
- Zero-cost abstractions - Compile-time optimization of manifold operations
- SIMD acceleration - Vectorized linear algebra through
faer - Memory pool allocation - Reduced allocations in tight optimization loops
- Sparse matrix optimization - Efficient pattern caching and symbolic factorization
- Parallel residual evaluation - Uses all CPU cores via
rayon
🧠 Learning Resources
Computer Vision Background
- Multiple View Geometry (Hartley & Zisserman) - Fundamental mathematical foundations
- Visual SLAM algorithms (Durrant-Whyte & Bailey) - Probabilistic robotics principles
- g2o documentation - Reference implementation in C++
Lie Group Theory
- A micro Lie theory (Solà et al.) - Practical introduction to Lie groups in robotics
- manif library - C++ reference implementation we follow
- State Estimation for Robotics (Barfoot) - Comprehensive treatment of SO(3) and SE(3)
Optimization Theory
- Numerical Optimization (Nocedal & Wright) - Standard reference
- Trust Region Methods - Theory behind Dog Leg algorithm
- Ceres Solver Tutorial - Practical nonlinear least squares
Rust-Specific Resources
- The Rust Book - Language fundamentals
- Rust API Guidelines - Best practices
- nalgebra documentation - Linear algebra library reference
- faer documentation - Sparse solver library
🤝 Contributing
We welcome contributions! Areas of particular interest:
High Priority (v0.1.5 - Q1 2026)
- Performance optimization - Further caching optimizations, reduced allocations
- Covariance for DogLeg - Extend uncertainty estimation to Dog Leg algorithm
- Enhanced error messages - Better context and debugging information for all error cases
Medium Priority (v0.2.0 - Q2 2026)
- Incremental optimization - Efficient re-optimization when adding new factors
- Manifold extensions - Sim(3), camera intrinsics, SE2(3) transformations
- File format support - KITTI, EuRoC, additional SLAM dataset formats
- Bundle adjustment factors - Camera reprojection, stereo constraints, IMU pre-integration
- Custom factor templates - Macros for easier factor creation
Future (v1.0.0+)
- Auto-differentiation support - Optional automatic Jacobian computation
- GPU acceleration - CUDA/HIP support for large-scale problems (>100k variables)
- WASM compilation - Browser-based optimization
- Callback system enhancements - User-defined iteration callbacks (beyond visualization)
Contribution Guidelines
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests for new functionality (
cargo test) - Document your changes (update docs and examples)
- Ensure quality (
cargo clippy,cargo fmt) - Submit a pull request with clear description
Code Style:
- Follow Rust API Guidelines
- Add doc comments for public APIs
- Include examples in doc comments
- Write comprehensive tests
Review Process:
- All tests must pass (CI will check)
- Code coverage should not decrease
- Performance benchmarks for optimization changes
- Documentation for new features
📊 Benchmarks
Performance on standard datasets (Apple Mac mini M4, 64GB RAM):
| Dataset | Vertices | Edges | Algorithm | Time (ms) | Final Cost | Iterations |
|---|---|---|---|---|---|---|
| garage | 1,661 | 6,275 | LM-Cholesky | 145.2 | 3.42e+02 | 12 |
| garage | 1,661 | 6,275 | GN-Cholesky | 98.7 | 3.42e+02 | 8 |
| garage | 1,661 | 6,275 | LM-QR | 201.3 | 3.42e+02 | 12 |
| sphere | 2,500 | 9,799 | LM-Cholesky | 312.8 | 1.15e+03 | 15 |
| sphere | 2,500 | 9,799 | GN-Cholesky | 198.4 | 1.15e+03 | 9 |
| city10k | 10,000 | 40,000 | LM-Cholesky | 1,847 | 4.73e+03 | 18 |
Notes:
- Benchmarks include full optimization with convergence criteria ε = 1e-6
- LM = Levenberg-Marquardt, GN = Gauss-Newton
- Cholesky is ~1.4x faster than QR on well-conditioned problems
- GN converges faster when close to solution but LM is more robust
- Performance scales approximately O(n * k) where n = edges, k = avg. node degree
Comparison with g2o (preliminary):
- Apex Solver: ~1.3-1.8x slower than g2o on same hardware
- Trade-off: Memory safety and easier API vs raw speed
- Optimization opportunities identified (see
doc/COMPREHENSIVE_ANALYSIS.md)
🐛 Troubleshooting
Common Issues
Optimization Not Converging
Symptoms: High final cost, maximum iterations reached
Solutions:
// 1. Increase max iterations
config.with_max_iterations
// 2. Use more robust algorithm
config.with_optimizer_type
.with_damping // Higher initial damping
// 3. Try QR solver for ill-conditioned problems
config.with_linear_solver_type
// 4. Add prior factors to anchor the graph
problem.add_residual_block;
Numerical Instability (NaN costs)
Symptoms: Cost becomes NaN or Inf
Solutions:
- Check initial values are reasonable (not NaN, Inf, or extremely large)
- Verify quaternions are normalized in initial data
- Use robust loss functions (Huber) to handle outliers
- Check information matrices are positive definite
Slow Performance
Symptoms: Optimization takes too long
Solutions:
- Use Gauss-Newton for well-initialized problems
- Prefer Cholesky over QR when Hessian is well-conditioned
- Check problem sparsity pattern (should be sparse for large graphs)
- Consider problem size - very large problems (>100k variables) may need specialized techniques
Getting Help
- Documentation:
cargo doc --open - Examples: Check
examples/directory - Issues: GitHub Issues
- Discussions: GitHub Discussions
📜 License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
🙏 Acknowledgments
- manif C++ library - Mathematical conventions and reference implementation
- g2o - Inspiration and problem formulation
- Ceres Solver - Optimization algorithm insights
- faer - High-performance sparse linear algebra
- nalgebra - Geometry and linear algebra primitives
📈 Project Status
Current Version: 0.1.4 Status: Production Ready (96/100 quality score) Production Ready: Yes, for pose graph optimization and SLAM applications Last Updated: October 2025
What's New in v0.1.4
- ✅ 15 Robust Loss Functions - Comprehensive outlier rejection (Huber, Cauchy, Tukey, Welsch, Barron, and more)
- ✅ Enhanced Termination Criteria - 8-9 comprehensive convergence checks with relative tolerances
- ✅ Prior Factors - Anchor poses with known values and incorporate GPS/sensor measurements
- ✅ Fixed Variables - Hard-constrain specific parameter indices during optimization
- ✅ Relative Tolerances - Parameter and cost tolerances that scale with problem magnitude
- ✅ New OptimizationStatus Variants - Better diagnostics with
TrustRegionRadiusTooSmall,MinCostThresholdReached,IllConditionedJacobian,InvalidNumericalValues - ✅ Updated Defaults - max_iterations: 50, cost_tolerance: 1e-6, gradient_tolerance: 1e-10
- ✅ New Examples -
loss_function_comparison.rsandcompare_constraint_scenarios_3d.rs
Previous Releases (v0.1.3)
- ✅ Persistent symbolic factorization - 10-15% performance boost via cached symbolic decomposition
- ✅ Covariance for both Cholesky and QR - Complete uncertainty quantification for all linear solvers
- ✅ G2O file writing - Export optimized graphs with
G2oWriter::write() - ✅ Enhanced error messages - Structured errors (
OptimizerError) with numeric context - ✅ Binary executables - Professional CLI tools:
optimize_3d_graphandoptimize_2d_graph - ✅ Real-time Rerun visualization - Live optimization debugging with time series plots, Hessian/gradient heat maps
- ✅ Jacobi preconditioning - Automatic column scaling for robustness (enabled by default)
- ✅ Improved examples -
covariance_estimation.rsandvisualize_optimization.rs - ✅ Updated dependencies - Rerun v0.26, improved Glam integration
Roadmap
v0.1.5 (Q1 2026) - Advanced Features:
- 🔄 Incremental optimization - Efficient re-optimization with new factors
- 📂 More file formats - KITTI, EuRoC, custom SLAM datasets
- 📷 Bundle adjustment factors - Reprojection, stereo constraints, IMU pre-integration
- 📐 Additional manifolds - Sim(3), camera intrinsics, SE2(3)
- 🎯 Custom factor macros - Simplified factor creation
v1.0.0 (Q2 2026) - Stable Release:
- ✅ API stability guarantees - Semver commitment
- 🤖 Optional auto-differentiation - Complement to analytic Jacobians
- 🚀 Performance benchmarks - Comprehensive comparison vs g2o/Ceres/GTSAM
- 🌐 WASM compilation - Browser-based optimization
- 📚 Comprehensive tutorials - Full documentation suite
Built with 🦀 Rust for performance, safety, and mathematical correctness.