26 typedef boost::shared_ptr<VelocityConstraint3 > shared_ptr;
34 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
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 {
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));
This is the base class for all factor types.
Definition: Factor.h:54
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
x1 + v*dt - x2 = 0, with optional derivatives
Definition: VelocityConstraint3.h:39
VelocityConstraint3(Key key1, Key key2, Key velKey, double dt, double mu=1000.0)
TODO: comment.
Definition: VelocityConstraint3.h:29
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: VelocityConstraint3.h:34
const SharedNoiseModel & noiseModel() const
access to the noise model
Definition: NonlinearFactor.h:210
A convenient base class for creating your own NoiseModelFactor with 3 variables.
Definition: NonlinearFactor.h:420
Definition: VelocityConstraint3.h:13
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Key key1() const
methods to retrieve keys
Definition: NonlinearFactor.h:454
friend class boost::serialization::access
Serialization function.
Definition: VelocityConstraint3.h:53
VelocityConstraint3()
default constructor to allow for serialization
Definition: VelocityConstraint3.h:20