50 boost::property_tree::ptree subtree;
53 subtree.add(
"<xmlattr>.type",
"ocm");
55 subtree.add(
"<xmlattr>.priori",
mPriori);
59 learner->save(subtree);
62 pPt.add_child(
"psm.scenes.scene", subtree);
72 std::vector<std::string> types;
77 for (
auto &track : alltracks->tracks){
79 std::string type = track->type;
82 bool isExisting =
false;
84 isExisting |= learner->hasType(type);
89 types.push_back(type);
98 std::string trainerType;
100 if(!nodeHandle.
getParam(
"relation_tree_trainer_type", trainerType))
102 ROS_INFO_STREAM(
"Could not find ROS parameter relation_tree_trainer_type. Using standard method of hierarchical clustering (value=\"tree\").");
103 trainerType =
"tree";
107 SceneModel::AbstractTrainer trainer;
108 if (trainerType ==
"tree")
112 trainer = psmtrainer;
114 else if (trainerType ==
"fullymeshed")
116 SceneModel::FullyMeshedTrainer fmtrainer;
120 else if (trainerType ==
"combinatorial_optimization")
127 learner->setPriori(1.0);
132 trainer = combinatorialTrainer;
134 else throw std::runtime_error(
"Trainer type " + trainerType +
" is invalid. Valid types are tree, fullymeshed, combinatorial_optimization.");
137 trainer.loadTrajectoriesAndBuildTree();
140 ROS_INFO(
"PSM trainer successfully generated tree.");
141 std::cout <<
"------------- TREE:" << std::endl;
142 trainer.getTree()->printTreeToConsole(0);
143 std::cout <<
"---------------------" << std::endl;
157 learner->setPriori(1.0);
~OcmForegroundSceneLearner()
void save(boost::property_tree::ptree &pPt)
void initializeVisualizer(boost::shared_ptr< Visualization::ProbabilisticSceneModelVisualization > mSuperior)
void addSceneGraphMessages(std::vector< ISM::ObjectSetPtr > pMessages)
OcmForegroundSceneLearner(const ISM::ObjectSetPtr pExample)
std::vector< ISM::ObjectSetPtr > mExamplesList
#define ROS_INFO_STREAM(args)
bool getParam(const std::string &key, std::string &s) const
boost::shared_ptr< Visualization::ProbabilisticSceneVisualization > mVisualizer
std::vector< boost::shared_ptr< SceneObjectLearner > > mSceneObjectLearners
double mMaxAngleDeviation