diff --git a/examples/tests/testPlanarSLAMExample_lago.cpp b/examples/tests/testPlanarSLAMExample_lago.cpp index d717efe2c..bfe8aeda1 100644 --- a/examples/tests/testPlanarSLAMExample_lago.cpp +++ b/examples/tests/testPlanarSLAMExample_lago.cpp @@ -99,6 +99,20 @@ double computeThetaToRoot(const Key nodeKey, PredecessorMap& tree, return nodeTheta; } +/* + * This function computes the cumulative orientation (without wrapping) + * from each node to the root (root has zero orientation) + */ +map computeThetasToRoot(vector& keysInBinary, map& deltaThetaMap, PredecessorMap& tree){ + + map thetaToRootMap; + BOOST_FOREACH(const Key& nodeKey, keysInBinary){ + double nodeTheta = computeThetaToRoot(nodeKey, tree, deltaThetaMap, thetaToRootMap); + thetaToRootMap.insert(std::pair(nodeKey, nodeTheta)); + } + return thetaToRootMap; +} + void getSymbolicSubgraph(vector& keysInBinary, vector& spanningTree, vector& chords, map& deltaThetaMap, PredecessorMap& tree, const NonlinearFactorGraph& g){ // Get keys for which you want the orientation @@ -138,20 +152,6 @@ void getSymbolicSubgraph(vector& keysInBinary, vector& spanningTree } } -/* - * This function computes the cumulative orientation (without wrapping) - * from each node to the root (root has zero orientation) - */ -map computeThetasToRoot(vector& keysInBinary, map& deltaThetaMap, PredecessorMap& tree){ - - map thetaToRootMap; - BOOST_FOREACH(const Key& nodeKey, keysInBinary){ - double nodeTheta = computeThetaToRoot(nodeKey, tree, deltaThetaMap, thetaToRootMap); - thetaToRootMap.insert(std::pair(nodeKey, nodeTheta)); - } - return thetaToRootMap; -} - /* * Linear factor graph with regularized orientation measurements */