Skip to content

Commit

Permalink
Added setDefault and loadFromYaml functions in ICPSequence class. (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpierredeschenes authored Aug 27, 2019
1 parent ff33c48 commit eb9457d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions pointmatcher/ICP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,28 @@ void PointMatcher<T>::ICPSequence::clearMap()
mapPointCloud = DataPoints();
}

template<typename T>
void PointMatcher<T>::ICPSequence::setDefault()
{
ICPChainBase::setDefault();

if(mapPointCloud.getNbPoints() > 0)
{
this->matcher->init(mapPointCloud);
}
}

template<typename T>
void PointMatcher<T>::ICPSequence::loadFromYaml(std::istream& in)
{
ICPChainBase::loadFromYaml(in);

if(mapPointCloud.getNbPoints() > 0)
{
this->matcher->init(mapPointCloud);
}
}

//! Return the map, in global coordinates (slow)
template<typename T>
const typename PointMatcher<T>::DataPoints PointMatcher<T>::ICPSequence::getPrefilteredMap() const
Expand Down
4 changes: 3 additions & 1 deletion pointmatcher/PointMatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ struct PointMatcher

virtual void setDefault();

void loadFromYaml(std::istream& in);
virtual void loadFromYaml(std::istream& in);
unsigned getPrefilteredReadingPtsCount() const;
unsigned getPrefilteredReferencePtsCount() const;

Expand Down Expand Up @@ -733,6 +733,8 @@ struct PointMatcher
bool hasMap() const;
bool setMap(const DataPoints& map);
void clearMap();
virtual void setDefault();
virtual void loadFromYaml(std::istream& in);
PM_DEPRECATED("Use getPrefilteredInternalMap instead. "
"Function now always returns map with filter chain applied. "
"This may have altered your program behavior."
Expand Down

0 comments on commit eb9457d

Please sign in to comment.