world_model.cpp
Go to the documentation of this file.
1 
19 
20 #include "asr_object_database/RecognizerList.h"
21 #include <boost/algorithm/string.hpp>
22 
23 namespace world_model
24 {
25 
27  local_handle_(ros::this_node::getName()),
28  mDynamicReconfigServer(local_handle_),
29  model_type_ptr_per_type_map_ptr_(new ModelTypePtrPerTypeMap()),
30  settings_ptr_(new Settings())
31 {
33 
34  dynamic_reconfigure::Server<asr_world_model::DynamicParametersConfig>::CallbackType f = boost::bind(&WorldModel::dynamicReconfigureCallback, this, _1, _2);
35  mDynamicReconfigServer.setCallback(f);
36 
37  boost::shared_ptr<ros::Publisher> marker_publisher_ptr = boost::make_shared<ros::Publisher>(
38  local_handle_.advertise<visualization_msgs::MarkerArray>(WorldModel::GetObjectVisualizationParamName(),
39  10,
40  true));
41 
42  boost::shared_ptr<ros::ServiceClient> object_type_client_ptr =
43  boost::make_shared<ros::ServiceClient>(local_handle_.serviceClient<asr_object_database::ObjectMetaData>(WorldModel::GetClientGetObjectMetaDataServiceName()));
44 
46  object_type_client_ptr,
48  settings_ptr_));
52 
53 
55 
56  ROS_INFO_STREAM("Initialization done");
57 }
58 
59 void WorldModel::dynamicReconfigureCallback(asr_world_model::DynamicParametersConfig &config, uint32_t level) {
60  ROS_INFO_STREAM("Dynamic reconfigure called with level: " << level);
61 
62  local_handle_.setParam("enable_object_sampling", config.enable_object_sampling);
63  local_handle_.setParam("calculate_deviations", config.calculate_deviations);
64  local_handle_.setParam("deviation_number_of_samples_position", config.deviation_number_of_samples_position);
65  local_handle_.setParam("deviation_number_of_samples_orientation", config.deviation_number_of_samples_orientation);
66  local_handle_.setParam("objects_to_sample", config.objects_to_sample);
67  local_handle_.setParam("object_position_distance_threshold", config.object_position_distance_threshold);
68  local_handle_.setParam("object_orientation_rad_distance_threshold", config.object_orientation_rad_distance_threshold);
69  local_handle_.setParam("viewport_position_distance_threshold", config.viewport_position_distance_threshold);
70  local_handle_.setParam("viewport_orientation_rad_distance_threshold", config.viewport_orientation_rad_distance_threshold);
71  local_handle_.setParam("object_rating_min_count", config.object_rating_min_count);
72  local_handle_.setParam("use_default_intermediate_object_weight", config.use_default_intermediate_object_weight);
73  local_handle_.setParam("default_intermediate_object_weight", config.default_intermediate_object_weight);
74  local_handle_.setParam("intermediate_object_weight_file_name", config.intermediate_object_weight_file_name);
75  local_handle_.setParam("use_world_description", config.use_world_description);
76 
77  local_handle_.setParam("recognizers_string_map", config.recognizers_string_map);
78  local_handle_.setParam("weight_string_map", config.weight_string_map);
79  local_handle_.setParam("object_string_map", config.object_string_map);
80 
81  local_handle_.setParam("debugLevels", config.debugLevels);
82 
84  initParams();
85 }
86 
88  if (local_handle_.hasParam("/rp_ism_node/bin_size")) {
89  double oldBinSize = settings_ptr_->bin_size;
90  local_handle_.getParam("/rp_ism_node/bin_size", settings_ptr_->bin_size);
91  local_handle_.setParam("bin_size", settings_ptr_->bin_size);
92  if (oldBinSize != settings_ptr_->bin_size) {
93  debug_helper_ptr_->write(std::stringstream() << "/rp_ism_node/bin_size was updated to: " << settings_ptr_->bin_size, DebugHelper::PARAMETERS);
94  }
95  }
96  if (local_handle_.hasParam("/rp_ism_node/maxProjectionAngleDeviation")) {
97  double oldMaxProjectionAngleDeviation = settings_ptr_->maxProjectionAngleDeviation;
98  local_handle_.getParam("/rp_ism_node/maxProjectionAngleDeviation", settings_ptr_->maxProjectionAngleDeviation);
99  local_handle_.setParam("maxProjectionAngleDeviation", settings_ptr_->maxProjectionAngleDeviation);
100  if (oldMaxProjectionAngleDeviation != settings_ptr_->maxProjectionAngleDeviation) {
101  debug_helper_ptr_->write(std::stringstream() << "/rp_ism_node/maxProjectionAngleDeviation was updated to:" << settings_ptr_->maxProjectionAngleDeviation, DebugHelper::PARAMETERS);
102  }
103  }
104  if (local_handle_.hasParam("/rp_ism_node/dbfilename")) {
105  std::string oldDbfilename = settings_ptr_->dbfilename;
106  local_handle_.getParam("/rp_ism_node/dbfilename", settings_ptr_->dbfilename);
107  local_handle_.setParam("dbfilename", settings_ptr_->dbfilename);
108  if (oldDbfilename != settings_ptr_->dbfilename) {
109  debug_helper_ptr_->write(std::stringstream() << "/rp_ism_node/dbfilename was updated to: " << settings_ptr_->dbfilename, DebugHelper::PARAMETERS);
110  }
111  }
112 }
113 
117 
118  local_handle_.getParam("enable_object_sampling", settings_ptr_->enable_object_sampling);
119  local_handle_.getParam("calculate_deviations", settings_ptr_->calculate_deviations);
120  local_handle_.getParam("deviation_number_of_samples_position", settings_ptr_->deviation_number_of_samples_position);
121  local_handle_.getParam("deviation_number_of_samples_orientation", settings_ptr_->deviation_number_of_samples_orientation);
122  local_handle_.getParam("object_position_distance_threshold", settings_ptr_->object_position_distance_threshold);
123  local_handle_.getParam("object_orientation_rad_distance_threshold", settings_ptr_->object_orientation_rad_distance_threshold);
124  local_handle_.getParam("viewport_position_distance_threshold", settings_ptr_->viewport_position_distance_threshold);
125  local_handle_.getParam("viewport_orientation_rad_distance_threshold", settings_ptr_->viewport_orientation_rad_distance_threshold);
126  local_handle_.getParam("object_rating_min_count", settings_ptr_->object_rating_min_count);
127  local_handle_.getParam("use_default_intermediate_object_weight", settings_ptr_->use_default_intermediate_object_weight);
128  local_handle_.getParam("default_intermediate_object_weight", settings_ptr_->default_intermediate_object_weight);
129  local_handle_.getParam("use_world_description", settings_ptr_->use_world_description);
130 
131  local_handle_.getParam("dbfilename", settings_ptr_->dbfilename);
132  local_handle_.getParam("bin_size", settings_ptr_->bin_size);
133  local_handle_.getParam("maxProjectionAngleDeviation", settings_ptr_->maxProjectionAngleDeviation);
134 
135  std::string objects_to_sample;
136  local_handle_.getParam("objects_to_sample", objects_to_sample);
137  settings_ptr_->objects_to_sample = *processStringVector<std::string>(objects_to_sample);
138 
139  debug_helper_ptr_->write(std::stringstream() << '\n' << settings_ptr_, DebugHelper::PARAMETERS);
140 
141  if (settings_ptr_->use_world_description) {
143  } else {
145  }
146 
147  //Log parsed values
148  debug_helper_ptr_->write(std::stringstream() << "Parsed ModelObjects:" << '\n' << model_type_ptr_per_type_map_ptr_, DebugHelper::PARAMETERS);
149 
150  ROS_INFO_STREAM("Parameters initialized");
151 }
152 
154  std::string recognizers_string_map_;
155  local_handle_.getParam("recognizers_string_map", recognizers_string_map_);
156  boost::shared_ptr<std::map<std::string, std::string>> recognizers_map_ptr_ = processStringMap<std::string>(recognizers_string_map_);
157 
158  for (const std::pair<std::string, std::string> &recongnizer_pair : *recognizers_map_ptr_) {
159  if (model_type_ptr_per_type_map_ptr_->find(recongnizer_pair.first) == model_type_ptr_per_type_map_ptr_->end()) {
160  model_type_ptr_per_type_map_ptr_->insert(std::make_pair(recongnizer_pair.first, ModelTypePtr(new ModelType(recongnizer_pair.first))));
161  }
162  (*model_type_ptr_per_type_map_ptr_)[recongnizer_pair.first]->recognizerName = recongnizer_pair.second;
163  }
164 
165 
166  std::string weight_string_map_;
167  local_handle_.getParam("weight_string_map", weight_string_map_);
168  boost::shared_ptr<std::map<std::string, double>> weight_map_ptr = processStringMap<double>(weight_string_map_);
169 
170  for (const std::pair<std::string, double> &weight_pair : *weight_map_ptr) {
171  if (model_type_ptr_per_type_map_ptr_->find(weight_pair.first) == model_type_ptr_per_type_map_ptr_->end()) {
172  model_type_ptr_per_type_map_ptr_->insert(std::make_pair(weight_pair.first, ModelTypePtr(new ModelType(weight_pair.first))));
173  }
174  (*model_type_ptr_per_type_map_ptr_)[weight_pair.first]->weight = weight_pair.second;
175  }
176 
177 
178  std::string object_string_map;
179  local_handle_.getParam("object_string_map", object_string_map);
180  boost::shared_ptr<std::map<std::string, int>> parsedObjectMapPtr = processStringMap<int>(object_string_map);
181 
182  for (const std::pair<std::string, int> &parsedObjectMap : *parsedObjectMapPtr) {
183  const std::string &typeAndId = parsedObjectMap.first;
184  std::size_t found = typeAndId.find("&");
185  if (found != std::string::npos) {
186 
187  const std::string &type = typeAndId.substr(0,found);
188  const std::string &observed_id = typeAndId.substr(found+1);
190  model_type_ptr_per_type_map_ptr_->insert(std::make_pair(type, ModelTypePtr(new ModelType(type))));
191  }
192 
193  if (model_type_ptr_per_type_map_ptr_->find(type)->second->model_object_ptr_per_id_map.find(observed_id) ==
194  model_type_ptr_per_type_map_ptr_->find(type)->second->model_object_ptr_per_id_map.end()) {
195  model_type_ptr_per_type_map_ptr_->find(type)->second->model_object_ptr_per_id_map.insert(
196  std::make_pair(observed_id, ModelObjectPtr(new ModelObject(observed_id))));
197  }
198  (*model_type_ptr_per_type_map_ptr_)[type]->model_object_ptr_per_id_map[observed_id]->objectCount = parsedObjectMap.second;
199  }
200  }
201 
202 }
203 
205  ros::ServiceClient recognizerListServiceClient = local_handle_.serviceClient<asr_object_database::RecognizerList>(WorldModel::GetClientGetRecognizerListServiceName());
206  //Duration is buggy here
207  ROS_INFO("Wait for asr_object_database to existence");
208  recognizerListServiceClient.waitForExistence();
209 
210  asr_object_database::RecognizerList recognizerList;
211  if (!recognizerListServiceClient.call(recognizerList)) {
212  ROS_ERROR("Get RecognizerList service call to asr_object_database was not successful");
213  ros::shutdown();
214  return;
215  }
216 
217  ISM::TableHelperPtr table_helper = ISM::TableHelperPtr(new ISM::TableHelper(settings_ptr_->dbfilename));
218 
219  std::set<std::pair<std::string, std::string>> objectTypesAndIds = table_helper->getObjectTypesAndIdsFromModelObjects();
220  for (const std::pair<std::string, std::string> &objectTypesAndIdFromRecordedObject : table_helper->getObjectTypesAndIdsFromRecordedObjects()) {
221  objectTypesAndIds.insert(objectTypesAndIdFromRecordedObject);
222  }
223  const std::map<std::string, boost::filesystem::path> &ressourcePaths = table_helper->getRessourcePaths();
224  std::map<std::string, std::map<std::string, unsigned int>> temp_object_count_per_type_and_id_map;
225 
226  for (const std::pair<std::string, std::string> &objectTypeAndId : objectTypesAndIds) {
227  if (objectTypeAndId.first.find("_sub") != std::string::npos) {
228  // skip scenes
229  continue;
230  }
231  std::map<std::string, boost::filesystem::path>::const_iterator path_it = ressourcePaths.find(objectTypeAndId.first);
232  if (path_it == ressourcePaths.end()) {
233  ROS_WARN_STREAM("No resourcePath for type/id: " << objectTypeAndId.first << "/" << objectTypeAndId.second <<
234  " in ISM_Table found -> will not be used in world_model");
235  continue;
236  }
237 
238  if (model_type_ptr_per_type_map_ptr_->find(objectTypeAndId.first) == model_type_ptr_per_type_map_ptr_->end()) {
239  model_type_ptr_per_type_map_ptr_->insert(std::make_pair(objectTypeAndId.first, ModelTypePtr(new ModelType(objectTypeAndId.first))));
240  }
241 
242  if (model_type_ptr_per_type_map_ptr_->find(objectTypeAndId.first)->second->model_object_ptr_per_id_map.find(objectTypeAndId.second) ==
243  model_type_ptr_per_type_map_ptr_->find(objectTypeAndId.first)->second->model_object_ptr_per_id_map.end()) {
244  model_type_ptr_per_type_map_ptr_->find(objectTypeAndId.first)->second->model_object_ptr_per_id_map.insert(
245  std::make_pair(objectTypeAndId.second, ModelObjectPtr(new ModelObject(objectTypeAndId.second))));
246  }
247 
248  for (const std::string &recognizer_name : recognizerList.response.recognizer_list) {
249  if (path_it->second.string().find(recognizer_name) != std::string::npos) {
250  //The recognizer_name has to be in the path to the asr_object_database to know with which recognizer the object was learned
251  (*model_type_ptr_per_type_map_ptr_)[objectTypeAndId.first]->recognizerName = recognizer_name;
252  }
253  }
254 
255 
256  //temp_object_count_per_type_and_id_map will be used later on to determine the number of objects of same type and id
257  if (temp_object_count_per_type_and_id_map.find(objectTypeAndId.first) == temp_object_count_per_type_and_id_map.end()) {
258  temp_object_count_per_type_and_id_map.insert(std::make_pair(objectTypeAndId.first, std::map<std::string, unsigned int>()));
259  }
260  temp_object_count_per_type_and_id_map.find(objectTypeAndId.first)->second.insert(std::make_pair(objectTypeAndId.second, 0));
261  }
262 
263 
264  //Iterate over all recorded sets to gain the number of trained objects per type and id
265  const std::vector<int> &setIds = table_helper->getSetIds();
266  for (const int &setId : setIds) {
267  const ISM::ObjectSetPtr &objectSetPtr = table_helper->getRecordedObjectSet(setId);
268  for (const ISM::ObjectPtr &object : objectSetPtr->objects) {
269  ++temp_object_count_per_type_and_id_map.find(object->type)->second.find(object->observedId)->second;
270  }
271 
272  for (const std::pair<std::string, ModelTypePtr> &model_type_ptr_per_type_pair: *model_type_ptr_per_type_map_ptr_) {
273  for (const std::pair<std::string, ModelObjectPtr> &model_object_ptr_per_id_pair : model_type_ptr_per_type_pair.second->model_object_ptr_per_id_map) {
274  unsigned int &oldMaxValue = model_object_ptr_per_id_pair.second->objectCount;
275  unsigned int &currentValue = temp_object_count_per_type_and_id_map.find(model_type_ptr_per_type_pair.first)->second.find(model_object_ptr_per_id_pair.first)->second;
276  //Take the max count of all iterated sets
277  model_object_ptr_per_id_pair.second->objectCount = std::max(oldMaxValue, currentValue);
278  //Reset of temp value
279  temp_object_count_per_type_and_id_map.find(model_type_ptr_per_type_pair.first)->second.find(model_object_ptr_per_id_pair.first)->second = 0;
280  }
281  }
282 
283  }
284 
285  initIntermediateObjectWeights(table_helper);
286 }
287 
288 void WorldModel::initIntermediateObjectWeights(const ISM::TableHelperPtr &table_helper) {
289  if (settings_ptr_->use_default_intermediate_object_weight) {
290  for (const std::pair<std::string, ModelTypePtr> &model_type_ptr_per_type_pair: *model_type_ptr_per_type_map_ptr_) {
291  model_type_ptr_per_type_pair.second->weight = settings_ptr_->default_intermediate_object_weight;
292  }
293  return;
294  }
295 
296 
297  local_handle_.getParam("intermediate_object_weight_file_name", settings_ptr_->intermediate_object_weight_file_name);
298 
299  std::vector<std::string> pathSplit;
300  boost::split(pathSplit, settings_ptr_->dbfilename, boost::is_any_of("/"));
301  std::string dbName = pathSplit[pathSplit.size()-1];
302 
303  const std::string placeholder = "XXX";
304  std::string::size_type pos;
305  if ((pos = settings_ptr_->intermediate_object_weight_file_name.find(placeholder)) != std::string::npos) {
306  settings_ptr_->intermediate_object_weight_file_name.replace(pos, placeholder.length(), dbName);
307  }
308 
309  debug_helper_ptr_->write(std::stringstream() << "intermediate_object_weight_file_name: " << settings_ptr_->intermediate_object_weight_file_name, DebugHelper::PARAMETERS);
310 
311  if (!std::ifstream(settings_ptr_->intermediate_object_weight_file_name.c_str()).good()) {
312  ROS_INFO_STREAM("intermediate_object_weight_file: " << settings_ptr_->intermediate_object_weight_file_name << " not found. Execute itermediate_object_generator to generate file");
313  system("roslaunch asr_intermediate_object_generator asr_intermediate_object_generator.launch");
314  }
315  std::ifstream intermediate_object_weight_file(settings_ptr_->intermediate_object_weight_file_name.c_str(), std::ifstream::in);
316  // buffer and doc have to be declared here in the outer scope
317  std::vector<char> buffer;
318  rapidxml::xml_document<> doc;
319  rapidxml::xml_node<> *interObjNode;
320  if (intermediate_object_weight_file) {
321  buffer = std::vector<char>((std::istreambuf_iterator<char>(intermediate_object_weight_file)), std::istreambuf_iterator<char>());
322  buffer.push_back('\0');
323  // Parse the buffer using the xml file parsing library into doc
324  doc.parse<0>(&buffer[0]);
325  interObjNode = doc.first_node("InterObj");
326  } else {
327  ROS_INFO_STREAM("intermediate_object_weight_file still not found (there must be a problem with the itermediate_object_generator)."
328  << " Check if weights are in sqlTable or use default_intermediate_object_weight");
329  }
330 
331 
332  std::map<std::string, std::map<std::string, std::string>> modelWeightsPerTypeAndId = table_helper->getModelWeightsPerTypeAndId();
333 
334  for (const std::pair<std::string, ModelTypePtr> &model_type_ptr_per_type_pair: *model_type_ptr_per_type_map_ptr_) {
335  for (const std::pair<std::string, ModelObjectPtr> &model_object_ptr_per_id_pair : model_type_ptr_per_type_pair.second->model_object_ptr_per_id_map) {
336 
337  double weight = 0.0;
338  bool weightFound = false;
339  if (interObjNode) {
340  for (rapidxml::xml_node<> *obj_node = interObjNode->first_node("obj"); obj_node; obj_node = obj_node->next_sibling()) {
341  std::string name = boost::lexical_cast<std::string>(obj_node->first_attribute("name")->value());
342  std::string id = boost::lexical_cast<std::string>(obj_node->first_attribute("observedId")->value());
343  if (model_type_ptr_per_type_pair.first == name && model_object_ptr_per_id_pair.first == id) {
344  weight = std::max(weight, boost::lexical_cast<double>(obj_node->value()));
345  weightFound = true;
346  }
347  }
348  }
349  if (interObjNode && !weightFound) {
350  ROS_INFO_STREAM("No intermediate_object_weight for type/id: " << model_type_ptr_per_type_pair.first << "/" << model_object_ptr_per_id_pair.first << " in xml_file found."
351  << " Check if weights are in sqlTable or use default_intermediate_object_weight");
352  }
353  if (!weightFound) {
354  for (const std::pair<std::string, std::map<std::string, std::string>> &modelWeightsPerTypeAndIdPair: modelWeightsPerTypeAndId) {
355  for (const std::pair<std::string, std::string> &modelWeightsPerIdPair : modelWeightsPerTypeAndIdPair.second) {
356  if (model_type_ptr_per_type_pair.first == modelWeightsPerTypeAndIdPair.first && model_object_ptr_per_id_pair.first == modelWeightsPerIdPair.first) {
357  weight = std::max(weight, boost::lexical_cast<double>(modelWeightsPerIdPair.second));
358  weightFound = true;
359  }
360  }
361  }
362  }
363  if (!weightFound) {
364  ROS_INFO_STREAM("No intermediate_object_weight for type/id: " << model_type_ptr_per_type_pair.first << "/" << model_object_ptr_per_id_pair.first << " in sqlTable found. Use default_intermediate_object_weight");
365  weight = settings_ptr_->default_intermediate_object_weight;
366  }
367  //need max, because weights will be calculated per type AND Id, but we save only per type
368  model_type_ptr_per_type_pair.second->weight = std::max(weight, model_type_ptr_per_type_pair.second->weight);
369  }
370  }
371 }
372 
374  //ViewPortHandler services
378 
382 
386 
390 
391  //FoundObjectHandler services
395 
399 
400  // so that we can call checkParametersFromOtherNode
403  this);
404 
408 
412 
413  //CommonInformationHandler services
417 
421 
424  this);
425 
429 
430  //CompletePatternsHandler services
434 
438 
442 }
443 
444 bool WorldModel::processEmptyFoundObjectListServiceCall(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response) {
445  bool success = found_object_handler_ptr_->processEmptyFoundObjectListServiceCall(request, response);
446 
447  std::string mydbfilename;
448  local_handle_.getParam("dbfilename", mydbfilename);
450  std::string newMydbfilename;
451  local_handle_.getParam("dbfilename", newMydbfilename);
452 
453  if (mydbfilename != newMydbfilename) {
454  ROS_INFO_STREAM("dbfilename changed");
456  initParams();
457  }
458  return success;
459 }
460 
461 bool WorldModel::processGetAllObjectsListServiceCall(asr_world_model::GetAllObjectsList::Request &request, asr_world_model::GetAllObjectsList::Response &response) {
462  std::string mydbfilename;
463  local_handle_.getParam("dbfilename", mydbfilename);
465  std::string newMydbfilename;
466  local_handle_.getParam("dbfilename", newMydbfilename);
467 
468  if (mydbfilename != newMydbfilename) {
469  ROS_INFO_STREAM("dbfilename changed");
471  initParams();
472  }
473  return common_information_handler_ptr_->processGetAllObjectsListServiceCall(request, response);
474 }
475 
476 }
ros::ServiceServer get_viewport_list_service_server_
Definition: world_model.hpp:80
boost::shared_ptr< ModelObject > ModelObjectPtr
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
ros::ServiceServer push_found_object_service_server_
Definition: world_model.hpp:83
static const std::string GetObjectVisualizationParamName()
Definition: world_model.hpp:66
static const std::string GetGetViewportListServiceName()
static void resetInstance()
Definition: pose_helper.cpp:32
bool processEmptyCompletePatternsServiceCall(asr_world_model::EmptyCompletePatterns::Request &request, asr_world_model::EmptyCompletePatterns::Response &response)
ros::ServiceServer filter_viewport_depending_on_already_visited_viewports
Definition: world_model.hpp:81
bool processGetRecognizerNameServiceCall(asr_world_model::GetRecognizerName::Request &request, asr_world_model::GetRecognizerName::Response &response)
get the associated recognizer name for a given object
f
bool processEmptyViewportListServiceCall(asr_world_model::EmptyViewportList::Request &request, asr_world_model::EmptyViewportList::Response &response)
Removes the whole next best view viewports from list if request.object_type is set to "all" in the ot...
bool processPushViewportServiceCall(asr_world_model::PushViewport::Request &request, asr_world_model::PushViewport::Response &response)
Pushes a next best view viewport to a list.
ros::ServiceServer get_recognizer_name_service_server_
Definition: world_model.hpp:89
static const std::string GetPushFoundObjectListServiceName()
ros::ServiceServer get_all_objects_list_service_server_
Definition: world_model.hpp:91
static const std::string GetClientGetRecognizerListServiceName()
Definition: world_model.hpp:73
bool call(MReq &req, MRes &res)
boost::shared_ptr< CompletePatternsHandler > complete_patterns_handler_ptr_
std::string getName(void *handle)
static const std::string GetGetCompletePatternsServiceName()
bool processGetFoundObjectListServiceCall(asr_world_model::GetFoundObjectList::Request &request, asr_world_model::GetFoundObjectList::Response &response)
Returns the already found objects.
bool processGetCompletePatternsServiceCall(asr_world_model::GetCompletePatterns::Request &request, asr_world_model::GetCompletePatterns::Response &response)
WorldModel()
Creates a new instance of the world model and starts the services.
Definition: world_model.cpp:26
static const std::string GetGetMissingObjectListServiceName()
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ros::ServiceServer visualize_sampled_poses_service_server_
Definition: world_model.hpp:87
static const std::string GetGetIntermediateObjectWeightServiceName()
ros::ServiceServer get_missing_object_list_service_server_
Definition: world_model.hpp:92
ros::ServiceServer get_found_object_list_service_server_
Definition: world_model.hpp:86
static boost::shared_ptr< DebugHelper > getInstance()
static const std::string GetGetRecognizerNameServiceName()
void dynamicReconfigureCallback(asr_world_model::DynamicParametersConfig &config, uint32_t level)
Definition: world_model.cpp:59
ros::ServiceServer get_complete_patterns_service_server_
Definition: world_model.hpp:94
bool processGetViewportListServiceCall(asr_world_model::GetViewportList::Request &request, asr_world_model::GetViewportList::Response &response)
Returns the whole list of next best view viewports if request.object_type is set to "all" else just t...
bool processGetAllObjectsListServiceCall(asr_world_model::GetAllObjectsList::Request &request, asr_world_model::GetAllObjectsList::Response &response)
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
bool processPushCompletePatternsCall(asr_world_model::PushCompletePatterns::Request &request, asr_world_model::PushCompletePatterns::Response &response)
#define ROS_INFO(...)
static const std::string GetEmptyCompletePatternsServiceName()
bool processGetIntermediateObjectWeightServiceCall(asr_world_model::GetIntermediateObjectWeight::Request &request, asr_world_model::GetIntermediateObjectWeight::Response &response)
get the associated Intermediate Object Weight for a given object
boost::shared_ptr< CommonInformationHandler > common_information_handler_ptr_
WorldModel class provides services for adding the viewports of the next best views to a list and retr...
static const std::string GetGetAllObjectsListServiceName()
static const std::string GetEmptyFoundObjectListServiceName()
ros::NodeHandle local_handle_
Definition: world_model.hpp:99
static const std::string GetFilterViewportDependingOnAlreadyVisitedViewportsName()
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::ServiceServer get_intermediate_object_weight_service_server_
Definition: world_model.hpp:90
#define ROS_WARN_STREAM(args)
ros::ServiceServer push_viewport_service_server_
Definition: world_model.hpp:78
ros::ServiceServer push_complete_patterns_service_server_
Definition: world_model.hpp:96
boost::shared_ptr< FoundObjectHandler > found_object_handler_ptr_
static const std::string GetPushViewportServiceName()
static const std::string GetPushCompletePatternsServiceName()
bool processVisualizeSampledPosesCall(asr_world_model::VisualizeSampledPoses::Request &request, asr_world_model::VisualizeSampledPoses::Response &response)
void initIntermediateObjectWeights(const ISM::TableHelperPtr &table_helper)
bool processFilterViewportDependingOnAlreadyVisitedViewportsVisited(asr_world_model::FilterViewportDependingOnAlreadyVisitedViewports::Request &request, asr_world_model::FilterViewportDependingOnAlreadyVisitedViewports::Response &response)
Filter the objects of the viewport depending on already visited viewports.
#define ROS_INFO_STREAM(args)
static void resetInstance()
ros::ServiceServer empty_complete_patterns_service_server_
Definition: world_model.hpp:95
DebugHelperPtr debug_helper_ptr_
bool getParam(const std::string &key, std::string &s) const
bool processEmptyFoundObjectListServiceCall(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response)
static const std::string GetClientGetObjectMetaDataServiceName()
Definition: world_model.hpp:70
ModelTypePtrPerTypeMapPtr model_type_ptr_per_type_map_ptr_
static const std::string GetEmptyViewportListServiceName()
ROSCPP_DECL void shutdown()
ros::ServiceServer push_found_object_list_service_server_
Definition: world_model.hpp:84
boost::shared_ptr< ViewPortHandler > view_port_handler_ptr_
ros::ServiceServer empty_found_object_list_service_server_
Definition: world_model.hpp:85
bool hasParam(const std::string &key) const
std::map< std::string, ModelTypePtr > ModelTypePtrPerTypeMap
Definition: model_type.hpp:37
boost::shared_ptr< ModelType > ModelTypePtr
Definition: model_type.hpp:36
static const std::string GetPushFoundObjectServiceName()
bool processGetMissingObjectListServiceCall(asr_world_model::GetMissingObjectList::Request &request, asr_world_model::GetMissingObjectList::Response &response)
returns all missing objects in the current scene
ros::ServiceServer empty_viewport_list_service_server_
Definition: world_model.hpp:79
#define ROS_ERROR(...)
dynamic_reconfigure::Server< asr_world_model::DynamicParametersConfig > mDynamicReconfigServer
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const
bool processPushFoundObjectListServiceCall(asr_world_model::PushFoundObjectList::Request &request, asr_world_model::PushFoundObjectList::Response &response)
Pushes the found object to a list.
static const std::string GetVisualizeSampledPosesName()
bool processPushFoundObjectServiceCall(asr_world_model::PushFoundObject::Request &request, asr_world_model::PushFoundObject::Response &response)
Pushes the found object to a list.
WorldModel class provides services for adding the viewports of the next best views to a list and retr...
static const std::string GetGetFoundObjectListServiceName()


asr_world_model
Author(s): Aumann Florian, Borella Jocelyn, Hutmacher Robin, Karrenbauer Oliver, Meißner Pascal, Schleicher Ralf, Stöckle Patrick, Trautmann Jeremias
autogenerated on Thu Jan 9 2020 07:20:01