make timing compiles
parent
c816c33272
commit
3ebcfc5ce0
|
@ -19,7 +19,7 @@
|
|||
#include "timeLinearize.h"
|
||||
#include <gtsam/3rdparty/ceres/example.h>
|
||||
#include <gtsam/nonlinear/AdaptAutoDiff.h>
|
||||
#include <gtsam_unstable/nonlinear/ExpressionFactor.h>
|
||||
#include <gtsam/nonlinear/ExpressionFactor.h>
|
||||
#include <gtsam/slam/GeneralSFMFactor.h>
|
||||
#include <gtsam/geometry/PinholeCamera.h>
|
||||
#include <gtsam/geometry/Cal3Bundler.h>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* @date October 3, 2014
|
||||
*/
|
||||
|
||||
#include <gtsam_unstable/slam/expressions.h>
|
||||
#include <gtsam_unstable/nonlinear/ExpressionFactor.h>
|
||||
#include <gtsam/slam/expressions.h>
|
||||
#include <gtsam/nonlinear/ExpressionFactor.h>
|
||||
#include <gtsam/slam/ProjectionFactor.h>
|
||||
#include <gtsam/slam/GeneralSFMFactor.h>
|
||||
#include <gtsam/geometry/Pose3.h>
|
||||
|
@ -32,7 +32,7 @@ using namespace gtsam;
|
|||
boost::shared_ptr<Cal3_S2> fixedK(new Cal3_S2());
|
||||
|
||||
Point2 myProject(const Pose3& pose, const Point3& point,
|
||||
boost::optional<Matrix26&> H1, boost::optional<Matrix23&> H2) {
|
||||
OptionalJacobian<2,6> H1, OptionalJacobian<2,3> H2) {
|
||||
PinholeCamera<Cal3_S2> camera(pose, *fixedK);
|
||||
return camera.project(point, H1, H2, boost::none);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* @date October 3, 2014
|
||||
*/
|
||||
|
||||
#include <gtsam_unstable/slam/expressions.h>
|
||||
#include <gtsam_unstable/nonlinear/ExpressionFactor.h>
|
||||
#include <gtsam/slam/expressions.h>
|
||||
#include <gtsam/nonlinear/ExpressionFactor.h>
|
||||
#include "timeLinearize.h"
|
||||
|
||||
using namespace std;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* @date October 3, 2014
|
||||
*/
|
||||
|
||||
#include <gtsam_unstable/slam/expressions.h>
|
||||
#include <gtsam_unstable/nonlinear/ExpressionFactor.h>
|
||||
#include <gtsam/slam/expressions.h>
|
||||
#include <gtsam/nonlinear/ExpressionFactor.h>
|
||||
#include <gtsam/nonlinear/NonlinearFactorGraph.h>
|
||||
#include <gtsam/linear/GaussianFactorGraph.h>
|
||||
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
* @author Richard Roberts
|
||||
*/
|
||||
|
||||
#include <gtsam/base/timing.h>
|
||||
#include <gtsam/slam/dataset.h>
|
||||
#include <gtsam/geometry/Pose2.h>
|
||||
#include <gtsam/slam/PriorFactor.h>
|
||||
#include <gtsam/slam/BetweenFactor.h>
|
||||
#include <gtsam/slam/BearingRangeFactor.h>
|
||||
#include <gtsam/geometry/Pose2.h>
|
||||
#include <gtsam/inference/Symbol.h>
|
||||
#include <gtsam/nonlinear/ISAM2.h>
|
||||
#include <gtsam/nonlinear/Marginals.h>
|
||||
#include <gtsam/base/timing.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <boost/archive/binary_oarchive.hpp>
|
||||
|
@ -39,20 +39,20 @@ typedef NoiseModelFactor1<Pose> NM1;
|
|||
typedef NoiseModelFactor2<Pose,Pose> NM2;
|
||||
typedef BearingRangeFactor<Pose,Point2> BR;
|
||||
|
||||
GTSAM_VALUE_EXPORT(Value);
|
||||
GTSAM_VALUE_EXPORT(Pose);
|
||||
GTSAM_VALUE_EXPORT(NonlinearFactor);
|
||||
GTSAM_VALUE_EXPORT(NoiseModelFactor);
|
||||
GTSAM_VALUE_EXPORT(NM1);
|
||||
GTSAM_VALUE_EXPORT(NM2);
|
||||
GTSAM_VALUE_EXPORT(BetweenFactor<Pose>);
|
||||
GTSAM_VALUE_EXPORT(PriorFactor<Pose>);
|
||||
GTSAM_VALUE_EXPORT(BR);
|
||||
GTSAM_VALUE_EXPORT(noiseModel::Base);
|
||||
GTSAM_VALUE_EXPORT(noiseModel::Isotropic);
|
||||
GTSAM_VALUE_EXPORT(noiseModel::Gaussian);
|
||||
GTSAM_VALUE_EXPORT(noiseModel::Diagonal);
|
||||
GTSAM_VALUE_EXPORT(noiseModel::Unit);
|
||||
//GTSAM_VALUE_EXPORT(Value);
|
||||
//GTSAM_VALUE_EXPORT(Pose);
|
||||
//GTSAM_VALUE_EXPORT(NonlinearFactor);
|
||||
//GTSAM_VALUE_EXPORT(NoiseModelFactor);
|
||||
//GTSAM_VALUE_EXPORT(NM1);
|
||||
//GTSAM_VALUE_EXPORT(NM2);
|
||||
//GTSAM_VALUE_EXPORT(BetweenFactor<Pose>);
|
||||
//GTSAM_VALUE_EXPORT(PriorFactor<Pose>);
|
||||
//GTSAM_VALUE_EXPORT(BR);
|
||||
//GTSAM_VALUE_EXPORT(noiseModel::Base);
|
||||
//GTSAM_VALUE_EXPORT(noiseModel::Isotropic);
|
||||
//GTSAM_VALUE_EXPORT(noiseModel::Gaussian);
|
||||
//GTSAM_VALUE_EXPORT(noiseModel::Diagonal);
|
||||
//GTSAM_VALUE_EXPORT(noiseModel::Unit);
|
||||
|
||||
double chi2_red(const gtsam::NonlinearFactorGraph& graph, const gtsam::Values& config) {
|
||||
// Compute degrees of freedom (observations - variables)
|
||||
|
@ -97,7 +97,7 @@ int main(int argc, char *argv[]) {
|
|||
// cout << "Initializing " << 0 << endl;
|
||||
newVariables.insert(0, Pose());
|
||||
// Add prior
|
||||
newFactors.add(PriorFactor<Pose>(0, Pose(), noiseModel::Unit::Create(Pose::Dim())));
|
||||
newFactors.add(PriorFactor<Pose>(0, Pose(), noiseModel::Unit::Create(3)));
|
||||
}
|
||||
while(nextMeasurement < measurements.size()) {
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ typedef Pose2 Pose;
|
|||
|
||||
typedef NoiseModelFactor1<Pose> NM1;
|
||||
typedef NoiseModelFactor2<Pose,Pose> NM2;
|
||||
noiseModel::Unit::shared_ptr model = noiseModel::Unit::Create(Pose::Dim());
|
||||
noiseModel::Unit::shared_ptr model = noiseModel::Unit::Create(3);
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
|
@ -61,10 +61,10 @@ int main(int argc, char *argv[]) {
|
|||
gttic_(Create_measurements);
|
||||
if(step == 0) {
|
||||
// Add prior
|
||||
newFactors.add(PriorFactor<Pose>(0, Pose(), noiseModel::Unit::Create(Pose::Dim())));
|
||||
newFactors.add(PriorFactor<Pose>(0, Pose(), noiseModel::Unit::Create(3)));
|
||||
newVariables.insert(0, Pose());
|
||||
} else {
|
||||
Vector eta = Vector::Random(Pose::Dim()) * 0.1;
|
||||
Vector eta = Vector::Random(3) * 0.1;
|
||||
Pose2 between = Pose().retract(eta);
|
||||
// Add between
|
||||
newFactors.add(BetweenFactor<Pose>(step-1, step, between, model));
|
||||
|
|
Loading…
Reference in New Issue