24 using namespace gtsam;
33 return Unit3(Tb - Ta);
46 bool success =
readBAL(filename, db);
47 if (!success)
throw runtime_error(
"Could not access file!");
58 poses, {{0, 1}, {0, 2}, {1, 2}});
61 for (
auto& unitTranslation : relativeTranslations) {
63 unitTranslation.measured()));
71 const double scale = 2.0;
102 auto relativeTranslations =
106 for (
auto& unitTranslation : relativeTranslations) {
108 unitTranslation.measured()));
141 poses, {{0, 1}, {1, 3}, {3, 0}});
144 for (
auto& unitTranslation : relativeTranslations) {
146 unitTranslation.measured()));
175 auto relativeTranslations =
179 for (
auto& unitTranslation : relativeTranslations) {
181 unitTranslation.measured()));
218 poses, {{0, 1}, {1, 2}, {1, 3}, {3, 0}});
221 for (
auto& unitTranslation : relativeTranslations) {
223 unitTranslation.measured()));
247 poses, {{0, 1}, {1, 2}, {2, 0}});
250 for (
auto& unitTranslation : relativeTranslations) {
252 unitTranslation.measured()));
Define the structure for SfM data.
static int runAllTests(TestResult &result)
void insert(Key j, const Value &val)
const Point3 & translation(OptionalJacobian< 3, 6 > Hself=boost::none) const
get translation
NonlinearFactorGraph graph
Values run(const double scale=1.0) const
Build and optimize factor graph.
const Pose3 & pose() const
return pose, constant version
TEST(TranslationRecovery, BAL)
string findExampleDataFile(const string &name)
Unit3 GetDirectionFromPoses(const Values &poses, const BinaryMeasurement< Unit3 > &unitTranslation)
Represents a 3D point on a unit sphere.
const ValueType at(Key j) const
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
std::vector< SfmCamera > cameras
Set of cameras.
NonlinearFactorGraph buildGraph() const
Build the factor graph to do the optimization.
#define EXPECT_LONGS_EQUAL(expected, actual)
def SimulateMeasurements(gt_poses, graph_edges)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics scale
Recovering translations in an epipolar graph when rotations are given.
static const CalibratedCamera camera(kDefaultPose)
utility functions for loading datasets
bool readBAL(const string &filename, SfmData &data)
This function parses a "Bundle Adjustment in the Large" (BAL) file and stores the data into a SfmData...