gafro: Geometric Algebra for Robotics
Abstract
Geometry is a fundamental part of robotics and there have been various frameworks of representation over the years. Recently, geometric algebra has gained attention for its property of unifying many of those previous ideas into one algebra. While there are already efficient open-source implementations of geometric algebra available, none of them is targeted at robotics applications. We want to address this shortcoming with our library gafro. This article presents an overview of the implementation details as well as a tutorial of gafro, an efficient c++ library targeting robotics applications using geometric algebra. The library focuses on using conformal geometric algebra. Hence, various geometric primitives are available for computation as well as rigid body transformations. The modeling of robotic systems is also an important aspect of the library. It implements various algorithms for calculating the kinematics and dynamics of such systems as well as objectives for optimisation problems. The software stack is completed by python bindings in pygafro and a ROS interface in gafro_ros.
Geometric Primitives
Conformal geometric algebra represents points, lines, planes, spheres, circles and point pairs as elements of one algebra, so the same operations apply to all of them. Each primitive below is constructed with the gafro API and rendered directly from the library, compiled to WebAssembly.
Interactive 3D demo
Every CGA primitive gafro provides. Drag to orbit, scroll to zoom.
Intersections
Because primitives live in the same algebra, intersecting them is a single product rather than a special case per pair of shapes: the meet of a line and a sphere is computed the same way as that of two planes.
Interactive 3D demo
Intersections computed with the meet operator.