ProbabilisticSceneVisualization.cpp
Go to the documentation of this file.
1 
19 
20 namespace Visualization {
21 
23  : mScene(pScene)
24  {
25  }
26 
28  {
29  }
30 
32  {
33  mSceneObjectVisualizers.push_back(pVisualizer);
34  }
35 
36  void ProbabilisticSceneVisualization::setDrawingParameters(const double pScale, const float pSigmaMultiplicator, const std::string pFrameId)
37  {
39  visualizer->setDrawingParameters(pScale, pSigmaMultiplicator, pFrameId);
40  }
41 
43  {
44  // Stop, if no primary scene object visualizers registered.
45  if(mSceneObjectVisualizers.size() == 0)
46  return;
47 
48  // The size of a step in the hsv color space.
49  double hsvColorSteps = 1.0 / mSceneObjectVisualizers.size();
50 
51  // Iterate over all scene objects and create a color for each one.
52  // But draw only the scene object with the given name.
53  for(unsigned int i = 0; i < mSceneObjectVisualizers.size(); i++)
54  {
55  // Create an unique color...
56  std_msgs::ColorRGBA color;
57  color.a = 1.0;
58 
59  // ... by converting an index based postion on the hue axis into RGB
60  ColorHelper::convertHSVToRGB(color, (double) hsvColorSteps * i, 1.0, 1.0);
61 
62  // Draw the scene.
63  mSceneObjectVisualizers[i]->drawInTargetingMode(mScene, color);
64  }
65  }
66 
68  {
69  // Stop, if no primary scene object visualizers registered.
70  if(mSceneObjectVisualizers.size() == 0)
71  return;
72 
73  // The size of a step in the hsv color space.
74  double hsvColorSteps = 1.0 / mSceneObjectVisualizers.size();
75 
76  // Serves as unique id for the marker. Any marker sent with the same id will overwrite the old one.
77  unsigned int markerId = 0;
78 
79  // Iterate over all scene objects and create a color for each one.
80  // But draw only the scene object with the given name.
81  for(unsigned int i = 0; i < mSceneObjectVisualizers.size(); i++)
82  {
83  // Create an unique color...
84  std_msgs::ColorRGBA color;
85  color.a = 1.0;
86 
87  // ... by converting an index based postion on the hue axis into RGB
88  ColorHelper::convertHSVToRGB(color, (double) hsvColorSteps * i, 1.0, 1.0);
89 
90  // Draw the scene.
91  mSceneObjectVisualizers[i]->drawInInferenceMode(mScene, color, markerId);
92  }
93  }
94 
96  {
97  // Stop, if no primary scene object visualizers registered.
98  if(mSceneObjectVisualizers.size() == 0)
99  return;
100 
101  // The size of a step in the hsv color space.
102  double hsvColorSteps = 1.0 / mSceneObjectVisualizers.size();
103 
104  // Iterate over all scene objects and create a color for each one.
105  // But draw only the scene object with the given name.
106  for(unsigned int i = 0; i < mSceneObjectVisualizers.size(); i++)
107  {
108  // Create an unique color...
109  std_msgs::ColorRGBA color;
110  color.a = 1.0;
111 
112  // ... by converting an index based postion on the hue axis into RGB
113  ColorHelper::convertHSVToRGB(color, (double) hsvColorSteps * i, 1.0, 1.0);
114 
115  // Draw the scene.
116  mSceneObjectVisualizers[i]->drawInLearningMode(mScene, color);
117  }
118  }
119 
121  {
122  for(unsigned int i = 0; i < mSceneObjectVisualizers.size(); i++)
124  }
125 
126 }
void setDrawingParameters(const double pScale, const float pSigmaMultiplicator, const std::string pFrameId)
std::vector< boost::shared_ptr< ProbabilisticPrimarySceneObjectVisualization > > mSceneObjectVisualizers
void appendVisualizer(boost::shared_ptr< ProbabilisticPrimarySceneObjectVisualization > pVisualizer)
static void convertHSVToRGB(std_msgs::ColorRGBA &pColor, double pH, double pS, double pV)
Definition: ColorHelper.cpp:30


asr_psm_visualizations
Author(s): Gehrung Joachim, Meißner Pascal
autogenerated on Sat Nov 9 2019 03:49:13