3 #include <pcl/visualization/histogram_visualizer.h>
10 namespace visualization
29 initValuesAndVisualization();
38 nb_values_ = nb_values;
42 PCL_WARN(
"Maximum number of values can only be 308 (%d given). Setting back to 308. \n");
48 PCL_WARN(
"Number of values must be at least 2 (%d given). Setting it to default (308). \n");
53 initValuesAndVisualization();
63 updateValuesToDisplay();
66 if(control_background_color_)
68 if(values_.back() < lowest_threshold_)
70 histo_->setBackgroundColor(255.0, 140.0, 0.0);
74 histo_->setBackgroundColor(255.0, 255.0, 255.0);
79 histo_->updateFeatureHistogram(cloud_, nb_values_);
84 histo_->setGlobalYRange(min_, max_);
101 values_.push_back(val);
117 histo_->spinOnce(time);
136 control_background_color_ = value;
140 histo_->setBackgroundColor(255.0, 255.0, 255.0);
142 lowest_threshold_ = threshold;
153 handle_y_scale_ = value;
161 initValuesAndVisualization ()
165 PCL_WARN(
"Setting buffer size to %d entries.\n", nb_values_);
166 values_.resize(nb_values_);
169 histo_->addFeatureHistogram(cloud_, nb_values_);
177 updateValuesToDisplay ()
179 for(
int i = 0 ; i < nb_values_ ; ++i)
181 cloud_[0].histogram[i] = values_[i];
189 control_background_color_ =
false;
190 lowest_threshold_ = 0.0f;
192 handle_y_scale_ =
false;
199 PCLHistogramVisualizer *histo_;
205 std::deque<float> values_;
213 bool control_background_color_;
216 float lowest_threshold_;
219 bool handle_y_scale_;