BackgroundSceneLearner.cpp
Go to the documentation of this file.
1 
19 
21 
23  : SceneLearner()
24  {
25 
26  }
27 
29  {
30  }
31 
33  {
34  // No need for visualization here.
35  }
36 
37  void BackgroundSceneLearner::save(boost::property_tree::ptree& pPt)
38  {
39  // Create mSceneName = pExample->mIdentifier;a subtree.
40  boost::property_tree::ptree subtree;
41 
42  // Add scene name and type.
43  subtree.add("<xmlattr>.type", "background");
44  subtree.add("<xmlattr>.name", "background");
45  subtree.add("<xmlattr>.priori", mPriori);
46 
47  // Add parameters relevant for the background scene.
48  subtree.add("description.<xmlattr>.objects", mMaximalNumberOfObjects);
49  subtree.add("description.<xmlattr>.volume", mWorkspaceVolume);
50 
51  // Add subtree to main tree.
52  pPt.add_child("psm.scenes.scene", subtree);
53  }
54 
56  {
57  // This is the list we store all object types. The size of the list will be the number of all unique objects.
58  std::vector<std::string> index;
59 
60  ISM::TracksPtr alltracks(new ISM::Tracks(mExamplesList));
61  // Iterate over all examples for all scenes.
62 
63  for (auto &track : alltracks->tracks){
64  // Iterate over all PbdNodes in the scene (a node represent an object).
65  //BOOST_FOREACH(pbd_msgs::PbdNode node, example->scene_elements)
66  //{
67  // Extract the object type from the first observation.
68  std::string type = track->type;
69 
70  // If the object is not already known, add it to the list of known objects.
71  if(std::find(index.begin(), index.end(), type) == index.end())
72  index.push_back(type);
73  }
74  // }
75 
76  // This is the number of unique objects.
77  mMaximalNumberOfObjects = index.size();
78  }
79 
80 }
bool find(const std::vector< double > &in, double toFind)
Definition: validator.cpp:128
std::vector< ISM::ObjectSetPtr > mExamplesList
Definition: SceneLearner.h:130
void initializeVisualizer(boost::shared_ptr< Visualization::ProbabilisticSceneModelVisualization > mSuperior)


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