CombinatorialGraphGenerator.cpp
Go to the documentation of this file.
1 
19 #include <ros/ros.h>
20 
22 
24  std::vector<std::string> pObjectTypes):
25  SceneModel::AbstractGraphGenerator(), mLearners(pLearners), mObjectTypes(pObjectTypes)
26  {}
27 
29 
30 void CombinatorialGraphGenerator::buildTree(SceneModel::ObjectSetList pObjectSets, boost::shared_ptr<SceneModel::TreeNode>& pRoot)
31 {
32  buildTree(pObjectSets, pRoot, mObjectTypes[0]); // Builds tree with first object found as node.
33 }
34 
35 void CombinatorialGraphGenerator::buildTree(SceneModel::ObjectSetList pTrajectories, boost::shared_ptr<SceneModel::TreeNode>& pRoot, std::string pType)
36 {
38  combinatorialOptimizer(new CombinatorialOptimizer(mLearners, mObjectTypes, pTrajectories.mObjectSets));
39  // set the optimized topology as the one to be transformed into the tree to be used for the final result
40  boost::shared_ptr<SceneModel::Topology> optimizedTopology = combinatorialOptimizer->runOptimization();
41 
42  if (!optimizedTopology)
43  throw std::runtime_error("no valid topology was found.");
44 
45  boost::shared_ptr<SceneModel::TreeNode> optimizedTree = optimizedTopology->getTree();
46 
47  // Rearrange for given node type, set the tree:
48  pRoot = optimizedTree->setNewRootNodeByType(pType);
49 }
50 
51 }
void buildTree(SceneModel::ObjectSetList pObjectSets, boost::shared_ptr< SceneModel::TreeNode > &pRoot)
CombinatorialGraphGenerator(std::vector< boost::shared_ptr< SceneObjectLearner >> pLearners, std::vector< std::string > pObjectTypes)
std::vector< boost::shared_ptr< SceneObjectLearner > > mLearners


asr_psm
Author(s): Braun Kai, Gehrung Joachim, Heizmann Heinrich, Meißner Pascal
autogenerated on Fri Nov 15 2019 03:57:54