19 #include <ISM/utility/GeometryHelper.hpp> 34 ROS_INFO_STREAM(
"Pose prediction is run for scene " << patternName <<
".");
35 ROS_INFO_STREAM(
"It is run for a reference with the pose " << referencePose <<
".");
44 std::string patternName,
51 ROS_DEBUG(
"Taking votes for object %s",
object.first.c_str());
56 std::vector<ISM::VoteSpecifierPtr> specifiers =
votes_.at(patternName).at(
object.first).at(
object.second);
57 ROS_DEBUG_STREAM(
"object: " <<
object.first << std::endl <<
"specifiers size" << specifiers.size());
60 for (
auto& specifier : specifiers)
68 if (skipOtherSpecifiers)
break;
73 for (
auto& specifier : specifiers)
80 if (skipOtherSpecifiers)
break;
86 ROS_DEBUG(
"Object %s was already found, no further proceeding",
object.first.c_str());
93 PointPtr absPosition = GeometryHelper::getSourcePoint(referencePose,
94 specifier->refToObjectQuat,
96 PosePtr absPose = GeometryHelper::getSourcePose(referencePose,
98 specifier->refToObjectPoseQuat);
99 if(ISM::GeometryHelper::poseEqual(referencePose, absPose))
102 unsigned int numberOfHypotheses = weight * specifiersSize;
113 ISM::VoteSpecifierPtr specifier,
114 ISM::PosePtr &referencePose,
116 unsigned int specifiersSize)
120 PointPtr absPosition = GeometryHelper::getSourcePoint(referencePose,
121 specifier->refToObjectQuat,
123 PosePtr absPose = GeometryHelper::getSourcePose(referencePose,
125 specifier->refToObjectPoseQuat);
126 if(GeometryHelper::poseEqual(referencePose, absPose))
128 ROS_DEBUG(
"Object %s is identical to the reference of the ism in which it is object", objectType.c_str());
129 unsigned int numberOfHypotheses = specifiersSize * weight;
ISM::PatternToObjectToVoteMap votes_
void addPointToPointCloud(ISM::PosePtr pose_to_add, std::string type, std::string identifier)
RecognizerPredictionISM::addPointToPointCloud Adds an ISM Pose with object type and identifier as att...
AttributedPointCloud attributed_point_cloud_
std::set< IsmObject > IsmObjectSet
bool referenceObjectProcessing(std::string objectType, ISM::VoteSpecifierPtr specifier, ISM::PosePtr &referencePose, unsigned int weight, unsigned int specifiersSize)
referenceObjectProcessing Processes a reference object. Processes the following steps.
void createAttributedPointCloud(ISM::PosePtr reference_pose_ptr, double percentage_of_records_for_prediction)
void addPointToPointCloudWithNumber(ISM::PosePtr poseToAdd, IsmObject object, unsigned int numberOfHypotheses)
AttributedPointCloud predictUnfoundPoses(ISM::PosePtr &referencePose, std::string patternName, double numberOfSpecifiers)
RecognizerPredictionISM::calcUnfoundPoses Processes the following steps for each object in the object...
PaperPredictionNonNormalized(std::string dbfileName)
#define ROS_DEBUG_STREAM(args)
std::pair< std::string, std::string > IsmObject
bool isReferenceObject(IsmObject object)
#define ROS_INFO_STREAM(args)
bool nonReferenceObjectProcessing(IsmObject object, ISM::VoteSpecifierPtr specifier, ISM::PosePtr &referencePose, unsigned int weight, unsigned int specifiersSize)
nonReferenceObjectProcessing Processes a non reference Object Processes the following steps...
~PaperPredictionNonNormalized()
void calculateRecursiveUnfoundPoses(ISM::PosePtr &referencePose, std::string patternName, unsigned int weight)
bool isFoundObject(IsmObject object)
IsmObjectSet getObjectTypesAndIdsBelongingToPattern(std::string type)
asr_msgs::AsrAttributedPointCloud AttributedPointCloud