symforce-org/symforce
Fast symbolic computation, code generation, and nonlinear optimization for robotics
What it solves
SymForce addresses the challenge of developing high-performance robotics software where there is typically a trade-off between the flexibility of symbolic mathematics and the execution speed of handwritten, optimized C++ code. It eliminates the need for bug-prone handwritten derivatives (Jacobians) and reduces the duplication of logic between prototyping and production code.
How it works
SymForce provides a three-part system to bridge the gap between math and production:
- Symbolic Toolkit: Extends the SymPy API to provide specialized types for geometry, cameras, and Lie group calculus, allowing users to model complex robotics problems symbolically.
- Code Generator: Transforms these symbolic expressions into highly optimized, branchless runtime code in C++ or other target languages. It leverages strategies like flattening computation and sparsity to achieve significant speedups over standard automatic differentiation.
- Optimization Library: A fast tangent-space optimization library based on factor graphs, designed for real-time robotics applications. It can directly use the generated functions as factors in nonlinear optimization.
Who it’s for
It is designed for robotics engineers and researchers working on tasks such as SLAM (Simultaneous Localization and Mapping), bundle adjustment, calibration, and sparse nonlinear MPC (Model Predictive Control).
Highlights
- Automatic Jacobian Computation: Automatically computes tangent-space Jacobians, removing the need for manual derivation.
- High Performance: Generates embedded-friendly C++ code (using Eigen) with zero dynamic memory allocation.
- Singularity Handling: Uses a specialized epsilon-based system to handle mathematical singularities (like
atan2at 0,0) during runtime evaluation. - Seamless Workflow: Enables rapid prototyping in Python with a direct path to production-ready C++ code.
Related
- Project
- Project
- Project
- Project
- Project