23 template <
class my_graph_t>
31 const typename my_graph_t::global_poses_t& real_poses,
34 typename my_graph_t::edge_t RelativePose =
35 real_poses.find(to)->second - real_poses.find(from)->second;
36 graph.insertEdge(from, to, RelativePose);
41 my_graph_t& graph,
size_t N_VERTEX = 50,
double DIST_THRES = 7,
42 double NODES_XY_MAX = 20)
45 typename my_graph_t::global_poses_t real_node_poses;
58 for (
TNodeID j = 0; j < N_VERTEX; j++)
60 static double ang = 2 *
M_PI / N_VERTEX;
61 const double R = NODES_XY_MAX + 2 * (j % 2 ? 1 : -1);
62 CPose2D p(
R * cos(ang * j),
R * sin(ang * j), ang);
65 real_node_poses[j] =
p;
72 for (
TNodeID i = 0; i < N_VERTEX; i++)
74 for (
TNodeID j = i + 1; j < N_VERTEX; j++)
76 if (real_node_poses[i].distanceTo(real_node_poses[j]) <
78 addEdge(i, j, real_node_poses, graph);
83 addEdge(0, N_VERTEX / 2, real_node_poses, graph);
89 const my_graph_t graph_GT = graph;
94 itEdge != graph.edges.end(); ++itEdge)
95 itEdge->second +=
typename my_graph_t::edge_t(
107 itNode != graph.nodes.end(); ++itNode)
108 if (itNode->first != graph.root)
109 itNode->second +=
typename my_graph_t::edge_t::type_value(