Removed SLAM namespace from testGraph
parent
a641f599f6
commit
2de44904ad
|
@ -108,3 +108,5 @@ namespace gtsam {
|
||||||
|
|
||||||
|
|
||||||
} // namespace gtsam
|
} // namespace gtsam
|
||||||
|
|
||||||
|
#include <gtsam/inference/graph-inl.h>
|
||||||
|
|
|
@ -16,8 +16,10 @@
|
||||||
* @brief unit test for graph-inl.h
|
* @brief unit test for graph-inl.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtsam/slam/pose2SLAM.h>
|
#include <gtsam/slam/BetweenFactor.h>
|
||||||
#include <gtsam/inference/graph-inl.h>
|
#include <gtsam/nonlinear/NonlinearFactorGraph.h>
|
||||||
|
#include <gtsam/inference/graph.h>
|
||||||
|
#include <gtsam/geometry/Pose2.h>
|
||||||
|
|
||||||
#include <CppUnitLite/TestHarness.h>
|
#include <CppUnitLite/TestHarness.h>
|
||||||
|
|
||||||
|
@ -75,13 +77,13 @@ TEST( Graph, predecessorMap2Graph )
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST( Graph, composePoses )
|
TEST( Graph, composePoses )
|
||||||
{
|
{
|
||||||
pose2SLAM::Graph graph;
|
NonlinearFactorGraph graph;
|
||||||
SharedNoiseModel cov = noiseModel::Unit::Create(3);
|
SharedNoiseModel cov = noiseModel::Unit::Create(3);
|
||||||
Pose2 p1(1.0, 2.0, 0.3), p2(4.0, 5.0, 0.6), p3(7.0, 8.0, 0.9), p4(2.0, 2.0, 2.9);
|
Pose2 p1(1.0, 2.0, 0.3), p2(4.0, 5.0, 0.6), p3(7.0, 8.0, 0.9), p4(2.0, 2.0, 2.9);
|
||||||
Pose2 p12=p1.between(p2), p23=p2.between(p3), p43=p4.between(p3);
|
Pose2 p12=p1.between(p2), p23=p2.between(p3), p43=p4.between(p3);
|
||||||
graph.addRelativePose(1,2, p12, cov);
|
graph.add(BetweenFactor<Pose2>(1,2, p12, cov));
|
||||||
graph.addRelativePose(2,3, p23, cov);
|
graph.add(BetweenFactor<Pose2>(2,3, p23, cov));
|
||||||
graph.addRelativePose(4,3, p43, cov);
|
graph.add(BetweenFactor<Pose2>(4,3, p43, cov));
|
||||||
|
|
||||||
PredecessorMap<Key> tree;
|
PredecessorMap<Key> tree;
|
||||||
tree.insert(1,2);
|
tree.insert(1,2);
|
||||||
|
@ -91,8 +93,7 @@ TEST( Graph, composePoses )
|
||||||
|
|
||||||
Pose2 rootPose = p2;
|
Pose2 rootPose = p2;
|
||||||
|
|
||||||
boost::shared_ptr<Values> actual = composePoses<pose2SLAM::Graph, pose2SLAM::Odometry,
|
boost::shared_ptr<Values> actual = composePoses<NonlinearFactorGraph, BetweenFactor<Pose2>, Pose2, Key> (graph, tree, rootPose);
|
||||||
Pose2, Key> (graph, tree, rootPose);
|
|
||||||
|
|
||||||
Values expected;
|
Values expected;
|
||||||
expected.insert(1, p1);
|
expected.insert(1, p1);
|
||||||
|
|
Loading…
Reference in New Issue