48 double dt,
double mu = 1000)
49 : Base(noiseModel::Constrained::All(3,
mu), key1, key2), dt_(dt), integration_mode_(mode) {}
56 : Base(noiseModel::Constrained::All(3,
mu), key1, key2),
57 dt_(dt), integration_mode_(dynamics::
TRAPEZOIDAL) {}
64 : Base(model, key1, key2), dt_(dt), integration_mode_(mode) {}
71 : Base(model, key1, key2), dt_(dt), integration_mode_(dynamics::
TRAPEZOIDAL) {}
84 boost::optional<gtsam::Matrix&> H1=boost::none,
85 boost::optional<gtsam::Matrix&> H2=boost::none)
const override {
86 if (H1) *H1 = gtsam::numericalDerivative21<gtsam::Vector,PoseRTV,PoseRTV>(
88 if (H2) *H2 = gtsam::numericalDerivative22<gtsam::Vector,PoseRTV,PoseRTV>(
94 std::string
a =
"VelocityConstraint: " +
s;
96 switch(integration_mode_) {
100 default: std::cout <<
"Integration: Unknown\n" << std::endl;
break;
102 std::cout <<
"dt: " << dt_ << std::endl;
116 default: assert(
false);
break;
void print(const Matrix &A, const string &s, ostream &stream)
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)
gtsam::NoiseModelFactor2< PoseRTV, PoseRTV > Base
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)
const Symbol key1('v', 1)
const Velocity3 & v() const
boost::shared_ptr< This > shared_ptr
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Pose3 with translational velocity.
gtsam::Vector evaluateError(const PoseRTV &x1, const PoseRTV &x2, boost::optional< gtsam::Matrix & > H1=boost::none, boost::optional< gtsam::Matrix & > H2=boost::none) const override
Non-linear factor base classes.
const Symbol key2('v', 2)
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)
~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
noiseModel::Base::shared_ptr SharedNoiseModel
gtsam::NonlinearFactor::shared_ptr clone() const override