recognizer.cpp
Go to the documentation of this file.
1 
18 //Global includes
19 #include <iostream>
20 #include <fstream>
21 #include <string>
22 #include <vector>
23 
24 //Pkg includes
25 #include <ros/ros.h>
26 #include <dynamic_reconfigure/server.h>
27 #include <visualization_msgs/MarkerArray.h>
28 
29 #include <asr_msgs/AsrObject.h>
30 
31 #include <asr_ism_visualizations/ism_result_visualizer_rviz.hpp>
32 #include <asr_ism_visualizations/ism_voting_visualizer_rviz.hpp>
33 #include <asr_ism_visualizations/ism_pose_prediction_visualizer_rviz.hpp>
34 #include <asr_ism_visualizations/ObjectModelVisualizerRVIZ.hpp>
35 #include <asr_ism_visualizations/VizHelperRVIZ.hpp>
36 
37 #include <pose_prediction_ism/pose_predictor.h>
38 #include <pose_prediction_ism/shortest_path.h>
39 
40 //ISM includes
41 #include <ISM/recognizer/Recognizer.hpp>
42 #include <ISM/utility/TableHelper.hpp>
43 #include <ISM/utility/Util.hpp>
44 #include <ISM/common_type/Pose.hpp>
45 #include <ISM/typedef.hpp>
46 
47 #include "ISM/rating/BaseRater.hpp"
48 #include "ISM/rating/SimpleRater.hpp"
49 #include "ISM/rating/APORater.hpp"
50 #define SIMPLE_RATER 0
51 #define APO_RATER 1
52 
53 //Local includes
54 #include <asr_ism/recognizerConfig.h>
56 
57 
58 /**********************/
59 /*** Keyboard input ***/
60 #define KEYCODE_BUFFERVOTES 0x23//#
61 #define KEYCODE_VISUALIZE 0x76 //v
62 
63 #define KEYCODE_BUFFERSCENE 0x2B //+
64 #define KEYCODE_PREDICTSCENE 0x70 //p
65 #define KEYCODE_NEXTREF 0x79 //y
66 #define KEYCODE_PREVREF 0x3C //<
67 #define KEYCODE_NEXTOBJECT 0x63 //c
68 #define KEYCODE_PREVOBJECT 0x78 //x
69 #define KEYCODE_NEXTPOSE 0x6E //n
70 #define KEYCODE_PREVPOSE 0x62 //b
71 
72 #define KEYCODE_HELP 0x68 //h
73 
74 #define KEYCODE_NEXT_RESULT 0x71 //q
75 #define KEYCODE_PREV_RESULT 0x77 //w
76 #define KEYCODE_VIZ_SELECTED_RESULT 0x65 //e
77 #define KEYCODE_VIZ_ALL_RESULTS 0x72 //r
78 /**********************/
79 
86 class Recognizer
87 {
88  public:
89 
90 
94  Recognizer() : nh_("~")
95  {
96 
97  std::string visualization_topic;
98  //Extract cli parameters of ros node for being used in this program.
99  getNodeParameters(visualization_topic);
100 
101  ISM::TableHelperPtr table_helper;
102  if (db_filename_ != "")
103  {
104  table_helper = ISM::TableHelperPtr(new ISM::TableHelper(db_filename_));
105  if(!table_helper->modelDataExists())
106  {
107  ISM::printRed("The database \"" + db_filename_ + "\" doesn't contain a model!\n");
108  exit(0);
109  }
110 
111  ism_recognizer_ = ISM::RecognizerPtr(new ISM::Recognizer(db_filename_, bin_size_, max_projection_angle_deviation_, false, rater_type_));
112  }
113  else
114  {
115  throw std::runtime_error("No db specified");
116  }
117 
118 
119  object_set_buffer_ = ISM::ObjectSetPtr(new ISM::ObjectSet());
120 
121  // init viz
122  visualization_publisher_ = nh_.advertise<visualization_msgs::MarkerArray>(visualization_topic, 100);
123  recogition_result_visualizer_ = VIZ::ISMResultVisualizerRVIZPtr(new VIZ::ISMResultVisualizerRVIZ(visualization_publisher_, ros::NodeHandle(nh_.getNamespace() + "/result_visualizer/")));
124  voting_space_visualizer_ = VIZ::ISMVotingVisualizerRVIZPtr(new VIZ::ISMVotingVisualizerRVIZ(visualization_publisher_, bin_size_, ros::NodeHandle(nh_.getNamespace() + "/voting_visualizer/")));
125  object_model_visualizer_ = new VIZ::ObjectModelVisualizerRVIZ(visualization_publisher_, base_frame_, "", 0);
126 
127  // init pose prediction stuff
128  object_type_to_ressource_path_map_ = table_helper->getRessourcePaths();
129 
130  pose_predictor_ = new pose_prediction_ism::ShortestPath(db_filename_);
131  ism_pose_prediction_visualizer_ = VIZ::ISMPosePredictionVisualizerRVIZPtr(new VIZ::ISMPosePredictionVisualizerRVIZ(visualization_publisher_, bin_size_, max_projection_angle_deviation_, object_type_to_ressource_path_map_,
132  ros::NodeHandle(nh_.getNamespace() + "/pose_prediction_visualizer/"), ros::NodeHandle(nh_.getNamespace() + "/valid_position_visualizer/")));
133 
134  // set-up dynamic reconfigure
135  dynamic_reconfigure::Server<asr_ism::recognizerConfig>::CallbackType reconf_callback = boost::bind(&Recognizer::dynamicReconfCallback, this, _1, _2);
136  dyn_reconf_server_.setCallback(reconf_callback);
137 
138  // init scene configurator
140  boost::bind(&Recognizer::processKeyboardInput, this, _1),
141  boost::bind(&Recognizer::processObjectInput, this, _1));
142 
144  }
145 
147  {
148  delete scene_configurator_;
149  }
150 
151 
157  void recognizeScene(ISM::ObjectSetPtr object_set)
158  {
159  ISM::printYellow("Recognize scene for object set:\n");
160  storeObjectsToXML(object_set);
161 
163  {
164  object_set_buffer_->objects.clear();
165  object_set_buffer_->objects.insert(object_set_buffer_->objects.begin(), object_set->objects.begin(), object_set->objects.end());
166  buffer_next_scene_ = false;
167  }
168 
169 
170 
171  ROS_INFO_STREAM("-----------------------------------------------------------");
172  ROS_INFO_STREAM("Calculating scene recognition results. Please wait.");
173 
174  struct timeval start, end;
175  //Reset start
176  gettimeofday(&start, NULL);
177 
178  //Here actual scene recognition takes place.
179  std::vector<ISM::RecognitionResultPtr> all_results = ism_recognizer_->recognizePattern(object_set, 0, max_number_of_results_per_pattern_);
180 
181  gettimeofday(&end, NULL);
182 
183  long recTime, seconds, useconds;
184  seconds = end.tv_sec - start.tv_sec;
185  useconds = end.tv_usec - start.tv_usec;
186  recTime = ((seconds) * 1000 + useconds / 1000.0) + 0.5;
187  ROS_INFO_STREAM("elapsed time: " << recTime << "ms");
188 
189  results_buffer_ = all_results;
190  ROS_INFO_STREAM("results: (" << results_buffer_.size() << ")");
191 
192  for (unsigned int idx = 0; idx < results_buffer_.size(); idx++)
193  {
194  ROS_INFO_STREAM("********************************************");
195  ROS_INFO_STREAM("Result Index: " << idx);
196  ROS_INFO_STREAM("Number of Combinations: " << results_buffer_[idx]->getNumberOfCombinations());
198  ISM::printBlue("********** Vote and Score Details ************\n");
200  ISM::printBlue("**********************************************\n\n");
201  }
202 
204 
206  ROS_INFO_STREAM("-----------------------------------------------------------");
207  }
208 
209 
215  void processKeyboardInput(int key)
216  {
217  switch(key)
218  {
219  case KEYCODE_HELP:
221  break;
222  case KEYCODE_BUFFERVOTES:
223  ISM::printBlue("\tBUFFER VOTES\n");
224  ism_recognizer_->setVotingSpaceToBeBuffered(voting_space_visualizer_->getPatternName());
225  break;
226  case KEYCODE_VISUALIZE:
227  ISM::printBlue("\tDRAW VOTES\n");
228  clearAllMarker();
229  voting_space_visualizer_->addVisualization(ism_recognizer_->getBufferedVotingSpace(), results_buffer_);
230  break;
231  case KEYCODE_BUFFERSCENE:
232  ISM::printBlue("\tBUFFER SCENE\n");
233  buffer_next_scene_ = true;
234  break;
236  predictScene();
237  break;
238  case KEYCODE_NEXTREF:
239  ISM::printBlue("\tNEXT REFERENCE\n");
240  if(results_buffer_.size() > 0)
242  break;
243  case KEYCODE_PREVREF:
244  ISM::printBlue("\tPREVIOUS REFERENCE\n");
245  if(results_buffer_.size() > 0)
247  break;
248  case KEYCODE_NEXTOBJECT:
249  ISM::printBlue("\tNEXT OBJECT\n");
250  ism_pose_prediction_visualizer_->nextObject();
251  break;
252  case KEYCODE_PREVOBJECT:
253  ISM::printBlue("\tPREVIOUS OBJECT\n");
254  ism_pose_prediction_visualizer_->prevObject();
255  break;
256  case KEYCODE_NEXTPOSE:
257  ISM::printBlue("\tNEXT POSE\n");
259  break;
260  case KEYCODE_PREVPOSE:
261  ISM::printBlue("\tPREVIOUS POSE\n");
263  break;
264  case KEYCODE_NEXT_RESULT:
265  if(results_buffer_.size() > 0)
266  {
267  ISM::printBlue("\tRESULT: ");
269  std::cout << selected_result_index_ << std::endl;
271  }
272  break;
273  case KEYCODE_PREV_RESULT:
274  if(results_buffer_.size() > 0)
275  {
276  ISM::printBlue("\tRESULT: ");
278  std::cout << selected_result_index_ << std::endl;
280  }
281  break;
283  if(results_buffer_.size() > 0)
284  {
285  ISM::printBlue("\tVISUALIZE RESULT: ");
286  std::cout << selected_result_index_ << std::endl;
288  }
289  break;
291  if(results_buffer_.size() > 0)
292  {
293  ISM::printBlue("\tVISUALIZE ALL RESULTS\n");
295  }
296  break;
297  }
298 
299  return;
300  }
301 
307  void processObjectInput(ISM::ObjectPtr object)
308  {
309  ism_pose_prediction_visualizer_->calculateDistColor(object);
310  return;
311  }
312 
313  private:
314 
316  dynamic_reconfigure::Server<asr_ism::recognizerConfig> dyn_reconf_server_;
318 
319  //Core functionality
320  ISM::RecognizerPtr ism_recognizer_;
321  double bin_size_;
323  std::string db_filename_;
326 
327  // store to XML functionality
330  unsigned int configuration_file_counter_ = 1;
331 
332  //Visualization stuff
334  std::string base_frame_;
336 
337  VIZ::ISMResultVisualizerRVIZPtr recogition_result_visualizer_;
338  VIZ::ISMVotingVisualizerRVIZPtr voting_space_visualizer_;
339  VIZ::ISMPosePredictionVisualizerRVIZPtr ism_pose_prediction_visualizer_;
340  VIZ::ObjectModelVisualizerRVIZ* object_model_visualizer_;
341 
342  //Buffers last results for ism visualization
343  std::vector<ISM::RecognitionResultPtr> results_buffer_;
344 
345  //Buffers last objectset for pose prediction visualization
346  ISM::ObjectSetPtr object_set_buffer_;
347  bool buffer_next_scene_ = false;
348 
349  //PosePrediction stuff
350  pose_prediction_ism::PosePredictor* pose_predictor_;
351  std::map<std::string, boost::filesystem::path> object_type_to_ressource_path_map_;
352  int scene_counter_ = 0;
353  bool valid_position_vis_ = false;
355  size_t number_of_objects_ = 0;
356 
357 
361  void storeObjectsToXML(ISM::ObjectSetPtr object_set)
362  {
363  //Don`t store the configuration while in active recognition or while storing disabled.
364  if (scene_configurator_->getAutomaticProcessingActive() || !enable_storing_config_to_xml_)
365  return;
366 
367  //Don`t do anything if no path was provided that specifies where the configuration should be stored.
368  if (configuration_folder_path_.empty())
369  return;
370 
371 
372  if (object_set->objects.size() > 0)
373  {
374  std::ofstream myfile;
375  std::string filePath = configuration_folder_path_ + "/" + "configuration_" + std::to_string(configuration_file_counter_++) + ".xml";
376  myfile.open(filePath);
377  myfile << "<Objects>";
378 
379  for (ISM::ObjectPtr object : object_set->objects)
380  {
381  ISM::PosePtr pose = object->pose;
382  myfile << "<Object "
383  << "type=\"" << object->type
384  << "\" id=\"" << object->observedId
385  << "\" mesh=\"" << object->ressourcePath.string()
386  << "\" angles=\"quaternion\">"
387  << pose->point->eigen.x()
388  << "," << pose->point->eigen.y()
389  << "," << pose->point->eigen.z()
390  << "," << pose->quat->eigen.w()
391  << "," << pose->quat->eigen.x()
392  << "," << pose->quat->eigen.y()
393  << "," << pose->quat->eigen.z()
394  << " </Object>";
395  }
396 
397  myfile << "</Objects>";
398  myfile.close();
399  }
400  }
401 
402 
406  void printAdditionalResultInformation(ISM::RecognitionResultPtr& result)
407  {
408  ISM::RaterPtr rater;
409  switch (rater_type_)
410  {
411  case APO_RATER:
412  rater = ISM::RaterPtr(new ISM::APORater(bin_size_, max_projection_angle_deviation_));
413  break;
414  case SIMPLE_RATER:
415  rater = ISM::RaterPtr(new ISM::SimpleRater(bin_size_, max_projection_angle_deviation_));
416  break;
417  }
418 
419  std::stringstream sceneInfo;
420  sceneInfo << "SCENE: " << result->patternName << " score: " << result->confidence << " # of combinations: " << result->getNumberOfCombinations()<< "\n";
421  ISM::printGreen(sceneInfo.str());
422 
423  double weight = 0.0;
424  for(ISM::ObjectPtr o : result->recognizedSet->objects)
425  {
426  weight += o->weight;
427  }
428  std::cout << "weight=" << weight << " expectedWeight=" << result->summarizedVotes.front().first->weightDenominator << "\n";
429 
430  ISM::printYellow("\n####### VOTE INFORMATIONS #######\n");
431  for (ISM::SummarizedVotedPosePtr& summarizedVote : result->summarizedVotes)
432  {
433  std::stringstream voteInfo;
434  voteInfo << summarizedVote.first->source->type << " " << summarizedVote.first->source->observedId << " # of summarized votes: " << summarizedVote.second.first << "\n";
435  ISM::printGreen(voteInfo.str());
436  rater->printRatingAtBackProjectionLevel(summarizedVote.first, result->referencePose, nullptr);
437  }
438  ISM::printYellow("#################################\n");
439 
440  if (result->subPatterns.empty())
441  {
442  return;
443  }
444 
445  ISM::printYellow("\n##### SUBSCENE INFORMATIONS #####\n");
446  for (ISM::RecognitionResultPtr sub : result->subPatterns)
447  {
448  ISM::printBlue(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
449  ISM::printYellow("SUB");
451  ISM::printBlue("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
452  }
453  ISM::printYellow("#################################\n");
454 
455  return;
456  }
457 
458 
464  std::vector<ISM::ObjectPtr> extractRealObjects(const ISM::RecognitionResultPtr result)
465  {
466  std::vector<ISM::ObjectPtr> ret_objects;
467 
468  for(ISM::ObjectPtr obj : result->recognizedSet->objects )
469  {
470  if( obj->type.find( result->patternName ) == std::string::npos )
471  {
472  ret_objects.push_back(obj);
473  }
474  }
475 
476  // extract objects from sub-isms
477  std::vector<ISM::ObjectPtr> temp_objects;
478  for (const ISM::RecognitionResultPtr sub_result : result->subPatterns )
479  {
480  temp_objects = extractRealObjects(sub_result);
481  ret_objects.insert(ret_objects.end(), temp_objects.begin(), temp_objects.end());
482  }
483 
484  return ret_objects;
485  }
486 
487 
492  {
493  std::stringstream commands;
494 
495  commands << "Additional recognizer commands:\n"
496  << "\tpress \"#\"\t-buffer next recognition for visualization\n"
497  << "\tpress \"v\"\t-show visualization of votingspace\n"
498  << "\n"
499  << "\tpress \"+\"\t-buffer next scene for pose prediction\n"
500  << "\tpress \"p\"\t-show visualization of pose prediction\n"
501  << "\tpress \"<\"\t-choose previous reference for pose prediction\n"
502  << "\tpress \"y\"\t-choose next reference for pose prediction\n"
503  << "\tpress \"x\"\t-choose previous object for pose prediction\n"
504  << "\tpress \"c\"\t-choose next object for pose prediction\n"
505  << "\tpress \"b\"\t-choose previous object pose for pose prediction\n"
506  << "\tpress \"n\"\t-choose next object pose for pose prediction\n"
507  << "\n"
508  << "\tpress \"q\"\t-select previous result from all results and visualize it\n"
509  << "\tpress \"w\"\t-select next result from all results and visualize it\n"
510  << "\tpress \"e\"\t-visualize selected result\n"
511  << "\tpress \"r\"\t-visualize all results\n";
512 
513 
514  ISM::printYellow(commands.str() + "\n");
515 
516  return;
517  }
518 
519 
524  {
525  clearAllMarker();
526  recogition_result_visualizer_->setSceneCount(results_buffer_.size()); //TODO: should namespace really be incremented in viz-code?
527  object_model_visualizer_->drawObjectModels(extractRealObjects(results_buffer_[selected_result_index_]));
528  recogition_result_visualizer_->addVisualization(results_buffer_[selected_result_index_]);
529  }
530 
531 
536  {
537  clearAllMarker();
538  recogition_result_visualizer_->setSceneCount(results_buffer_.size());
539 
540  for (const ISM::RecognitionResultPtr result : results_buffer_)
541  {
542  object_model_visualizer_->drawObjectModels(extractRealObjects(result));
543  recogition_result_visualizer_->addVisualization(result);
544  }
545  }
546 
547 
554  {
555  ism_pose_prediction_visualizer_->clearAllMarkerOfTopic();
556  voting_space_visualizer_->clearAllMarkerOfTopic();
557  recogition_result_visualizer_->clearAllMarkerOfTopic();
558  }
559 
560 
562  {
563  ISM::printBlue("\tPREDICT SCENE\n");
564  clearAllMarker();
565  if(valid_position_vis_)
566  {
567  pose_predictor_->enableRandom(std::sqrt(1.0 / 3.0) * bin_size_ * 0.5, max_projection_angle_deviation_);
568  }
569  if(object_set_buffer_->objects.size() == 0)
570  {
571  ROS_ERROR("No Objects in scenebuffer, skipping prediction visualization.");
572  return;
573  }
574 
575  ISM::TableHelperPtr table_helper = ISM::TableHelperPtr(new ISM::TableHelper(db_filename_));
576  std::set<std::string> all_objects_in_pattern = table_helper->getObjectsInPattern(results_buffer_[scene_counter_]->patternName);
577 
578  pose_prediction_ism::FoundObjects fos;
579  for(std::size_t i = 0; i < object_set_buffer_->objects.size(); i++)
580  {
581  asr_msgs::AsrObject asr_o;
582  asr_o.type = object_set_buffer_->objects[i]->type;
583  asr_o.identifier = object_set_buffer_->objects[i]->observedId;
584  all_objects_in_pattern.erase(object_set_buffer_->objects[i]->type + object_set_buffer_->objects[i]->observedId);
585  fos.push_back(asr_o);
586  }
587 
588  ROS_INFO_STREAM(results_buffer_[scene_counter_]->patternName);
589  if(all_objects_in_pattern.size() == 0)
590  {
591  ROS_INFO("Scene complete, nothing to predict.");
592  return;
593  }
594  pose_predictor_->setFoundObjects(fos);
595  ISM::PosePtr referencePosePtr = results_buffer_[scene_counter_]->referencePose;
596  pose_predictor_->predictUnfoundPoses(referencePosePtr, results_buffer_[scene_counter_]->patternName, pose_prediction_sampel_faktor_);
597  pose_prediction_ism::AttributedPointCloud current_point_cloud = pose_predictor_->getAttributedPointCloud();
598  ism_pose_prediction_visualizer_->addVisualization(results_buffer_[scene_counter_], current_point_cloud, valid_position_vis_);
599  if(valid_position_vis_)
600  {
601  pose_predictor_->disableRandom();
602  }
603 
604  return;
605  }
606 
607 
608  void dynamicReconfCallback(asr_ism::recognizerConfig &config, uint32_t level)
609  {
610  ROS_DEBUG_STREAM("Parameters updated.");
611 
612  voting_space_visualizer_->releaseCallback();
613  ism_pose_prediction_visualizer_->releaseCallback();
614 
615  voting_space_visualizer_ = VIZ::ISMVotingVisualizerRVIZPtr(new VIZ::ISMVotingVisualizerRVIZ(visualization_publisher_, bin_size_, ros::NodeHandle(nh_.getNamespace() + "/voting_visualizer/")));
616  ism_pose_prediction_visualizer_ = VIZ::ISMPosePredictionVisualizerRVIZPtr(new VIZ::ISMPosePredictionVisualizerRVIZ(visualization_publisher_, bin_size_, max_projection_angle_deviation_, object_type_to_ressource_path_map_,
617  ros::NodeHandle(nh_.getNamespace() + "/pose_prediction_visualizer/"), ros::NodeHandle(nh_.getNamespace() + "/valid_position_visualizer/")));
618 
619  object_model_visualizer_ = new VIZ::ObjectModelVisualizerRVIZ(visualization_publisher_, base_frame_, "", config.capture_interval);
620 
621  pose_prediction_sampel_faktor_ = config.posePredictionSampelFaktor;
622  valid_position_vis_ = config.validPositionVis;
623  }
624 
625 
631  void getNodeParameters(std::string& visualization_topic)
632  {
633  if (!nh_.getParam("dbfilename", db_filename_))
634  {
635  db_filename_ = "";
636  }
637  ROS_INFO_STREAM("dbfilename: " << db_filename_);
638 
639  if (!nh_.getParam("baseFrame", base_frame_))
640  {
641  base_frame_ = "/map";
642  }
643  ROS_INFO_STREAM("baseFrame: " << base_frame_);
644 
645  if (!nh_.getParam("bin_size", bin_size_))
646  {
647  bin_size_ = 0.1;
648  }
649  ROS_INFO_STREAM("bin_size: " << bin_size_);
650 
651  if (!nh_.getParam("maxProjectionAngleDeviation", max_projection_angle_deviation_))
652  {
653  max_projection_angle_deviation_ = 30;
654  }
655  ROS_INFO_STREAM("maxProjectionAngleDeviation: " << max_projection_angle_deviation_);
656 
657  if (!nh_.getParam("maxNumberOfResultsPerPattern", max_number_of_results_per_pattern_))
658  {
659  max_number_of_results_per_pattern_ = 1;
660  }
661  ROS_INFO_STREAM("maxNumberOfResultsPerPattern: " << max_number_of_results_per_pattern_);
662 
663  if (!nh_.getParam("raterType", rater_type_))
664  {
665  rater_type_ = 0;
666  }
667  ROS_INFO_STREAM("raterType: " << rater_type_);
668 
669  if (!nh_.getParam("enableStoringConfigToXml", enable_storing_config_to_xml_))
670  {
671  enable_storing_config_to_xml_ = false;
672  }
673  ROS_INFO_STREAM("enableStoringConfigToXml: " << enable_storing_config_to_xml_);
674 
675  if (!nh_.getParam("configurationFolderPath", configuration_folder_path_))
676  {
677  configuration_folder_path_ = "";
678  }
679  ROS_INFO_STREAM("configurationFolderPath: " << configuration_folder_path_);
680 
681  if (!nh_.getParam("visualization_topic", visualization_topic))
682  {
683  visualization_topic = "";
684  }
685  ROS_INFO_STREAM("visualization_topic: " << visualization_topic);
686  }
687 };
688 
689 
690 
691 int main(int argc, char **argv)
692 {
693  //Usual ros node stuff
694  ros::init(argc, argv, "recognizer");
695  Recognizer* recognizer = new Recognizer();
696 
697  ros::spin();
698 
699  //clean after shutdown
700  delete recognizer;
701 
702 
703  return 0;
704 }
#define KEYCODE_NEXT_RESULT
Definition: recognizer.cpp:74
void visualizeSelectedResult()
Definition: recognizer.cpp:523
ISM::ObjectSetPtr object_set_buffer_
Definition: recognizer.cpp:346
std::string base_frame_
Definition: recognizer.cpp:334
#define KEYCODE_PREVOBJECT
Definition: recognizer.cpp:68
int selected_result_index_
Definition: recognizer.cpp:335
std::vector< ISM::ObjectPtr > extractRealObjects(const ISM::RecognitionResultPtr result)
Definition: recognizer.cpp:464
ros::NodeHandle nh_
Definition: recognizer.cpp:315
dynamic_reconfigure::Server< asr_ism::recognizerConfig > dyn_reconf_server_
Definition: recognizer.cpp:316
#define KEYCODE_NEXTOBJECT
Definition: recognizer.cpp:67
int main(int argc, char **argv)
Definition: recognizer.cpp:691
#define APO_RATER
Definition: recognizer.cpp:51
VIZ::ISMResultVisualizerRVIZPtr recogition_result_visualizer_
Definition: recognizer.cpp:337
pose_prediction_ism::PosePredictor * pose_predictor_
Definition: recognizer.cpp:350
#define KEYCODE_HELP
Definition: recognizer.cpp:72
unsigned int configuration_file_counter_
Definition: recognizer.cpp:330
void printAdditionalResultInformation(ISM::RecognitionResultPtr &result)
Definition: recognizer.cpp:406
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void predictScene()
Definition: recognizer.cpp:561
ISM::RecognizerPtr ism_recognizer_
Definition: recognizer.cpp:320
VIZ::ISMVotingVisualizerRVIZPtr voting_space_visualizer_
Definition: recognizer.cpp:338
void printAdditionalHelpText()
Definition: recognizer.cpp:491
#define KEYCODE_VISUALIZE
Definition: recognizer.cpp:61
size_t number_of_objects_
Definition: recognizer.cpp:355
#define KEYCODE_VIZ_ALL_RESULTS
Definition: recognizer.cpp:77
#define KEYCODE_NEXTPOSE
Definition: recognizer.cpp:69
VIZ::ObjectModelVisualizerRVIZ * object_model_visualizer_
Definition: recognizer.cpp:340
#define KEYCODE_VIZ_SELECTED_RESULT
Definition: recognizer.cpp:76
VIZ::ISMPosePredictionVisualizerRVIZPtr ism_pose_prediction_visualizer_
Definition: recognizer.cpp:339
#define KEYCODE_PREDICTSCENE
Definition: recognizer.cpp:64
ROSCPP_DECL void spin(Spinner &spinner)
ros::Publisher visualization_publisher_
Definition: recognizer.cpp:333
SceneConfigurator * scene_configurator_
Definition: recognizer.cpp:317
void recognizeScene(ISM::ObjectSetPtr object_set)
Definition: recognizer.cpp:157
void visualizeAllResults()
Definition: recognizer.cpp:535
#define KEYCODE_BUFFERSCENE
Definition: recognizer.cpp:63
#define ROS_INFO(...)
std::vector< ISM::RecognitionResultPtr > results_buffer_
Definition: recognizer.cpp:343
void getNodeParameters(std::string &visualization_topic)
Definition: recognizer.cpp:631
const std::string & getNamespace() const
void clearAllMarker()
clearAllMarker
Definition: recognizer.cpp:553
#define KEYCODE_PREV_RESULT
Definition: recognizer.cpp:75
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
double max_projection_angle_deviation_
Definition: recognizer.cpp:322
#define ROS_DEBUG_STREAM(args)
#define KEYCODE_PREVREF
Definition: recognizer.cpp:66
void processKeyboardInput(int key)
Definition: recognizer.cpp:215
int scene_counter_
Definition: recognizer.cpp:352
bool enable_storing_config_to_xml_
Definition: recognizer.cpp:328
#define KEYCODE_BUFFERVOTES
Definition: recognizer.cpp:60
#define ROS_INFO_STREAM(args)
std::string configuration_folder_path_
Definition: recognizer.cpp:329
double bin_size_
Definition: recognizer.cpp:321
bool buffer_next_scene_
Definition: recognizer.cpp:347
bool getParam(const std::string &key, std::string &s) const
double pose_prediction_sampel_faktor_
Definition: recognizer.cpp:354
#define KEYCODE_PREVPOSE
Definition: recognizer.cpp:70
std::string db_filename_
Definition: recognizer.cpp:323
void storeObjectsToXML(ISM::ObjectSetPtr object_set)
Definition: recognizer.cpp:361
void dynamicReconfCallback(asr_ism::recognizerConfig &config, uint32_t level)
Definition: recognizer.cpp:608
bool valid_position_vis_
Definition: recognizer.cpp:353
std::map< std::string, boost::filesystem::path > object_type_to_ressource_path_map_
Definition: recognizer.cpp:351
#define ROS_ERROR(...)
void processObjectInput(ISM::ObjectPtr object)
Definition: recognizer.cpp:307
#define KEYCODE_NEXTREF
Definition: recognizer.cpp:65
#define SIMPLE_RATER
Definition: recognizer.cpp:50
int max_number_of_results_per_pattern_
Definition: recognizer.cpp:325


asr_ism
Author(s): Borella Jocelyn, Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Thu Jan 9 2020 07:20:58