12 #include <gtest/gtest.h> 22 template <
class my_graph_t>
24 public ::testing::Test
35 const my_graph_t graph_initial = graph;
43 params[
"max_iterations"] = 1000;
48 graph, levmarq_info,
nullptr,
params);
66 my_graph_t read_graph;
70 EXPECT_EQ(read_graph.edges.size(), graph.edges.size());
71 EXPECT_EQ(read_graph.nodes.size(), graph.nodes.size());
75 for (it1 = read_graph.edges.begin(), it2 = graph.edges.begin();
76 it1 != read_graph.edges.end(); ++it1, ++it2)
78 EXPECT_EQ(it1->first, it2->first);
80 0, (it1->second.getPoseMean().getAsVectorVal() -
81 it2->second.getPoseMean().getAsVectorVal())
96 for (
int seed = 1; seed < 5; seed++)
105 test_graph_bin_serialization();
110 for (
int seed = 1; seed < 5; seed++)
119 test_graph_bin_serialization();
A namespace of pseudo-random numbers genrators of diferent distributions.
void test_graph_bin_serialization()
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
uint64_t Seek(uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource...
Abstract graph and tree data structures, plus generic graph algorithms.
void randomize(const uint32_t seed)
Initialize the PRNG from the given random seed.
size_t num_iters
The number of LM iterations executed.
const Scalar * const_iterator
TEST_F(GraphSlamLevMarqTester2D, OptimizeSampleRingPath)
This base provides a set of functions for maths stuff.
This CStream derived class allow using a memory buffer as a CStream.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void optimize_graph_spa_levmarq(GRAPH_T &graph, TResultInfoSpaLevMarq &out_info, const std::set< mrpt::utils::TNodeID > *in_nodes_to_optimize=nullptr, const mrpt::utils::TParametersDouble &extra_params=mrpt::utils::TParametersDouble(), typename graphslam_traits< GRAPH_T >::TFunctorFeedback functor_feedback=typename graphslam_traits< GRAPH_T >::TFunctorFeedback())
Optimize a graph of pose constraints using the Sparse Pose Adjustment (SPA) sparse representation and...
Output information for mrpt::graphslam::optimize_graph_spa_levmarq()
static void create_ring_path(my_graph_t &graph, size_t N_VERTEX=50, double DIST_THRES=7, double NODES_XY_MAX=20)
GraphSlamLevMarqTester< CNetworkOfPoses2D > GraphSlamLevMarqTester2D
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
GLenum const GLfloat * params
GraphSlamLevMarqTester< CNetworkOfPoses3D > GraphSlamLevMarqTester3D
double final_total_sq_error
The sum of all the squared errors for every constraint involved in the problem.