11 #include <gtsam/geometry/Unit3.h> 32 Base(base), E_(direction().skew() * rotation().matrix()) {
39 return Vector3(p.
x(), p.
y(), 1);
47 Base(
Rot3(),
Unit3(1, 0, 0)), E_(direction().skew()) {
52 Base(aRb, aTb), E_(direction().skew() * rotation().matrix()) {
65 template<
typename Engine>
78 void print(
const std::string& s =
"")
const;
82 return rotation().equals(other.
rotation(), tol)
83 && direction().equals(other.
direction(), tol);
91 using Base::dimension;
97 return Base::retract(v);
102 return Base::localCoordinates(other);
131 return rotation().unrotate(direction());
163 double error(
const Vector3& vA,
const Vector3& vB,
172 GTSAM_EXPORT
friend std::ostream& operator <<(std::ostream& os,
const EssentialMatrix& E);
185 friend class boost::serialization::access;
186 template<
class ARCHIVE>
187 void serialize(ARCHIVE & ar,
const unsigned int ) {
188 ar & BOOST_SERIALIZATION_NVP(first);
189 ar & BOOST_SERIALIZATION_NVP(second);
191 ar & boost::serialization::make_nvp(
"E11", E_(0,0));
192 ar & boost::serialization::make_nvp(
"E12", E_(0,1));
193 ar & boost::serialization::make_nvp(
"E13", E_(0,2));
194 ar & boost::serialization::make_nvp(
"E21", E_(1,0));
195 ar & boost::serialization::make_nvp(
"E22", E_(1,1));
196 ar & boost::serialization::make_nvp(
"E23", E_(1,2));
197 ar & boost::serialization::make_nvp(
"E31", E_(2,0));
198 ar & boost::serialization::make_nvp(
"E32", E_(2,1));
199 ar & boost::serialization::make_nvp(
"E33", E_(2,2));
const Matrix3 & matrix() const
Return 3*3 matrix representation.
Definition: EssentialMatrix.h:120
TangentVector localCoordinates(const EssentialMatrix &other) const
Compute the coordinates in the tangent space.
Definition: EssentialMatrix.h:101
Represents a 3D point on a unit sphere.
Definition: Unit3.h:42
static EssentialMatrix Random(Engine &rng)
Random, using Rot3::Random and Unit3::Random.
Definition: EssentialMatrix.h:66
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:140
static Rot3 Random(boost::mt19937 &rng)
Random, generates a random axis, then random angle [-p,pi].
Definition: Rot3.cpp:37
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
EssentialMatrix rotate(const Rot3 &cRb, OptionalJacobian< 5, 5 > HE=boost::none, OptionalJacobian< 5, 3 > HR=boost::none) const
Given essential matrix E in camera frame B, convert to body frame C.
Definition: EssentialMatrix.cpp:73
double y() const
get y
Definition: Point2.h:106
istream & operator>>(istream &inputStream, Matrix &destinationMatrix)
Read a matrix from an input stream, such as a file.
Definition: Matrix.cpp:168
const Unit3 & direction() const
Direction.
Definition: EssentialMatrix.h:115
const Unit3 & epipole_a() const
Return epipole in image_a , as Unit3 to allow for infinity.
Definition: EssentialMatrix.h:125
static Unit3 Random(boost::mt19937 &rng)
Random direction, using boost::uniform_on_sphere.
Definition: Unit3.cpp:56
bool equals(const EssentialMatrix &other, double tol=1e-8) const
assert equality up to a tolerance
Definition: EssentialMatrix.h:81
Base class and basic functions for Manifold types.
EssentialMatrix retract(const TangentVector &v) const
Retract delta to manifold.
Definition: EssentialMatrix.h:96
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
const Rot3 & rotation() const
Rotation.
Definition: EssentialMatrix.h:110
An essential matrix is like a Pose3, except with translation up to scale It is named after the 3*3 ma...
Definition: EssentialMatrix.h:24
friend EssentialMatrix operator*(const Rot3 &cRb, const EssentialMatrix &E)
Given essential matrix E in camera frame B, convert to body frame C.
Definition: EssentialMatrix.h:158
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
static Vector3 Homogeneous(const Point2 &p)
Static function to convert Point2 to homogeneous coordinates.
Definition: EssentialMatrix.h:38
EssentialMatrix()
Default constructor.
Definition: EssentialMatrix.h:46
double x() const
get x
Definition: Point2.h:103
EssentialMatrix(const Rot3 &aRb, const Unit3 &aTb)
Construct from rotation and translation.
Definition: EssentialMatrix.h:51
Helper class to construct the product manifold of two other manifolds, M1 and M2 Assumes nothing exce...
Definition: Manifold.h:175
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Unit3 epipole_b() const
Return epipole in image_b, as Unit3 to allow for infinity.
Definition: EssentialMatrix.h:130