Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the differences between examples and documentation (#409) #410

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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