32 using namespace gtsam;
34 int main(
int argc,
char** argv){
35 cout <<
"== Robust Pose Averaging Example === " << endl;
38 size_t nrInliers = 10;
39 size_t nrOutliers = 10;
43 nrInliers = atoi(argv[1]);
45 nrOutliers = atoi(argv[2]);
46 cout <<
"nrInliers " << nrInliers <<
" nrOutliers "<< nrOutliers << endl;
51 uniform_real_distribution<double>
uniform(-10, 10);
52 normal_distribution<double> normalInliers(0.0, 0.05);
59 for(
size_t i = 0;
i < 6; ++
i){
67 for(
size_t i=0;
i<nrInliers;
i++){
69 for(
size_t i = 0;
i < 6; ++
i){
70 poseNoise(
i) = normalInliers(rng);
77 for(
size_t i=0;
i<nrOutliers;
i++){
79 for(
size_t i = 0;
i < 6; ++
i){
91 Values estimate = gnc.optimize();
93 cout <<
"norm of translation error: " << poseError.
translation().norm() <<
94 " norm of rotation error: " << poseError.
rotation().
rpy().norm() << endl;
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
static std::uniform_real_distribution uniform(0.0, 1.0)
A non-templated config holding any types of Manifold-group elements.
noiseModel::Diagonal::shared_ptr model
Pose2_ Expmap(const Vector3_ &xi)
NonlinearFactorGraph graph
IsDerived< DERIVEDFACTOR > add(std::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
Vector3 rpy(OptionalJacobian< 3, 3 > H={}) const
std::shared_ptr< Isotropic > shared_ptr
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
int main(int argc, char **argv)
Class between(const Class &g) const
void insert(Key j, const Value &val)
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself={}) const
get rotation