// // Created by zx on 23-6-20. // #ifndef GTSAM_TEST_POSESPEEDFACTOR_H #define GTSAM_TEST_POSESPEEDFACTOR_H #include #include #include #include #include #include using namespace gtsam; class PoseSpeedFactor :public gtsam::NoiseModelFactor3{ public: PoseSpeedFactor(Key p1, Key v1,Key p2,Vector3 dt, const SharedNoiseModel& model): NoiseModelFactor3(model, p1,v1,p2), dt_(dt) {} virtual Vector evaluateError(const Pose2& p1, const Vector2 & v1, const Pose2& p2, boost::optional H1 = boost::none, boost::optional H2 = boost::none, boost::optional H3 = boost::none) const; virtual gtsam::NonlinearFactor::shared_ptr clone() const { return boost::static_pointer_cast( gtsam::NonlinearFactor::shared_ptr(new PoseSpeedFactor(*this))); } protected: Vector3 dt_; }; #endif //GTSAM_TEST_POSESPEEDFACTOR_H