15 namespace mrpt {
namespace srba {
18 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
27 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
30 this->rba_state.clear();
33 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
38 max_optimize_depth ( 4 ),
40 min_obs_to_loop_closure ( 6 ),
42 optimize_new_edges_alone (true),
43 use_robust_kernel ( false ),
44 use_robust_kernel_stage1 ( false ),
47 max_error_per_obs_to_stop ( 1e-6 ),
50 min_error_reduction_ratio_to_relinearize ( 0.01 ),
51 numeric_jacobians ( false ),
52 feedback_user_iteration(NULL),
53 compute_condition_number(false),
59 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
77 cov_recovery = source.
read_enum(section,
"cov_recovery", cov_recovery);
81 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
86 out.
write(section,
"max_tree_depth",max_tree_depth, 30, 30,
"Maximum depth of all spanning trees");
87 out.
write(section,
"max_optimize_depth",max_optimize_depth, 30, 30,
"Max. local optimization distance");
88 out.
write(section,
"submap_size",static_cast<uint64_t>(submap_size), 30, 30,
"Max. local optimization distance");
89 out.
write(section,
"min_obs_to_loop_closure",static_cast<uint64_t>(min_obs_to_loop_closure), 30, 30,
"Min. num. of covisible observations to add a loop closure edge");
92 out.
write(section,
"optimize_new_edges_alone",optimize_new_edges_alone, 30, 30,
"Optimize new edges alone before optimizing the entire local area?");
93 out.
write(section,
"use_robust_kernel",use_robust_kernel, 30, 30,
"Use pseudo-Huber kernel?");
94 out.
write(section,
"use_robust_kernel_stage1",use_robust_kernel_stage1, 30, 30,
"Use pseudo-Huber kernel at stage1?");
95 out.
write(section,
"kernel_param",kernel_param, 30, 30,
"robust kernel parameter");
96 out.
write(section,
"max_rho",max_rho, 30, 30,
"Lev-Marq optimization: maximum rho value to stop");
97 out.
write(section,
"max_lambda",max_lambda, 30, 30,
"Lev-Marq optimization: maximum lambda to stop");
98 out.
write(section,
"max_iters",static_cast<uint64_t>(max_iters), 30, 30,
"Max. iterations for optimization");
99 out.
write(section,
"max_error_per_obs_to_stop",max_error_per_obs_to_stop, 30, 30,
"Another criterion for stopping optimization");
105 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
107 double &out_mean_degree,
108 double &out_std_degree,
109 double &out_max_degree)
const
115 const size_t nKFs = keyframes.size();
117 std::vector<size_t> degs;
120 for(
size_t i=0;i<nKFs;i++)
121 degs.push_back( keyframes[i].adjacent_k2k_edges.size() );
130 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
136 const std::deque<k2k_edge_t*> & id1_adj = keyframes[id1].adjacent_k2k_edges;
138 for (
size_t i=0;i<id1_adj.size();i++)
virtual void edge_creation_policy(const TKeyFrameID new_kf_id, const typename traits_t::new_kf_observations_t &obs, std::vector< TNewEdgeInfo > &new_k2k_edge_ids)
Implements the edge-creation policy, by default depending on "parameters.edge_creation_policy" if the...
ENUMTYPE read_enum(const std::string §ion, const std::string &name, const ENUMTYPE &defaultValue, bool failIfNotFound=false) const
Reads an "enum" value, where the value in the config file can be either a numerical value or the symb...
#define ASSERT_BELOW_(__A, __B)
This file implements several operations that operate element-wise on individual or pairs of container...
The sub-map method introduced in the ICRA2013 paper.
This class allows loading and storing values and vectors of different types from a configuration text...
A helper class that can convert an enum value into its textual representation, and viceversa...
CONTAINER::Scalar maximum(const CONTAINER &v)
RbaEngine()
Default constructor.
void compute_all_node_degrees(double &out_mean_degree, double &out_std_degree, double &out_max_degree) const
Computes stats on the degree (# of adjacent nodes) of all the nodes in the graph. ...
virtual void saveToConfigFile(mrpt::utils::CConfigFileBase &out, const std::string §ion) const
See docs of mrpt::utils::CLoadableOptions.
#define MRPT_LOAD_CONFIG_VAR(variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void meanAndStd(const VECTORLIKE &v, double &out_mean, double &out_std, bool unbiased=true)
Computes the standard deviation of a vector.
virtual void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion)
See docs of mrpt::utils::CLoadableOptions.
bool are_keyframes_connected(const TKeyFrameID id1, const TKeyFrameID id2) const
Returns true if the pair of KFs are connected thru a kf2kf edge, no matter the direction of the edge...
void write(const std::string §ion, const std::string &name, double value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string())
Approximate covariances of landmarks as the inverse of the hessian diagonal blocks.
void clear()
Reset the entire problem to an empty state (automatically called at construction) ...
V getTheOtherFromPair2(const V one, const K2K_EDGE &p)
For usage with K2K_EDGE = typename kf2kf_pose_traits
::k2k_edge_t.
uint64_t TKeyFrameID
Numeric IDs for key-frames (KFs)