Skip to content

Commit

Permalink
Merge pull request #410 from AlexandreG87/fix/typo
Browse files Browse the repository at this point in the history
Fixed the differences between examples and documentation (#409)
  • Loading branch information
pomerlef authored Oct 19, 2020
2 parents 5a72892 + a212a3a commit ab744ca
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
38 changes: 20 additions & 18 deletions doc/ICPWithoutYaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ Prepare the objects for the DataFilters:
// Prepare reading filters
name = "MinDistDataPointsFilter";
params["minDist"] = "1.0";
PM::DataPointsFilter* minDist_read =
std::shared_ptr<PM::DataPointsFilter> minDist_read =
PM::get().DataPointsFilterRegistrar.create(name, params);
params.clear();

name = "RandomSamplingDataPointsFilter";
params["prob"] = "0.05";
PM::DataPointsFilter* rand_read =
std::shared_ptr<PM::DataPointsFilter> rand_read =
PM::get().DataPointsFilterRegistrar.create(name, params);
params.clear();

// Prepare reference filters
name = "MinDistDataPointsFilter";
params["minDist"] = "1.0";
PM::DataPointsFilter* minDist_ref =
std::shared_ptr<PM::DataPointsFilter> minDist_ref =
PM::get().DataPointsFilterRegistrar.create(name, params);
params.clear();

name = "RandomSamplingDataPointsFilter";
params["prob"] = "0.05";
PM::DataPointsFilter* rand_ref =
std::shared_ptr<PM::DataPointsFilter> rand_ref =
PM::get().DataPointsFilterRegistrar.create(name, params);
params.clear();
```
Expand All @@ -51,7 +51,7 @@ Prepare the objects for the Matchers:
name = "KDTreeMatcher";
params["knn"] = "1";
params["epsilon"] = "3.16";
PM::Matcher* kdtree =
std::shared_ptr<PM::Matcher> kdtree =
PM::get().MatcherRegistrar.create(name, params);
params.clear();
```
Expand All @@ -62,7 +62,7 @@ Prepare the objects for the OutlierFilters:
// Prepare outlier filters
name = "TrimmedDistOutlierFilter";
params["ratio"] = "0.75";
PM::OutlierFilter* trim =
std::shared_ptr<PM::OutlierFilter> trim =
PM::get().OutlierFilterRegistrar.create(name, params);
params.clear();
```
Expand All @@ -72,7 +72,7 @@ Prepare the object for the ErrorMinimizer:
```cpp
// Prepare error minimization
name = "PointToPointErrorMinimizer";
PM::ErrorMinimizer* pointToPoint =
std::shared_ptr<PM::ErrorMinimizer> pointToPoint =
PM::get().ErrorMinimizerRegistrar.create(name);
```

Expand All @@ -82,15 +82,15 @@ Prepare the objects for the TransformationCheckers:
// Prepare outlier filters
name = "CounterTransformationChecker";
params["maxIterationCount"] = "150";
PM::TransformationChecker* maxIter =
std::shared_ptr<PM::TransformationChecker> maxIter =
PM::get().TransformationCheckerRegistrar.create(name, params);
params.clear();

name = "DifferentialTransformationChecker";
params["minDiffRotErr"] = "0.001";
params["minDiffTransErr"] = "0.01";
params["smoothLength"] = "4";
PM::TransformationChecker* diff =
std::shared_ptr<PM::TransformationChecker> diff =
PM::get().TransformationCheckerRegistrar.create(name, params);
params.clear();
```
Expand All @@ -99,19 +99,19 @@ Prepare the objects for the Inspector:
```cpp
// Prepare inspector
PM::Inspector* nullInspect =
std::shared_ptr<PM::Inspector> nullInspect =
PM::get().InspectorRegistrar.create("NullInspector");
```

Prepare the objects for the Transformation:

```cpp
// Prepare transformation
PM::Transformation* rigidTrans =
std::shared_ptr<PM::Transformation> rigidTrans =
PM::get().TransformationRegistrar.create("RigidTransformation");
```
Finally, build the complet solution:
Finally, build the complete solution:
```cpp
// Build ICP solution
Expand All @@ -121,16 +121,18 @@ icp.readingDataPointsFilters.push_back(rand_read);
icp.referenceDataPointsFilters.push_back(minDist_ref);
icp.referenceDataPointsFilters.push_back(rand_ref);
icp.matcher.reset(kdtree);
icp.matcher = kdtree;
icp.outlierFilters.push_back(trim);
icp.errorMinimizer.reset(pointToPoint);
icp.errorMinimizer = pointToPoint;
icp.transformationCheckers.push_back(maxIter);
icp.transformationCheckers.push_back(diff);
icp.inspector.reset(nullInspect);
// toggle to write vtk files per iteration
icp.inspector = nullInspect;
//icp.inspector = vtkInspect;
icp.transformations.push_back(rigidTrans);
```
4 changes: 2 additions & 2 deletions doc/Transformations.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ int main(int argc, char *argv[]) {

std::cout << "Transformation Matrix: " << std::endl << T << std::endl;

PM::Transformation* rigidTrans;
rigidTrans = PM::get().REG(Transformation).create("RigidTransformation").get();
std::shared_ptr<PM::Transformation> rigidTrans;
rigidTrans = PM::get().REG(Transformation).create("RigidTransformation");

if (!rigidTrans->checkParameters(T)) {
std::cout << "WARNING: T does not represent a valid rigid transformation\nProjecting onto an orthogonal basis"
Expand Down
15 changes: 7 additions & 8 deletions examples/icp_customized.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@ int main(int argc, char *argv[])
std::shared_ptr<PM::Inspector> nullInspect =
PM::get().InspectorRegistrar.create("NullInspector");

//name = "VTKFileInspector";
// params["dumpDataLinks"] = "1";
// params["dumpReading"] = "1";
// params["dumpReference"] = "1";
// name = "VTKFileInspector";
// params["dumpDataLinks"] = "1";
// params["dumpReading"] = "1";
// params["dumpReference"] = "1";
// std::shared_ptr<PM::Inspector> vtkInspect =
// PM::get().InspectorRegistrar.create(name, params);
// params.clear();

//PM::Inspector* vtkInspect =
// PM::get().InspectorRegistrar.create(name, params);
params.clear();

// Prepare transformation
std::shared_ptr<PM::Transformation> rigidTrans =
PM::get().TransformationRegistrar.create("RigidTransformation");
Expand Down

0 comments on commit ab744ca

Please sign in to comment.