C++ API¶
Include <spatial_casadi/spatial.hpp> and instantiate the classes with
casadi::DM, casadi::SX or casadi::MX. C++ uses the same column/block
layouts as Python’s CasADi inputs. Use compose or operator*, power
and at for composition, powers and indexing. size() reports batch size.
using casadi::SX;
using spatial_casadi::RigidTransform;
SX x = SX::sym("x", 6);
auto pose = RigidTransform<SX>::from_exp_coords(x);
SX point = pose.apply(SX(std::vector<double>{1, 0, 0}));
casadi::Function f("point", {x}, {point, SX::jacobian(point, x)});
-
template<class T>
class Rotation¶ Rotations stored as scalar-last quaternion columns (4 x N).
-
template<class T>
class RigidTransform¶ Rigid transforms: p_parent = rotation.apply(p_child) + translation.
-
template<class T>
class Slerp¶ Piecewise shortest-path spherical interpolation over fixed knot times.
-
template<class T>
class Translation¶ Compatibility wrapper for a translation vector.