fixed key in unit test

release/4.3a0
Luca 2014-05-02 16:05:08 -04:00
parent c1650f72fd
commit 9f499d2257
1 changed files with 4 additions and 2 deletions

View File

@ -19,10 +19,12 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <gtsam/inference/Symbol.h>
#include <gtsam/base/TestableAssertions.h> #include <gtsam/base/TestableAssertions.h>
#include <gtsam/inference/Symbol.h> #include <gtsam/inference/Symbol.h>
#include <gtsam/slam/dataset.h> #include <gtsam/slam/dataset.h>
using namespace gtsam::symbol_shorthand;
using namespace std; using namespace std;
using namespace gtsam; using namespace gtsam;
@ -176,7 +178,7 @@ TEST( dataSet, writeBALfromValues_Dubrovnik){
value.insert(poseKey, pose); value.insert(poseKey, pose);
} }
for(size_t j=0; j < readData.number_tracks(); j++){ // for each point for(size_t j=0; j < readData.number_tracks(); j++){ // for each point
Key pointKey = symbol('l',j); Key pointKey = P(j);
Point3 point = poseChange.transform_from( readData.tracks[j].p ); Point3 point = poseChange.transform_from( readData.tracks[j].p );
value.insert(pointKey, point); value.insert(pointKey, point);
} }
@ -208,7 +210,7 @@ TEST( dataSet, writeBALfromValues_Dubrovnik){
EXPECT(assert_equal(expectedPose,actualPose, 1e-7)); EXPECT(assert_equal(expectedPose,actualPose, 1e-7));
Point3 expectedPoint = track0.p; Point3 expectedPoint = track0.p;
Key pointKey = symbol('l',0); Key pointKey = P(0);
Point3 actualPoint = value.at<Point3>(pointKey); Point3 actualPoint = value.at<Point3>(pointKey);
EXPECT(assert_equal(expectedPoint,actualPoint, 1e-6)); EXPECT(assert_equal(expectedPoint,actualPoint, 1e-6));
} }