Go to the documentation of this file.
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);
67 my_graph_t read_graph;
71 EXPECT_EQ(read_graph.edges.size(), graph.edges.size());
72 EXPECT_EQ(read_graph.nodes.size(), graph.nodes.size());
76 for (it1 = read_graph.edges.begin(), it2 = graph.edges.begin();
77 it1 != read_graph.edges.end(); ++it1, ++it2)
79 EXPECT_EQ(it1->first, it2->first);
81 0, (it1->second.getPoseMean().getAsVectorVal() -
82 it2->second.getPoseMean().getAsVectorVal())
97 for (
int seed = 1; seed < 5; seed++)
106 test_graph_bin_serialization();
111 for (
int seed = 1; seed < 5; seed++)
120 test_graph_bin_serialization();
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource.
const Scalar * const_iterator
Output information for mrpt::graphslam::optimize_graph_spa_levmarq()
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
size_t num_iters
The number of LM iterations executed.
static void create_ring_path(my_graph_t &graph, size_t N_VERTEX=50, double DIST_THRES=7, double NODES_XY_MAX=20)
void randomize(const uint32_t seed)
Initialize the PRNG from the given random seed.
double final_total_sq_error
The sum of all the squared errors for every constraint involved in the problem.
void optimize_graph_spa_levmarq(GRAPH_T &graph, TResultInfoSpaLevMarq &out_info, const std::set< mrpt::graphs::TNodeID > *in_nodes_to_optimize=nullptr, const mrpt::system::TParametersDouble &extra_params=mrpt::system::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...
TEST_F(GraphSlamLevMarqTester2D, OptimizeSampleRingPath)
Abstract graph and tree data structures, plus generic graph algorithms.
This CStream derived class allow using a memory buffer as a CStream.
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream,...
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
This base provides a set of functions for maths stuff.
A namespace of pseudo-random numbers generators of diferent distributions.
void test_graph_bin_serialization()
GLenum const GLfloat * params
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |