42 bool checkOnlyNext =
false,
bool shouldDelete =
true,
bool shouldConcat =
true) :
43 FilterBasic(posesToExplorePtr), concatCount(0), deleteCount(0), positionDistanceThreshold(positionDistanceThreshold),
44 orientationRadDistanceThreshold(orientationRadDistanceThreshold), checkOnlyNext(checkOnlyNext), shouldDelete(shouldDelete), shouldConcat(shouldConcat),
58 ROS_INFO_STREAM(
"Number of concatenated ptu_tuple by ConcatApproxEqualePoses: " << concatCount <<
" (number is not representative)");
61 ROS_INFO_STREAM(
"Number of deleted ptu_tuple by ConcatApproxEqualePoses: " << deleteCount);
66 bool shouldPtuTupleBeDeleted(
const RobotStatePtrVec::iterator &posesToExploreIter,
const PtuTuplePtrVec::iterator &ptuTuplePtrIter) {
69 robotEnd = posesToExploreIter + 2;
73 for (RobotStatePtrVec::iterator posesToExploreCompareIter = posesToExploreIter + 1; posesToExploreCompareIter != robotEnd; ++posesToExploreCompareIter) {
75 if (poseHelperPtr->checkPosesAreApproxEquale(*posesToExploreIter->get()->getRobotPosePtr(),
78 bool isEquale =
false;
79 PtuTuplePtrVec::iterator ptuTuplePtrCompareIter = posesToExploreCompareIter->get()->getPtuTuplePtrVecPtr()->begin();
80 for (;ptuTuplePtrCompareIter != posesToExploreCompareIter->get()->getPtuTuplePtrVecPtr()->end(); ++ptuTuplePtrCompareIter) {
81 if (ptuTuplePtrCompareIter->get()->getPan() == ptuTuplePtrIter->get()->getPan()
82 && ptuTuplePtrCompareIter->get()->getTilt() == ptuTuplePtrIter->get()->getTilt()) {
91 SearchedObjectTypes firstSearchObjectTypes = ptuTuplePtrCompareIter->get()->getAlreadySearchedObjectTypes();
92 SearchedObjectTypes secondSearchObjectTypes = ptuTuplePtrIter->get()->getAlreadySearchedObjectTypes();
93 ptuTuplePtrCompareIter->get()->resetAlreadySearchedObjectTypes();
95 ptuTuplePtrCompareIter->get()->addAlreadySearchedObjectTypes(intersectionSearchObjectTypes);
101 posesToExploreCompareIter->get()->getPtuTuplePtrVecPtr()->insert(posesToExploreCompareIter->get()->getPtuTuplePtrVecPtr()->end() - 1, *ptuTuplePtrIter);
bool wasIterationSuccessful()
boost::shared_ptr< ConcatApproxEqualePoses > ConcatApproxEqualePosesPtr
bool shouldPtuTupleBeDeleted(const RobotStatePtrVec::iterator &posesToExploreIter, const PtuTuplePtrVec::iterator &ptuTuplePtrIter)
std::vector< std::string > SearchedObjectTypes
const RobotStatePtrVecPtr & posesToExplorePtr
PoseHelperPtr poseHelperPtr
virtual ~ConcatApproxEqualePoses()
double orientationRadDistanceThreshold
#define ROS_INFO_STREAM(args)
SearchedObjectTypes getIntersectionOfSearchObjectTypes(const SearchedObjectTypes &first_searched_object_types, const SearchedObjectTypes &second_searched_object_types)
ConcatApproxEqualePoses(const RobotStatePtrVecPtr &posesToExplorePtr, double positionDistanceThreshold, double orientationRadDistanceThreshold, bool checkOnlyNext=false, bool shouldDelete=true, bool shouldConcat=true)
double positionDistanceThreshold