30 using namespace std::placeholders;
31 using namespace gtsam;
50 Pose3 init_pose = Pose3::Identity();
51 Pose3 anchor_pose = Pose3::Identity();
52 graph.
addPrior(
X(0), init_pose, noiseModel::Isotropic::Sigma(6, 0.001));
53 graph.
addPrior(
X(1), anchor_pose, noiseModel::Isotropic::Sigma(6, 0.001));
56 Vector4 measurement0(-1.0, 0.0, 0.0, 3.0);
59 measurement0, noiseModel::Isotropic::Sigma(3, 0.1),
X(0),
X(1),
P(0));
142 Key planeKey(1),
poseKey(2), anchorPoseKey(3);
159 Matrix actualH1, actualH2, actualH3;
160 factor.
evaluateError(poseLin, anchorPoseLin, pLin, actualH1, actualH2,
189 auto x0_noise = noiseModel::Isotropic::Sigma(6, 0.01);
190 auto x1_noise = noiseModel::Isotropic::Sigma(6, 0.01);
195 const Plane
p1(0, 0, 1, 1),
p2(0, 0, 1, 2);
197 auto p1_in_x1 =
p1.transform(
x1);
198 auto p2_in_x1 =
p2.transform(
x1);
199 auto p1_noise = noiseModel::Diagonal::Sigmas(
Vector3{1, 1, 5});
200 auto p2_noise = noiseModel::Diagonal::Sigmas(
Vector3{1, 1, 5});
206 auto p1_measured_from_x0 =
p1.transform(
x0);
208 auto p2_measured_from_x0 =
p2.transform(
x0);
209 const auto x0_p1_noise = noiseModel::Isotropic::Sigma(3, 0.05);
210 const auto x0_p2_noise = noiseModel::Isotropic::Sigma(3, 0.05);
212 p1_measured_from_x0.planeCoefficients(), x0_p1_noise,
X(0),
X(1),
P(1));
214 p2_measured_from_x0.planeCoefficients(), x0_p2_noise,
X(0),
X(1),
P(2));
220 initialEstimate.insert(
P(1), p1_in_x1);
221 initialEstimate.insert(
P(2), p2_in_x1);
222 initialEstimate.insert(
X(0), x0_initial);
223 initialEstimate.insert(
X(1),
x1);
235 cerr <<
"CAPTURED THE EXCEPTION: "
243 srand(
time(
nullptr));