42 boost::optional<std::string> referenceTo = pPt.get_optional<std::string>(
"<xmlattr>.references");
46 mReferenceTo = boost::lexical_cast<
unsigned int>(*referenceTo);
60 for(boost::property_tree::ptree::value_type &v: pPt)
63 if(!std::strcmp(v.first.c_str(),
"child"))
78 mVisualizer.reset(
new Visualization::ProbabilisticSecondarySceneObjectVisualization());
87 for(
unsigned int i = 0; i <
mChildren.size(); i++)
101 unsigned int oldSlotId = pSlotId;
107 std::vector<boost::shared_ptr<HierarchicalShapeModelNode>> children;
112 if(pCut || pAssignments[pSlotId] == 0)
115 pConditionalProbabilities[pSlotId]->setProbability(
mParentObject, 1.0);
118 child->calculateProbabilityForHypothesis(pEvidenceList, pAssignments, pSlotId,
true, pConditionalProbabilities);
125 mAbsolutePose.reset(
new ISM::Pose(*pEvidenceList[pAssignments[pSlotId] - 1].pose));
132 double score = scorePos * scoreOri;
134 pConditionalProbabilities[pSlotId]->setProbability(
mParentObject, score);
154 result *= child->calculateProbabilityForHypothesis(pEvidenceList, pAssignments, pSlotId,
false, pConditionalProbabilities);
169 for(
unsigned int i = 0; i < pEvidenceList.size(); i++)
172 ISM::Object
object = pEvidenceList[i];
198 for(
unsigned int i = 0; i <
mChildren.size(); i++)
204 for(
unsigned int i = 0; i <
mChildren.size(); i++)
212 unsigned int result = 1;
217 result += child->getNumberOfNodes();
235 if (
mSceneObject != pReferencedNode->getSceneObjectType())
236 throw std::runtime_error(
"Node with type " +
mSceneObject +
" is trying to reference a node of different type " + pReferencedNode->getSceneObjectType());
std::string mParentObject
boost::shared_ptr< HierarchicalShapeModelNode > mReferencedNode
void visualize(std::vector< ISM::Object > pEvidenceList)
std::vector< boost::shared_ptr< HierarchicalShapeModelNode > > getChildren()
boost::shared_ptr< ISM::Pose > mAbsolutePose
boost::shared_ptr< GaussianMixtureDistribution > mGaussianMixtureDistributionPosition
boost::shared_ptr< Visualization::ProbabilisticSecondarySceneObjectVisualization > mVisualizer
HierarchicalShapeModelNode(boost::property_tree::ptree &pPt, unsigned int &pID)
unsigned int mReferenceTo
double calculateProbabilityForHypothesis(std::vector< ISM::Object > pEvidenceList, std::vector< unsigned int > pAssignments, unsigned int &pSlotId, bool pCut, std::vector< boost::shared_ptr< ConditionalProbability >> &pConditionalProbabilities)
void initializeVisualizer(boost::shared_ptr< Visualization::ProbabilisticPrimarySceneObjectVisualization > mSuperior)
boost::shared_ptr< GaussianMixtureDistribution > mGaussianMixtureDistributionOrientation
void setAbsoluteParentPose(boost::shared_ptr< ISM::Pose > pPose)
~HierarchicalShapeModelNode()
unsigned int getNumberOfNodes()
std::vector< boost::shared_ptr< HierarchicalShapeModelNode > > mChildren
#define ROS_INFO_STREAM(args)
void load(boost::property_tree::ptree &pPt, unsigned int &pID)
void setReferencedNode(boost::shared_ptr< HierarchicalShapeModelNode > pReferencedNode)
bool isReference(unsigned int &pReferenceTo)
boost::shared_ptr< ISM::Pose > mRelativePose
boost::shared_ptr< ISM::Pose > mAbsoluteParentPose