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;
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
void insert(Key j, const Value &val)
Pose2_ Expmap(const Vector3_ &xi)
NonlinearFactorGraph graph
Expression< Pose2 > Pose2_
T compose(const T &t1, const T &t2)
Factor graph that supports adding ExpressionFactors directly.
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
static SmartStereoProjectionParams params
int main(int argc, char **argv)
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
T value(const Values &values, boost::optional< std::vector< Matrix > & > H=boost::none) const
Return value and optional derivatives, reverse AD version Notes: this is not terribly efficient...
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_