Loading...
Searching...
No Matches
Similarity2.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/base/Lie.h>
#include <gtsam/base/Manifold.h>
#include <gtsam/dllexport.h>
#include <gtsam/geometry/Point2.h>
#include <gtsam/geometry/Pose2.h>
#include <gtsam/geometry/Rot2.h>
namespace gtsam {
// Forward declarations
class Pose2;
class GTSAM_EXPORT Similarity2 : public LieGroup<Similarity2, 4> {
typedef Rot2 Rotation;
typedef Point2 Translation;
private:
Rot2 R_;
Point2 t_;
double s_;
public:
Similarity2();
Similarity2(double s);
Similarity2(const Rot2& R, const Point2& t, double s);
Similarity2(const Matrix2& R, const Vector2& t, double s);
Similarity2(const Matrix3& T);
bool equals(const Similarity2& sim, double tol) const;
bool operator==(const Similarity2& other) const;
void print(const std::string& s) const;
friend std::ostream& operator<<(std::ostream& os, const Similarity2& p);
static Similarity2 Identity();
Similarity2 operator*(const Similarity2& S) const;
Similarity2 inverse() const;
Point2 transformFrom(const Point2& p) const;
Pose2 transformFrom(const Pose2& T) const;
/* syntactic sugar for transformFrom */
Point2 operator*(const Point2& p) const;
static Similarity2 Align(const Point2Pairs& abPointPairs);
static Similarity2 Align(const Pose2Pairs& abPosePairs);
static Vector4 Logmap(const Similarity2& S, //
OptionalJacobian<4, 4> Hm = boost::none);
static Similarity2 Expmap(const Vector4& v, //
OptionalJacobian<4, 4> Hm = boost::none);
struct ChartAtOrigin {
static Similarity2 Retract(const Vector4& v,
ChartJacobian H = boost::none) {
return Similarity2::Expmap(v, H);
}
static Vector4 Local(const Similarity2& other,
ChartJacobian H = boost::none) {
return Similarity2::Logmap(other, H);
}
};
Matrix4 AdjointMap() const;
using LieGroup<Similarity2, 4>::inverse;
Matrix3 matrix() const;
Rot2 rotation() const { return R_; }
Point2 translation() const { return t_; }
double scale() const { return s_; }
inline static size_t Dim() { return 4; }
inline size_t dim() const { return 4; }
};
template <>
struct traits<Similarity2> : public internal::LieGroup<Similarity2> {};
template <>
struct traits<const Similarity2> : public internal::LieGroup<Similarity2> {};
} // namespace gtsam
Manifold.h
Base class and basic functions for Manifold types.
Lie.h
Base class and basic functions for Lie types.
Point2.h
2D Point
Pose2.h
2D Pose
Rot2.h
2D rotation
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::Point2
Vector2 Point2
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point2 to Vector2...
Definition Point2.h:27
gtsam::traits
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
gtsam::LieGroup
A CRTP helper class that implements Lie group methods Prerequisites: methods operator*,...
Definition Lie.h:37
gtsam::internal::LieGroup
Both LieGroupTraits and Testable.
Definition Lie.h:229
gtsam::OptionalJacobian
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition OptionalJacobian.h:41
gtsam::Pose2
A 2D pose (Point2,Rot2).
Definition Pose2.h:36
gtsam::Rot2
Rotation matrix NOTE: the angle theta is in radians unless explicitly stated.
Definition Rot2.h:36
gtsam::Similarity2
2D similarity transform
Definition Similarity2.h:35
gtsam::Similarity2::translation
Point2 translation() const
Return a GTSAM translation.
Definition Similarity2.h:180
gtsam::Similarity2::transformFrom
Point2 transformFrom(const Point2 &p) const
Action on a point p is s*(R*p+t).
Definition Similarity2.cpp:149
gtsam::Similarity2::Align
static Similarity2 Align(const Point2Pairs &abPointPairs)
Create Similarity2 by aligning at least two point pairs.
Definition Similarity2.cpp:164
gtsam::Similarity2::scale
double scale() const
Return the scale.
Definition Similarity2.h:183
gtsam::Similarity2::print
void print(const std::string &s) const
Print with optional string.
Definition Similarity2.cpp:129
gtsam::Similarity2::operator==
bool operator==(const Similarity2 &other) const
Exact equality.
Definition Similarity2.cpp:125
gtsam::Similarity2::Expmap
static Similarity2 Expmap(const Vector4 &v, OptionalJacobian< 4, 4 > Hm=boost::none)
Exponential map at the identity.
Definition Similarity2.cpp:214
gtsam::Similarity2::AdjointMap
Matrix4 AdjointMap() const
Project from one tangent space to another.
Definition Similarity2.cpp:225
gtsam::Similarity2::inverse
Similarity2 inverse() const
Return the inverse.
Definition Similarity2.cpp:143
gtsam::Similarity2::Dim
static size_t Dim()
Dimensionality of tangent space = 4 DOF - used to autodetect sizes.
Definition Similarity2.h:186
gtsam::Similarity2::Identity
static Similarity2 Identity()
Return an identity transform.
Definition Similarity2.cpp:137
gtsam::Similarity2::equals
bool equals(const Similarity2 &sim, double tol) const
Compare with tolerance.
Definition Similarity2.cpp:119
gtsam::Similarity2::matrix
Matrix3 matrix() const
Calculate 4*4 matrix group equivalent.
Definition Similarity2.cpp:235
gtsam::Similarity2::Logmap
static Vector4 Logmap(const Similarity2 &S, OptionalJacobian< 4, 4 > Hm=boost::none)
Log map at the identity .
Definition Similarity2.cpp:201
gtsam::Similarity2::rotation
Rot2 rotation() const
Return a GTSAM rotation.
Definition Similarity2.h:177
gtsam::Similarity2::operator*
Similarity2 operator*(const Similarity2 &S) const
Composition.
Definition Similarity2.cpp:139
gtsam::Similarity2::Similarity2
Similarity2()
Default constructor.
Definition Similarity2.cpp:104
gtsam::Similarity2::dim
size_t dim() const
Dimensionality of tangent space = 4 DOF.
Definition Similarity2.h:189
gtsam::Similarity2::ChartAtOrigin
Chart at the origin.
Definition Similarity2.h:153