12 namespace mrpt {
namespace srba {
14 template <
class KF2KF_POSE_TYPE,
class LM_TYPE,
class OBS_TYPE,
class RBA_OPTIONS>
20 m_profiler.enter(
"eval_overall_squared_error");
27 vector<bool> base_ids(rba_state.keyframes.size(),
false);
28 map<TKeyFrameID, set<TKeyFrameID> > ob_pairs;
32 #ifdef SRBA_WORKAROUND_MSVC9_DEQUE_BUG
34 const TKeyFrameID base_id = (*itO)->feat_rel_pos->id_frame_base;
37 const TKeyFrameID base_id = itO->feat_rel_pos->id_frame_base;
40 base_ids[base_id] =
true;
41 ob_pairs[ std::min(obs_id,base_id) ].insert( std::max(obs_id,base_id) );
54 m_profiler.enter(
"eval_overall_squared_error.complete_ST");
57 this->create_complete_spanning_tree(root,span_tree);
59 m_profiler.leave(
"eval_overall_squared_error.complete_ST");
68 while (it_have!=it_have_end && it_want!=it_want_end)
70 if (it_have->first<*it_want)
72 else if (*it_want<it_have->first)
79 all_rel_poses[root][*it_want] = it_have->second;
80 all_rel_poses[*it_want][root] =
pose_flag_t(-it_have->second.pose, it_have->second.updated);
95 #ifdef SRBA_WORKAROUND_MSVC9_DEQUE_BUG
97 const TKeyFrameID base_id = (*itO)->feat_rel_pos->id_frame_base;
101 const TKeyFrameID base_id = itO->feat_rel_pos->id_frame_base;
106 pose_t const * base_pose_wrt_observer=NULL;
109 if (base_id==obs_frame_id)
111 base_pose_wrt_observer = &aux_null_pose;
117 ASSERT_( itPoseMap_for_base_id != all_rel_poses.
end() )
120 ASSERT_( itRelPose != itPoseMap_for_base_id->second.end() )
122 base_pose_wrt_observer = &itRelPose->second.pose;
127 RBA_OPTIONS::sensor_pose_on_robot_t::robot2sensor( *base_pose_wrt_observer, base_pose_wrt_sensor, this->parameters.sensor_pose );
134 sensor_model_t::observe_error(
137 base_pose_wrt_sensor,
139 this->parameters.sensor
142 sqerr+= delta.squaredNorm();
145 m_profiler.leave(
"eval_overall_squared_error");
A STL-like container which looks and behaves (almost exactly) like a std::map<> but is implemented as...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Typedefs for determining whether the result of combining a KF pose (+) a sensor pose leads to a SE(2)...
vec_t::const_iterator const_iterator
iterator find(const size_t i)
Constant-time find, returning an iterator to the pair or to end() if not found (that is...
const Scalar * const_iterator
kf2kf_pose_traits_t::pose_flag_t pose_flag_t
KF2KF_POSE_TYPE::pose_t pose_t
The type of relative poses (e.g. mrpt::poses::CPose3D)
landmark_traits_t::TRelativeLandmarkPos TRelativeLandmarkPos
One landmark position (relative to its base KF)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
kf2kf_pose_traits_t::frameid2pose_map_t frameid2pose_map_t
A partial specialization of CArrayNumeric for double numbers.
double eval_overall_squared_error() const
Evaluates the quality of the overall map/landmark estimations, by computing the sum of the squared er...
uint64_t TKeyFrameID
Numeric IDs for key-frames (KFs)