35 typedef gtsam::NoiseModelFactor2<PoseRTV,PoseRTV>
Base;
38 using Base::evaluateError;
51 double dt,
double mu = 1000)
52 : Base(noiseModel::Constrained::All(3,
mu), key1, key2), dt_(dt), integration_mode_(mode) {}
59 : Base(noiseModel::Constrained::All(3,
mu), key1, key2),
60 dt_(dt), integration_mode_(dynamics::
TRAPEZOIDAL) {}
67 : Base(model, key1, key2), dt_(dt), integration_mode_(mode) {}
74 : Base(model, key1, key2), dt_(dt), integration_mode_(dynamics::
TRAPEZOIDAL) {}
88 if (H1) *H1 = gtsam::numericalDerivative21<gtsam::Vector,PoseRTV,PoseRTV>(
90 std::placeholders::_2, dt_, integration_mode_),
x1,
x2, 1
e-5);
91 if (H2) *H2 = gtsam::numericalDerivative22<gtsam::Vector,PoseRTV,PoseRTV>(
93 std::placeholders::_2, dt_, integration_mode_),
x1,
x2, 1
e-5);
98 std::string
a =
"VelocityConstraint: " +
s;
100 switch(integration_mode_) {
104 default: std::cout <<
"Integration: Unknown\n" << std::endl;
break;
106 std::cout <<
"dt: " << dt_ << std::endl;
120 default: assert(
false);
break;
VelocityConstraint(Key key1, Key key2, double dt, double mu=1000)
noiseModel::Diagonal::shared_ptr model
VelocityConstraint(Key key1, Key key2, double dt, const gtsam::SharedNoiseModel &model)
Vector3 Velocity3
Velocity is currently typedef'd to Vector3.
Some functions to compute numerical derivatives.
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
gtsam::NoiseModelFactor2< PoseRTV, PoseRTV > Base
gtsam::Vector evaluateError(const PoseRTV &x1, const PoseRTV &x2, OptionalMatrixType H1, OptionalMatrixType H2) const override
static gtsam::Vector evaluateError_(const PoseRTV &x1, const PoseRTV &x2, double dt, const dynamics::IntegrationMode &mode)
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
VelocityConstraint(Key key1, Key key2, const dynamics::IntegrationMode &mode, double dt, const gtsam::SharedNoiseModel &model)
Matrix * OptionalMatrixType
const Symbol key1('v', 1)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Pose3 with translational velocity.
Non-linear factor base classes.
std::shared_ptr< This > shared_ptr
Vector evaluateError_(const PointReferenceFrameFactor &c, const Point2 &global, const Pose2 &trans, const Point2 &local)
VelocityConstraint(Key key1, Key key2, const dynamics::IntegrationMode &mode, double dt, double mu=1000)
static const DiscreteKey mode(modeKey, 2)
~VelocityConstraint() override
std::uint64_t Key
Integer nonlinear key type.
void print(const std::string &s="", const gtsam::KeyFormatter &formatter=gtsam::DefaultKeyFormatter) const override
dynamics::IntegrationMode integration_mode_
time difference between frames in seconds
const Velocity3 & v() const
noiseModel::Base::shared_ptr SharedNoiseModel
const Symbol key2('v', 2)
gtsam::NonlinearFactor::shared_ptr clone() const override