30 using namespace gtsam;
37 if (Hv) *Hv = s * I_3x3;
50 int main(
int argc,
char** argv) {
52 const double L1 = 3.5, L2 = 3.5, L3 = 2.5;
53 const Pose2 sXt0(0, L1 + L2 + L3,
M_PI / 2);
54 const Vector3 xi1(0, 0, 1), xi2(L1, 0, 1),
69 Pose2 desiredEndEffectorPose(3, 2, 0);
70 auto model = noiseModel::Diagonal::Sigmas(
Vector3(0.2, 0.2, 0.1));
78 initial.
print(
"\nInitial Estimate:\n");
83 params.setlambdaInitial(1e6);
86 result.
print(
"Final Result:\n");
Vector3_ operator*(const Double_ &s, const Vector3_ &v)
virtual const Values & optimize()
noiseModel::Diagonal::shared_ptr model
Pose2_ Expmap(const Vector3_ &xi)
NonlinearFactorGraph graph
Expression< Pose2 > Pose2_
T compose(const T &t1, const T &t2)
static const SmartProjectionParams params
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Factor graph that supports adding ExpressionFactors directly.
Array< int, Dynamic, 1 > v
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
int main(int argc, char **argv)
T value(const Values &values, std::vector< Matrix > *H=nullptr) const
Return value and optional derivatives, reverse AD version Notes: this is not terribly efficient...
void insert(Key j, const Value &val)
void addExpressionFactor(const Expression< T > &h, const T &z, const SharedNoiseModel &R)
A class for computing marginals in a NonlinearFactorGraph.
Vector3 scalarMultiply(const double &s, const Vector3 &v, OptionalJacobian< 3, 1 > Hs, OptionalJacobian< 3, 3 > Hv)
Expression< Vector3 > Vector3_