26 typedef boost::shared_ptr<VelocityConstraint3 > shared_ptr;
34 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
35 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
39 Vector
evaluateError(
const double& x1,
const double& x2,
const double& v,
40 boost::optional<Matrix&> H1 = boost::none,
41 boost::optional<Matrix&> H2 = boost::none,
42 boost::optional<Matrix&> H3 = boost::none)
const override {
44 if (H1) *H1 = Matrix::Identity(p,p);
45 if (H2) *H2 = -Matrix::Identity(p,p);
46 if (H3) *H3 = Matrix::Identity(p,p)*dt_;
47 return (Vector(1) << x1+v*dt_-x2).finished();
54 template<
class ARCHIVE>
55 void serialize(ARCHIVE & ar,
const unsigned int ) {
56 ar & boost::serialization::make_nvp(
"NoiseModelFactor3",
57 boost::serialization::base_object<Base>(*
this));
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
This is the base class for all factor types.
Definition: Factor.h:56
const SharedNoiseModel & noiseModel() const
access to the noise model
Definition: NonlinearFactor.h:211
A convenient base class for creating your own NoiseModelFactor with 3 variables.
Definition: NonlinearFactor.h:444
Key key1() const
methods to retrieve keys
Definition: NonlinearFactor.h:478
Definition: VelocityConstraint3.h:13
VelocityConstraint3()
default constructor to allow for serialization
Definition: VelocityConstraint3.h:20
VelocityConstraint3(Key key1, Key key2, Key velKey, double dt, double mu=1000.0)
TODO: comment.
Definition: VelocityConstraint3.h:29
Vector evaluateError(const double &x1, const double &x2, const double &v, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none) const override
x1 + v*dt - x2 = 0, with optional derivatives
Definition: VelocityConstraint3.h:39
friend class boost::serialization::access
Serialization function.
Definition: VelocityConstraint3.h:53
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition: VelocityConstraint3.h:34