Main MRPT website > C++ reference
MRPT logo
optimize_local_area.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-2015, 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 #pragma once
11 
12 namespace mrpt { namespace srba {
13 
14 template <class KF2KF_POSE_TYPE,class LM_TYPE,class OBS_TYPE,class RBA_OPTIONS>
16  const TKeyFrameID root_id,
17  const unsigned int win_size,
18  TOptimizeExtraOutputInfo & out_info,
19  const TOptimizeLocalAreaParams &params,
20  const std::vector<size_t> & observation_indices_to_optimize
21  )
22 {
23  m_profiler.enter("optimize_local_area");
24 
25  // 1st) Find list of edges to optimize:
26  // --------------------------------------------------
27  m_profiler.enter("optimize_local_area.find_edges2opt");
28 
29  VisitorOptimizeLocalArea my_visitor(this->rba_state,params);
30 
31  this->bfs_visitor(
32  root_id, // Starting keyframe
33  win_size, // max. depth
34  true, // Use prebuilt spanning trees for speed-up
35  my_visitor, //kf_visitor,
36  my_visitor, //feat_visitor,
37  my_visitor, //k2k_edge_visitor,
38  my_visitor //k2f_edge_visitor
39  );
40 
41  m_profiler.leave("optimize_local_area.find_edges2opt");
42 
43  // 2nd) Optimize them:
44  // -------------------------------
45  if (!my_visitor.k2k_edges_to_optimize.empty() || !my_visitor.lm_IDs_to_optimize.empty())
46  {
47  this->optimize_edges(my_visitor.k2k_edges_to_optimize,my_visitor.lm_IDs_to_optimize, out_info, observation_indices_to_optimize);
48  }
49 
50  m_profiler.leave("optimize_local_area");
51 }
52 
53 
54 
55 } } // end NS
void optimize_local_area(const TKeyFrameID root_id, const unsigned int win_size, TOptimizeExtraOutputInfo &out_info, const TOptimizeLocalAreaParams &params=TOptimizeLocalAreaParams(), const std::vector< size_t > &observation_indices_to_optimize=std::vector< size_t >())
Runs least-squares optimization for all the unknowns within a given topological distance to a given K...
Parameters for optimize_local_area()
Definition: RbaEngine.h:190
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Aux visitor struct, used in optimize_local_area()
Definition: RbaEngine.h:513
All the information returned by the local area optimizer.
Definition: RbaEngine.h:117
uint64_t TKeyFrameID
Numeric IDs for key-frames (KFs)
Definition: srba_types.h:31



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.0 SVN: at Sun Sep 13 03:55:12 UTC 2015