Main MRPT website > C++ reference for MRPT 1.9.9
CICPCriteriaERD_impl.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #ifndef CICPCRITERIAERD_IMPL_H
11 #define CICPCRITERIAERD_IMPL_H
12 
13 namespace mrpt
14 {
15 namespace graphslam
16 {
17 namespace deciders
18 {
19 // Ctors, Dtors
20 // //////////////////////////////////
21 
22 template <class GRAPH_T>
24  : params(*this), // pass reference to self when initializing the parameters
25  m_search_disk_color(142, 142, 56),
26  m_laser_scans_color(0, 20, 255),
27  m_is_using_3DScan(false)
28 {
29  MRPT_START;
30  using namespace mrpt::utils;
31 
32  this->initializeLoggers("CICPCriteriaERD");
33 
34  // start ICP constraint registration only when
35  m_edge_types_to_nums["ICP2D"] = 0;
36  m_edge_types_to_nums["ICP3D"] = 0;
37  m_edge_types_to_nums["LC"] = 0;
38 
39  this->m_last_total_num_nodes = 2;
40 
41  this->logFmt(LVL_DEBUG, "Initialized class object");
42 
43  MRPT_END;
44 }
45 template <class GRAPH_T>
47 {
48 }
49 
50 // Methods implementations
51 // //////////////////////////////////
52 
53 template <class GRAPH_T>
56  mrpt::obs::CSensoryFrame::Ptr observations,
57  mrpt::obs::CObservation::Ptr observation)
58 {
59  MRPT_START;
60  MRPT_UNUSED_PARAM(action);
61  using namespace mrpt::obs;
62  using namespace mrpt::utils;
63 
64  // check possible prior node registration
65  bool registered_new_node = false;
66 
67  if (this->m_last_total_num_nodes < this->m_graph->nodeCount())
68  {
69  registered_new_node = true;
70  this->m_last_total_num_nodes = this->m_graph->nodeCount();
71  this->logFmt(LVL_DEBUG, "New node has been registered!");
72  }
73 
74  if (observation)
75  { // observation-only rawlog format
76  if (IS_CLASS(observation, CObservation2DRangeScan))
77  {
79  std::dynamic_pointer_cast<mrpt::obs::CObservation2DRangeScan>(
80  observation);
81  m_is_using_3DScan = false;
82  }
83  if (IS_CLASS(observation, CObservation3DRangeScan))
84  {
86  std::dynamic_pointer_cast<mrpt::obs::CObservation3DRangeScan>(
87  observation);
88  // just load the range/intensity images - CGraphSlanEngine takes
89  // care
90  // of the path
91  m_last_laser_scan3D->load();
92 
93  // grab fake 2D range scan for visualization
95  /*from = */ m_last_laser_scan3D,
96  /*to = */ &m_fake_laser_scan2D);
97 
98  m_is_using_3DScan = true;
99  }
100 
101  // New node has been registered.
102  // add the last laser_scan
103  if (registered_new_node)
104  {
106  {
107  this->m_nodes_to_laser_scans2D[this->m_graph->nodeCount() - 1] =
109  this->logFmt(
110  LVL_DEBUG, "Added laser scans of nodeID: %lu",
111  this->m_graph->nodeCount() - 1);
112  }
114  {
115  m_nodes_to_laser_scans3D[this->m_graph->nodeCount() - 1] =
117  this->logFmt(
118  LVL_DEBUG, "Added laser scans of nodeID: %lu",
119  this->m_graph->nodeCount() - 1);
120  }
121  }
122  }
123  else
124  { // action-observations rawlog format
125  // append current laser scan
127  observations->getObservationByClass<CObservation2DRangeScan>();
128  if (registered_new_node && m_last_laser_scan2D)
129  {
130  this->m_nodes_to_laser_scans2D[this->m_graph->nodeCount() - 1] =
132  }
133  }
134 
135  // edge registration procedure - same for both rawlog formats
136  if (registered_new_node)
137  {
138  // get set of nodes within predefined distance for ICP
139  std::set<mrpt::utils::TNodeID> nodes_to_check_ICP;
140  this->getNearbyNodesOf(
141  &nodes_to_check_ICP, this->m_graph->nodeCount() - 1,
142  params.ICP_max_distance);
143  this->logFmt(
144  LVL_DEBUG, "Found * %lu * nodes close to nodeID %lu",
145  nodes_to_check_ICP.size(), this->m_graph->nodeCount() - 1);
146 
147  // reset the loop_closure flag and run registration
148  this->m_just_inserted_lc = false;
149  registered_new_node = false;
150 
151  if (m_is_using_3DScan)
152  {
153  checkRegistrationCondition3D(nodes_to_check_ICP);
154  }
155  else
156  {
157  checkRegistrationCondition2D(nodes_to_check_ICP);
158  }
159  }
160 
161  return true;
162  MRPT_END;
163 }
164 
165 template <class GRAPH_T>
167  const std::set<mrpt::utils::TNodeID>& nodes_set)
168 {
169  MRPT_START;
170  using namespace mrpt;
171  using namespace mrpt::obs;
172  using namespace mrpt::math;
173 
174  mrpt::utils::TNodeID curr_nodeID = this->m_graph->nodeCount() - 1;
175  CObservation2DRangeScan::Ptr curr_laser_scan;
176  typename nodes_to_scans2D_t::const_iterator search;
177 
178  // search for curr_laser_scan
179  search = this->m_nodes_to_laser_scans2D.find(curr_nodeID);
180  if (search != this->m_nodes_to_laser_scans2D.end())
181  {
182  curr_laser_scan = search->second;
183  }
184 
185  // commence only if I have the current laser scan
186  if (curr_laser_scan)
187  {
188  // try adding ICP constraints with each node in the previous set
190  nodes_set.begin();
191  node_it != nodes_set.end(); ++node_it)
192  {
193  // get the ICP edge between current and last node
194  constraint_t rel_edge;
196  CObservation2DRangeScan::Ptr prev_laser_scan;
197 
198  // search for prev_laser_scan
199  search = this->m_nodes_to_laser_scans2D.find(*node_it);
200  if (search != this->m_nodes_to_laser_scans2D.end())
201  {
202  prev_laser_scan = search->second;
203 
204  // make use of initial node position difference for the ICP edge
205  pose_t initial_pose = this->m_graph->nodes[curr_nodeID] -
206  this->m_graph->nodes[*node_it];
207 
208  this->m_time_logger.enter("CICPCriteriaERD::getICPEdge");
209  this->getICPEdge(
210  *prev_laser_scan, *curr_laser_scan, &rel_edge,
211  &initial_pose, &icp_info);
212  this->m_time_logger.leave("CICPCriteriaERD::getICPEdge");
213 
214  // Debugging statements
216  ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
217  ">>>>>>>>>");
219  "ICP constraint between NON-successive nodes: "
220  << *node_it << " => " << curr_nodeID << std::endl
221  << "\tnIterations = " << icp_info.nIterations
222  << "\tgoodness = " << icp_info.goodness);
224  "ICP_goodness_thresh: " << params.ICP_goodness_thresh);
226  "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
227  "<<<<<<<<<");
228 
229  // criterion for registering a new node
230  if (icp_info.goodness > params.ICP_goodness_thresh)
231  {
232  this->registerNewEdge(*node_it, curr_nodeID, rel_edge);
233  m_edge_types_to_nums["ICP2D"]++;
234  // in case of loop closure
235  if (absDiff(curr_nodeID, *node_it) >
236  params.LC_min_nodeid_diff)
237  {
238  m_edge_types_to_nums["LC"]++;
239  this->m_just_inserted_lc = true;
240  }
241  }
242  }
243  }
244  }
245 
246  MRPT_END;
247 }
248 template <class GRAPH_T>
250  const std::set<mrpt::utils::TNodeID>& nodes_set)
251 {
252  MRPT_START;
253  using namespace std;
254  using namespace mrpt::obs;
255  using namespace mrpt::math;
256 
257  mrpt::utils::TNodeID curr_nodeID = this->m_graph->nodeCount() - 1;
258  CObservation3DRangeScan::Ptr curr_laser_scan;
259  std::map<mrpt::utils::TNodeID,
261  // search for curr_laser_scan
262  search = m_nodes_to_laser_scans3D.find(curr_nodeID);
263  if (search != m_nodes_to_laser_scans3D.end())
264  {
265  curr_laser_scan = search->second;
266  }
267 
268  // commence only if I have the current laser scan
269  if (curr_laser_scan)
270  {
271  // try adding ICP constraints with each node in the previous set
273  nodes_set.begin();
274  node_it != nodes_set.end(); ++node_it)
275  {
276  // get the ICP edge between current and last node
277  constraint_t rel_edge;
279  CObservation3DRangeScan::Ptr prev_laser_scan;
280 
281  // search for prev_laser_scan
282  search = m_nodes_to_laser_scans3D.find(*node_it);
283  if (search != m_nodes_to_laser_scans3D.end())
284  {
285  prev_laser_scan = search->second;
286 
287  // TODO - use initial edge estimation
288  this->m_time_logger.enter("CICPCriteriaERD::getICPEdge");
289  this->getICPEdge(
290  *prev_laser_scan, *curr_laser_scan, &rel_edge, nullptr,
291  &icp_info);
292  this->m_time_logger.leave("CICPCriteriaERD::getICPEdge");
293 
294  // criterion for registering a new node
295  if (icp_info.goodness > params.ICP_goodness_thresh)
296  {
297  this->registerNewEdge(*node_it, curr_nodeID, rel_edge);
298  m_edge_types_to_nums["ICP3D"]++;
299  // in case of loop closure
300  if (absDiff(curr_nodeID, *node_it) >
301  params.LC_min_nodeid_diff)
302  {
303  m_edge_types_to_nums["LC"]++;
304  this->m_just_inserted_lc = true;
305  }
306  }
307  }
308  }
309  }
310 
311  MRPT_END;
312 }
313 
314 template <class GRAPH_T>
316  const mrpt::utils::TNodeID& from, const mrpt::utils::TNodeID& to,
317  const constraint_t& rel_edge)
318 {
319  using namespace mrpt::utils;
320  parent_t::registerNewEdge(from, to, rel_edge);
321 
322  this->m_graph->insertEdge(from, to, rel_edge);
323 }
324 
325 template <class GRAPH_T>
327  std::set<mrpt::utils::TNodeID>* nodes_set,
328  const mrpt::utils::TNodeID& cur_nodeID, double distance)
329 {
330  MRPT_START;
331  using namespace mrpt::utils;
332 
333  if (distance > 0)
334  {
335  // check all but the last node.
336  for (TNodeID nodeID = 0; nodeID < this->m_graph->nodeCount() - 1;
337  ++nodeID)
338  {
339  double curr_distance = this->m_graph->nodes[nodeID].distanceTo(
340  this->m_graph->nodes[cur_nodeID]);
341  if (curr_distance <= distance)
342  {
343  nodes_set->insert(nodeID);
344  }
345  }
346  }
347  else
348  { // check against all nodes
349  this->m_graph->getAllNodes(*nodes_set);
350  }
351 
352  MRPT_END;
353 }
354 
355 template <class GRAPH_T>
357  const std::map<std::string, bool>& events_occurred)
358 {
359  MRPT_START;
360  parent_t::notifyOfWindowEvents(events_occurred);
361 
362  // I know the key exists - I put it there explicitly
363  if (events_occurred.find(params.keystroke_laser_scans)->second)
364  {
366  }
367 
368  MRPT_END;
369 }
370 
371 template <class GRAPH_T>
373 {
374  MRPT_START;
375  ASSERTMSG_(this->m_win, "No CDisplayWindow3D* was provided");
376  ASSERTMSG_(this->m_win_manager, "No CWindowManager* was provided");
377 
378  using namespace mrpt::opengl;
379 
380  this->logFmt(mrpt::utils::LVL_INFO, "Toggling LaserScans visualization...");
381 
382  COpenGLScene::Ptr scene = this->m_win->get3DSceneAndLock();
383 
384  if (params.visualize_laser_scans)
385  {
386  CRenderizable::Ptr obj = scene->getByName("laser_scan_viz");
387  obj->setVisibility(!obj->isVisible());
388  }
389  else
390  {
391  dumpVisibilityErrorMsg("visualize_laser_scans");
392  }
393 
394  this->m_win->unlockAccess3DScene();
395  this->m_win->forceRepaint();
396 
397  MRPT_END;
398 }
399 
400 template <class GRAPH_T>
402  std::map<std::string, int>* edge_types_to_num) const
403 {
404  MRPT_START;
405 
406  *edge_types_to_num = m_edge_types_to_nums;
407 
408  MRPT_END;
409 }
410 
411 template <class GRAPH_T>
413 {
414  MRPT_START;
415  using namespace mrpt::opengl;
416  this->logFmt(mrpt::utils::LVL_DEBUG, "Initializing visuals");
417  this->m_time_logger.enter("CICPCriteriaERD::Visuals");
419 
420  ASSERTMSG_(
421  params.has_read_config, "Configuration parameters aren't loaded yet");
422 
424  params.keystroke_laser_scans, "Toggle LaserScans Visualization");
425 
426  // ICP_max_distance disk
427  if (params.ICP_max_distance > 0)
428  {
429  COpenGLScene::Ptr scene = this->m_win->get3DSceneAndLock();
430 
431  CDisk::Ptr obj = mrpt::make_aligned_shared<CDisk>();
432  pose_t initial_pose;
433  obj->setPose(initial_pose);
434  obj->setName("ICP_max_distance");
435  obj->setColor_u8(m_search_disk_color);
436  obj->setDiskRadius(
437  params.ICP_max_distance, params.ICP_max_distance - 0.1);
438  scene->insert(obj);
439 
440  this->m_win->unlockAccess3DScene();
441  this->m_win->forceRepaint();
442  }
443 
444  // laser scan visualization
445  if (params.visualize_laser_scans)
446  {
447  COpenGLScene::Ptr scene = this->m_win->get3DSceneAndLock();
448 
449  CPlanarLaserScan::Ptr laser_scan_viz =
450  mrpt::make_aligned_shared<mrpt::opengl::CPlanarLaserScan>();
451  laser_scan_viz->enablePoints(true);
452  laser_scan_viz->enableLine(true);
453  laser_scan_viz->enableSurface(true);
454  laser_scan_viz->setSurfaceColor(
457 
458  laser_scan_viz->setName("laser_scan_viz");
459 
460  scene->insert(laser_scan_viz);
461  this->m_win->unlockAccess3DScene();
462  this->m_win->forceRepaint();
463  }
464 
465  // max distance disk - textMessage
466  if (this->m_win && this->m_win_manager && params.ICP_max_distance > 0)
467  {
470 
472  5, -m_offset_y_search_disk, mrpt::format("ICP Edges search radius"),
474  /* unique_index = */ m_text_index_search_disk);
475  }
476 
477  this->m_time_logger.leave("CICPCriteriaERD::Visuals");
478  MRPT_END;
479 }
480 template <class GRAPH_T>
482 {
483  MRPT_START;
484  this->m_time_logger.enter("CICPCriteriaERD::Visuals");
485  using namespace mrpt::opengl;
486  using namespace mrpt::utils;
487  using namespace mrpt::math;
488  using namespace mrpt::poses;
490 
491  // update ICP_max_distance Disk
492  if (this->m_win && params.ICP_max_distance > 0)
493  {
494  COpenGLScene::Ptr scene = this->m_win->get3DSceneAndLock();
495 
496  CRenderizable::Ptr obj = scene->getByName("ICP_max_distance");
497  CDisk::Ptr disk_obj = std::dynamic_pointer_cast<CDisk>(obj);
498 
499  disk_obj->setPose(this->m_graph->nodes[this->m_graph->nodeCount() - 1]);
500 
501  this->m_win->unlockAccess3DScene();
502  this->m_win->forceRepaint();
503  }
504 
505  // update laser scan visual
506  if (this->m_win && params.visualize_laser_scans &&
508  {
509  COpenGLScene::Ptr scene = this->m_win->get3DSceneAndLock();
510 
511  CRenderizable::Ptr obj = scene->getByName("laser_scan_viz");
512  CPlanarLaserScan::Ptr laser_scan_viz =
513  std::dynamic_pointer_cast<CPlanarLaserScan>(obj);
514 
515  // if fake 2D exists use it
517  {
518  laser_scan_viz->setScan(*m_fake_laser_scan2D);
519  }
520  else
521  {
522  laser_scan_viz->setScan(*m_last_laser_scan2D);
523  }
524 
525  // set the pose of the laser scan
527  this->m_graph->nodes.find(this->m_graph->nodeCount() - 1);
528  if (search != this->m_graph->nodes.end())
529  {
530  laser_scan_viz->setPose(
531  this->m_graph->nodes[this->m_graph->nodeCount() - 1]);
532  // put the laser scan *underneath* the graph, so that you can still
533  // visualize the loop closures with the nodes ahead
534  laser_scan_viz->setPose(
535  CPose3D(
536  laser_scan_viz->getPoseX(), laser_scan_viz->getPoseY(),
537  -0.15, DEG2RAD(laser_scan_viz->getPoseYaw()),
538  DEG2RAD(laser_scan_viz->getPosePitch()),
539  DEG2RAD(laser_scan_viz->getPoseRoll())));
540  }
541 
542  this->m_win->unlockAccess3DScene();
543  this->m_win->forceRepaint();
544  }
545 
546  this->m_time_logger.leave("CICPCriteriaERD::Visuals");
547  MRPT_END;
548 }
549 
550 template <class GRAPH_T>
552  std::string viz_flag, int sleep_time /* = 500 milliseconds */)
553 {
554  MRPT_START;
555  using namespace mrpt::utils;
556  using namespace mrpt;
557 
558  this->logFmt(
559  LVL_ERROR,
560  "Cannot toggle visibility of specified object.\n "
561  "Make sure that the corresponding visualization flag ( %s "
562  ") is set to true in the .ini file.\n",
563  viz_flag.c_str());
564  std::this_thread::sleep_for(std::chrono::milliseconds(sleep_time));
565 
566  MRPT_END;
567 }
568 
569 template <class GRAPH_T>
571 {
572  MRPT_START;
573  using namespace mrpt::utils;
574  parent_t::loadParams(source_fname);
575 
576  params.loadFromConfigFileName(
577  source_fname, "EdgeRegistrationDeciderParameters");
578  this->logFmt(LVL_DEBUG, "Successfully loaded parameters. ");
579 
580  // set the logging level if given by the user
581  CConfigFile source(source_fname);
582  int min_verbosity_level = source.read_int(
583  "EdgeRegistrationDeciderParameters", "class_verbosity", 1, false);
584  this->setMinLoggingLevel(VerbosityLevel(min_verbosity_level));
585 
586  MRPT_END;
587 }
588 template <class GRAPH_T>
590 {
591  MRPT_START;
593  params.dumpToConsole();
594 
595  MRPT_END;
596 }
597 
598 template <class GRAPH_T>
600  std::string* report_str) const
601 {
602  MRPT_START;
603  using namespace std;
604 
605  const std::string report_sep(2, '\n');
606  const std::string header_sep(80, '#');
607 
608  // Report on graph
609  stringstream class_props_ss;
610  class_props_ss << "ICP Goodness-based Registration Procedure Summary: "
611  << std::endl;
612  class_props_ss << header_sep << std::endl;
613 
614  // time and output logging
615  const std::string time_res = this->m_time_logger.getStatsAsText();
616  const std::string output_res = this->getLogAsString();
617 
618  // merge the individual reports
619  report_str->clear();
620  parent_t::getDescriptiveReport(report_str);
621 
622  *report_str += class_props_ss.str();
623  *report_str += report_sep;
624 
625  *report_str += time_res;
626  *report_str += report_sep;
627 
628  *report_str += output_res;
629  *report_str += report_sep;
630 
631  MRPT_END;
632 }
633 
634 // TParameter
635 // //////////////////////////////////
636 
637 template <class GRAPH_T>
639  : decider(d), keystroke_laser_scans("l"), has_read_config(false)
640 {
641 }
642 
643 template <class GRAPH_T>
645 {
646 }
647 
648 template <class GRAPH_T>
650  mrpt::utils::CStream& out) const
651 {
652  MRPT_START;
653 
654  out.printf(
655  "------------------[ Goodness-based ICP Edge Registration "
656  "]------------------\n");
657  out.printf(
658  "ICP goodness threshold = %.2f%% \n",
659  ICP_goodness_thresh * 100);
660  out.printf("ICP max radius for edge search = %.2f\n", ICP_max_distance);
661  out.printf("Min. node difference for LC = %lu\n", LC_min_nodeid_diff);
662  out.printf("Visualize laser scans = %d\n", visualize_laser_scans);
663  out.printf(
664  "3DScans Image Directory = %s\n",
665  scans_img_external_dir.c_str());
666 
667  MRPT_END;
668 }
669 template <class GRAPH_T>
671  const mrpt::utils::CConfigFileBase& source, const std::string& section)
672 {
673  MRPT_START;
674 
675  LC_min_nodeid_diff = source.read_int(
676  "GeneralConfiguration", "LC_min_nodeid_diff", 30, false);
677  ICP_max_distance =
678  source.read_double(section, "ICP_max_distance", 10, false);
679  ICP_goodness_thresh =
680  source.read_double(section, "ICP_goodness_thresh", 0.75, false);
681  visualize_laser_scans = source.read_bool(
682  "VisualizationParameters", "visualize_laser_scans", true, false);
683  scans_img_external_dir = source.read_string(
684  section, "scan_images_external_directory", "./", false);
685 
686  has_read_config = true;
687 
688  MRPT_END;
689 }
690 }
691 }
692 } // end of namespaces
693 
694 #endif /* end of include guard: CICPCRITERIAERD_IMPL_H */
virtual void notifyOfWindowEvents(const std::map< std::string, bool > &events_occurred)
Get a list of the window events that happened since the last call.
virtual void loadParams(const std::string &source_fname)
Fetch the latest observation that the current instance received (most probably during a call to the u...
void unlockAccess3DScene()
Unlocks the access to the internal 3D scene.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
mrpt::gui::CDisplayWindow3D * m_win
Window to use.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void notifyOfWindowEvents(const std::map< std::string, bool > &events_occurred)
Get a list of the window events that happened since the last call.
virtual void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
mrpt::opengl::COpenGLScene::Ptr & get3DSceneAndLock()
Gets a reference to the smart shared pointer that holds the internal scene (carefuly read introductio...
void dumpVisibilityErrorMsg(std::string viz_flag, int sleep_time=500)
This class allows loading and storing values and vectors of different types from ".ini" files easily.
Definition: CConfigFile.h:35
void getICPEdge(const mrpt::obs::CObservation2DRangeScan &from, const mrpt::obs::CObservation2DRangeScan &to, constraint_t *rel_edge, const mrpt::poses::CPose2D *initial_pose=nullptr, mrpt::slam::CICP::TReturnInfo *icp_info=nullptr)
Align the 2D range scans provided and fill the potential edge that can transform the one into the oth...
void checkRegistrationCondition2D(const std::set< mrpt::utils::TNodeID > &nodes_set)
static const std::string header_sep
Separator string to be used in debugging messages.
GRAPH_T::constraint_t constraint_t
Handy typedefs.
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement, as from a time-of-flight range camera or any other RGBD sensor.
std::shared_ptr< CObservation3DRangeScan > Ptr
bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation)
Generic method for fetching the incremental action/observation readings from the calling function...
std::shared_ptr< CRenderizable > Ptr
Definition: CRenderizable.h:45
mrpt::graphslam::CWindowObserver * m_win_observer
CWindowObserver object for monitoring various visual-oriented events.
STL namespace.
size_t m_last_total_num_nodes
Keep track of the total number of registered nodes since the last time class method was called...
const Scalar * const_iterator
Definition: eigen_plugins.h:27
mrpt::obs::CObservation2DRangeScan::Ptr m_last_laser_scan2D
mrpt::utils::TColor m_search_disk_color
see Constructor for initialization
void registerKeystroke(const std::string key_str, const std::string key_desc)
Make new keystrokes available in the help message box.
void addTextMessage(const double x, const double y, const std::string &text, const mrpt::utils::TColorf &color=mrpt::utils::TColorf(1.0, 1.0, 1.0), const size_t unique_index=0)
Wrapper around the CDisplayWindow3D::addTextMessage method, so that the user does not have to specify...
std::shared_ptr< CObservation2DRangeScan > Ptr
mrpt::obs::CObservation3DRangeScan::Ptr m_last_laser_scan3D
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
void toggleLaserScansVisualization()
togle the LaserScans visualization on and off
This class allows loading and storing values and vectors of different types from a configuration text...
mrpt::graphslam::CWindowManager * m_win_manager
Pointer to the CWindowManager object used to store visuals-related instances.
float goodness
A goodness measure for the alignment, it is a [0,1] range indicator of percentage of correspondences...
Definition: CICP.h:202
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:19
std::map< mrpt::utils::TNodeID, mrpt::obs::CObservation2DRangeScan::Ptr > m_nodes_to_laser_scans2D
uint64_t TNodeID
The type for node IDs in graphs of different types.
virtual void initializeVisuals()
Initialize visual objects in CDisplayWindow (e.g.
#define MRPT_END
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
std::string getStatsAsText(const size_t column_width=80) const
Dump all stats to a multi-line text string.
A planar disk in the XY plane.
Definition: CDisk.h:33
void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
std::shared_ptr< CPlanarLaserScan > Ptr
virtual void registerNewEdge(const mrpt::utils::TNodeID &from, const mrpt::utils::TNodeID &to, const constraint_t &rel_edge)
Register a new constraint/edge in the current graph.
This namespace contains representation of robot actions and observations.
This object renders a 2D laser scan by means of three elements: the points, the line along end-points...
std::shared_ptr< CSensoryFrame > Ptr
Definition: CSensoryFrame.h:56
uint64_t TNodeID
The type for node IDs in graphs of different types.
Definition: types_simple.h:49
virtual void initializeLoggers(const std::string &name)
Initialize the COutputLogger, CTimeLogger instances given the name of the decider/optimizer at hand...
std::shared_ptr< CObservation > Ptr
Definition: CObservation.h:43
GRAPH_T * m_graph
Pointer to the graph that is under construction.
#define DEG2RAD
unsigned short nIterations
The number of executed iterations until convergence.
Definition: CICP.h:199
GLsizei const GLchar ** string
Definition: glext.h:4101
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
void dumpToTextStream(mrpt::utils::CStream &out) const
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
mrpt::utils::TColor m_laser_scans_color
see Constructor for initialization
std::map< std::string, int > m_edge_types_to_nums
void forceRepaint()
Repaints the window.
#define MRPT_START
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void registerNewEdge(const mrpt::utils::TNodeID &from, const mrpt::utils::TNodeID &to, const constraint_t &rel_edge)
Register a new constraint/edge in the current graph.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section)
This method load the options from a ".ini"-like file or memory-stored string list.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
std::shared_ptr< CActionCollection > Ptr
mrpt::utils::CTimeLogger m_time_logger
Time logger instance.
virtual void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
bool convert3DTo2DRangeScan(mrpt::obs::CObservation3DRangeScan::Ptr &scan3D_in, mrpt::obs::CObservation2DRangeScan::Ptr *scan2D_out=nullptr)
Wrapper around the CObservation3DRangeScan::convertTo2DScan corresponding method. ...
virtual void updateVisuals()
Update the relevant visual features in CDisplayWindow.
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
Definition: CObject.h:103
std::shared_ptr< COpenGLScene > Ptr
Definition: COpenGLScene.h:62
The ICP algorithm return information.
Definition: CICP.h:195
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
void printParams() const
Print the problem parameters - relevant to the decider/optimizer to the screen in a unified/compact w...
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
A RGB color - floats in the range [0,1].
Definition: TColor.h:78
double leave(const char *func_name)
End of a named section.
Definition: CTimeLogger.h:123
void getNearbyNodesOf(std::set< mrpt::utils::TNodeID > *nodes_set, const mrpt::utils::TNodeID &cur_nodeID, double distance)
Get a list of the nodeIDs whose position is within a certain distance to the specified nodeID...
mrpt::obs::CObservation2DRangeScan::Ptr m_fake_laser_scan2D
CRenderizable & setPose(const mrpt::poses::CPose3D &o)
Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)
T absDiff(const T &lhs, const T &rhs)
Absolute difference between two numbers.
GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
std::shared_ptr< CDisk > Ptr
Definition: CDisk.h:35
void updateVisuals()
Update the relevant visual features in CDisplayWindow.
void getEdgesStats(std::map< std::string, int > *edge_types_to_num) const
Fill the given map with the type of registered edges as well as the corresponding number of registrat...
std::map< mrpt::utils::TNodeID, mrpt::obs::CObservation3DRangeScan::Ptr > m_nodes_to_laser_scans3D
void enter(const char *func_name)
Start of a named section.
Definition: CTimeLogger.h:117
#define MRPT_LOG_DEBUG_STREAM(__CONTENTS)
#define ASSERTMSG_(f, __ERROR_MSG)
GLenum const GLfloat * params
Definition: glext.h:3534
void setScan(const mrpt::obs::CObservation2DRangeScan &scan)
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
Definition: geometry.cpp:1885
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
Definition: CStream.cpp:597
void loadParams(const std::string &source_fname)
Fetch the latest observation that the current instance received (most probably during a call to the u...
void assignTextMessageParameters(double *offset_y, int *text_index)
Assign the next available offset_y and text_index for the textMessage under construction.
void initializeVisuals()
Initialize visual objects in CDisplayWindow (e.g.
void checkRegistrationCondition3D(const std::set< mrpt::utils::TNodeID > &nodes_set)



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019