/** * @file expressions.h * @brief Common expressions for solving geometry/slam/sfm problems * @date Oct 1, 2014 * @author Frank Dellaert */ #pragma once #include #include #include namespace gtsam { // Generics template Expression between(const Expression& t1, const Expression& t2) { return Expression(t1, &T::between, t2); } // 2D Geometry typedef Expression Point2_; typedef Expression Rot2_; typedef Expression Pose2_; Point2_ transform_to(const Pose2_& x, const Point2_& p) { return Point2_(x, &Pose2::transform_to, p); } // 3D Geometry typedef Expression Point3_; typedef Expression Rot3_; typedef Expression Pose3_; Point3_ transform_to(const Pose3_& x, const Point3_& p) { return Point3_(x, &Pose3::transform_to, p); } // Projection typedef Expression Cal3_S2_; Point2_ project(const Point3_& p_cam) { return Point2_(PinholeCamera::project_to_camera, p_cam); } template Point2_ uncalibrate(const Expression& K, const Point2_& xy_hat) { return Point2_(K, &CAL::uncalibrate, xy_hat); } } // \namespace gtsam