2010-01-23 08:57:54 +08:00
|
|
|
class Pose2SLAMOptimizer {
|
|
|
|
Pose2SLAMOptimizer(string dataset_name);
|
2010-01-23 12:46:00 +08:00
|
|
|
void print(string s) const;
|
2010-01-23 08:57:54 +08:00
|
|
|
void update(Vector x) const;
|
2010-01-23 11:49:05 +08:00
|
|
|
Vector optimize() const;
|
|
|
|
double error() const;
|
|
|
|
Matrix a1() const;
|
|
|
|
Matrix a2() const;
|
|
|
|
Vector b1() const;
|
|
|
|
Vector b2() const;
|
2010-01-23 08:57:54 +08:00
|
|
|
};
|
|
|
|
|
2010-01-23 01:36:57 +08:00
|
|
|
class SharedGaussian {
|
|
|
|
SharedGaussian(Matrix covariance);
|
|
|
|
SharedGaussian(Vector sigmas);
|
|
|
|
};
|
|
|
|
|
|
|
|
class SharedDiagonal {
|
|
|
|
SharedDiagonal(Vector sigmas);
|
|
|
|
};
|
|
|
|
|
2009-11-12 06:45:08 +08:00
|
|
|
class Ordering {
|
|
|
|
Ordering();
|
2010-01-05 02:07:24 +08:00
|
|
|
Ordering(string key);
|
|
|
|
Ordering subtract(const Ordering& keys) const;
|
2009-11-12 06:45:08 +08:00
|
|
|
void push_back(string s);
|
|
|
|
void print(string s) const;
|
2010-01-05 02:07:24 +08:00
|
|
|
bool equals(const Ordering& ord, double tol) const;
|
2009-12-12 05:34:08 +08:00
|
|
|
void unique ();
|
2009-12-12 20:53:39 +08:00
|
|
|
void reverse ();
|
2009-11-12 06:45:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SymbolicFactor{
|
2009-11-24 03:45:09 +08:00
|
|
|
SymbolicFactor(const Ordering& keys);
|
|
|
|
void print(string s) const;
|
2009-11-12 06:45:08 +08:00
|
|
|
};
|
|
|
|
|
2009-10-15 04:39:59 +08:00
|
|
|
class VectorConfig {
|
|
|
|
VectorConfig();
|
2009-08-22 06:23:24 +08:00
|
|
|
Vector get(string name) const;
|
|
|
|
bool contains(string name) const;
|
|
|
|
size_t size() const;
|
|
|
|
void insert(string name, Vector val);
|
2009-11-12 06:45:08 +08:00
|
|
|
void print(string s) const;
|
2009-10-15 04:39:59 +08:00
|
|
|
bool equals(const VectorConfig& expected, double tol) const;
|
2009-08-22 06:23:24 +08:00
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2009-11-13 00:16:32 +08:00
|
|
|
class GaussianFactor {
|
|
|
|
GaussianFactor(string key1,
|
2009-08-22 06:23:24 +08:00
|
|
|
Matrix A1,
|
2009-11-05 11:26:04 +08:00
|
|
|
Vector b_in,
|
2010-01-23 01:36:57 +08:00
|
|
|
const SharedDiagonal& model);
|
2009-11-13 00:16:32 +08:00
|
|
|
GaussianFactor(string key1,
|
2009-08-22 06:23:24 +08:00
|
|
|
Matrix A1,
|
|
|
|
string key2,
|
|
|
|
Matrix A2,
|
2009-11-05 11:26:04 +08:00
|
|
|
Vector b_in,
|
2010-01-23 01:36:57 +08:00
|
|
|
const SharedDiagonal& model);
|
2009-11-13 00:16:32 +08:00
|
|
|
GaussianFactor(string key1,
|
2009-08-22 06:23:24 +08:00
|
|
|
Matrix A1,
|
|
|
|
string key2,
|
|
|
|
Matrix A2,
|
|
|
|
string key3,
|
|
|
|
Matrix A3,
|
2009-11-05 11:26:04 +08:00
|
|
|
Vector b_in,
|
2010-01-23 01:36:57 +08:00
|
|
|
const SharedDiagonal& model);
|
2009-08-22 06:23:24 +08:00
|
|
|
bool empty() const;
|
|
|
|
Vector get_b() const;
|
|
|
|
Matrix get_A(string key) const;
|
2009-10-15 04:39:59 +08:00
|
|
|
double error(const VectorConfig& c) const;
|
2009-08-22 06:23:24 +08:00
|
|
|
bool involves(string key) const;
|
2009-11-12 06:45:08 +08:00
|
|
|
void print(string s) const;
|
2009-11-13 00:16:32 +08:00
|
|
|
bool equals(const GaussianFactor& lf, double tol) const;
|
2009-08-22 06:23:24 +08:00
|
|
|
pair<Matrix,Vector> matrix(const Ordering& ordering) const;
|
|
|
|
};
|
|
|
|
|
2010-01-23 01:36:57 +08:00
|
|
|
class GaussianFactorSet {
|
|
|
|
GaussianFactorSet();
|
|
|
|
void push_back(GaussianFactor* factor);
|
|
|
|
};
|
|
|
|
|
2009-11-13 00:41:18 +08:00
|
|
|
class GaussianConditional {
|
|
|
|
GaussianConditional();
|
|
|
|
GaussianConditional(string key,
|
2009-11-05 11:26:04 +08:00
|
|
|
Vector d,
|
|
|
|
Matrix R,
|
2009-11-11 15:14:13 +08:00
|
|
|
Vector sigmas);
|
2009-11-13 00:41:18 +08:00
|
|
|
GaussianConditional(string key,
|
2009-11-05 11:26:04 +08:00
|
|
|
Vector d,
|
2009-08-22 06:23:24 +08:00
|
|
|
Matrix R,
|
|
|
|
string name1,
|
2009-11-05 11:26:04 +08:00
|
|
|
Matrix S,
|
2009-11-11 15:14:13 +08:00
|
|
|
Vector sigmas);
|
2009-11-13 00:41:18 +08:00
|
|
|
GaussianConditional(string key,
|
2009-11-05 11:26:04 +08:00
|
|
|
Vector d,
|
2009-08-22 06:23:24 +08:00
|
|
|
Matrix R,
|
|
|
|
string name1,
|
|
|
|
Matrix S,
|
|
|
|
string name2,
|
2009-11-05 11:26:04 +08:00
|
|
|
Matrix T,
|
2009-11-11 15:14:13 +08:00
|
|
|
Vector sigmas);
|
2009-11-12 06:45:08 +08:00
|
|
|
void print(string s) const;
|
2009-10-15 04:39:59 +08:00
|
|
|
Vector solve(const VectorConfig& x);
|
2009-08-22 06:23:24 +08:00
|
|
|
void add(string key, Matrix S);
|
2009-11-13 00:41:18 +08:00
|
|
|
bool equals(const GaussianConditional &cg, double tol) const;
|
2009-08-22 06:23:24 +08:00
|
|
|
};
|
|
|
|
|
2009-11-01 03:53:20 +08:00
|
|
|
class GaussianBayesNet {
|
|
|
|
GaussianBayesNet();
|
2009-11-12 06:45:08 +08:00
|
|
|
void print(string s) const;
|
|
|
|
bool equals(const GaussianBayesNet& cbn, double tol) const;
|
2009-11-13 00:41:18 +08:00
|
|
|
void push_back(GaussianConditional* conditional);
|
|
|
|
void push_front(GaussianConditional* conditional);
|
2009-08-22 06:23:24 +08:00
|
|
|
};
|
|
|
|
|
2009-11-13 00:16:32 +08:00
|
|
|
class GaussianFactorGraph {
|
|
|
|
GaussianFactorGraph();
|
2009-08-22 06:23:24 +08:00
|
|
|
|
|
|
|
size_t size() const;
|
2009-11-13 00:16:32 +08:00
|
|
|
void push_back(GaussianFactor* ptr_f);
|
2009-10-15 04:39:59 +08:00
|
|
|
double error(const VectorConfig& c) const;
|
|
|
|
double probPrime(const VectorConfig& c) const;
|
2009-11-12 06:45:08 +08:00
|
|
|
void print(string s) const;
|
2009-11-13 00:16:32 +08:00
|
|
|
bool equals(const GaussianFactorGraph& lfgraph, double tol) const;
|
2009-12-02 00:01:29 +08:00
|
|
|
void combine(const GaussianFactorGraph& lfg);
|
2009-08-22 06:23:24 +08:00
|
|
|
|
2009-11-13 00:41:18 +08:00
|
|
|
GaussianConditional* eliminateOne(string key);
|
2009-11-11 15:14:13 +08:00
|
|
|
GaussianBayesNet* eliminate_(const Ordering& ordering);
|
2009-11-12 06:45:08 +08:00
|
|
|
VectorConfig* optimize_(const Ordering& ordering);
|
2009-08-22 06:23:24 +08:00
|
|
|
pair<Matrix,Vector> matrix(const Ordering& ordering) const;
|
2009-11-06 13:43:03 +08:00
|
|
|
Matrix sparse(const Ordering& ordering) const;
|
2009-12-28 20:37:34 +08:00
|
|
|
VectorConfig* steepestDescent_(const VectorConfig& x0) const;
|
2009-12-13 11:02:14 +08:00
|
|
|
VectorConfig* conjugateGradientDescent_(const VectorConfig& x0) const;
|
2009-08-22 06:23:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Point2 {
|
|
|
|
Point2();
|
|
|
|
Point2(double x, double y);
|
|
|
|
double x();
|
|
|
|
double y();
|
2009-11-12 06:45:08 +08:00
|
|
|
void print(string s) const;
|
2009-08-22 06:23:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Point3 {
|
|
|
|
Point3();
|
|
|
|
Point3(double x, double y, double z);
|
|
|
|
Point3(Vector v);
|
|
|
|
Vector vector() const;
|
|
|
|
double x();
|
|
|
|
double y();
|
|
|
|
double z();
|
2009-11-12 06:45:08 +08:00
|
|
|
void print(string s) const;
|
2009-08-22 06:23:24 +08:00
|
|
|
};
|
|
|
|
|
2010-01-05 02:07:24 +08:00
|
|
|
class Pose2 {
|
|
|
|
Pose2();
|
|
|
|
Pose2(const Pose2& pose);
|
|
|
|
Pose2(double x, double y, double theta);
|
|
|
|
Pose2(double theta, const Point2& t);
|
|
|
|
Pose2(const Rot2& r, const Point2& t);
|
|
|
|
void print(string s) const;
|
|
|
|
bool equals(const Pose2& pose, double tol) const;
|
|
|
|
double x() const;
|
|
|
|
double y() const;
|
|
|
|
double theta() const;
|
2010-01-11 05:53:38 +08:00
|
|
|
size_t dim() const;
|
|
|
|
Pose2 expmap(const Vector& v) const;
|
|
|
|
Vector logmap(const Pose2& pose) const;
|
2010-01-05 02:07:24 +08:00
|
|
|
Point2 t() const;
|
|
|
|
Rot2 r() const;
|
2009-12-10 03:55:25 +08:00
|
|
|
};
|