27 #include <gtsam/dllexport.h> 29 #include <boost/optional.hpp> 30 #include <boost/random/mersenne_twister.hpp> 31 #include <boost/serialization/nvp.hpp> 36 #include <tbb/mutex.h> 47 mutable boost::optional<Matrix32> B_;
48 mutable boost::optional<Matrix62> H_B_;
51 mutable tbb::mutex B_mutex_;
69 explicit Unit3(
const Vector3& p) :
74 Unit3(
double x,
double y,
double z) :
81 explicit Unit3(
const Point2& p,
double f) : p_(p.x(), p.y(), f) {
101 static Unit3 Random(boost::mt19937 & rng);
108 friend std::ostream& operator<<(std::ostream& os,
const Unit3& pair);
111 void print(
const std::string& s = std::string())
const;
131 Matrix3 skew()
const;
162 return Unit3(p_.cross(q.p_));
167 return point3().
cross(q);
176 inline static size_t Dim() {
181 inline size_t dim()
const {
194 Vector2 localCoordinates(
const Unit3& s)
const;
203 friend class boost::serialization::access;
204 template<
class ARCHIVE>
205 void serialize(ARCHIVE & ar,
const unsigned int ) {
206 ar & BOOST_SERIALIZATION_NVP(p_);
212 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
bool equals(const Unit3 &s, double tol=1e-9) const
The equals function with tolerance.
Definition: Unit3.h:114
Base class and basic functions for Manifold types.
double dot(const V1 &a, const V2 &b)
Dot product.
Definition: Vector.h:162
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
Unit3(const Unit3 &u)
Copy constructor.
Definition: Unit3.h:86
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
equals with a tolerance
Definition: Matrix.h:82
static size_t Dim()
Dimensionality of tangent space = 2 DOF.
Definition: Unit3.h:176
Point3 cross(const Point3 &q) const
Cross-product w Point3.
Definition: Unit3.h:166
Unit3(double x, double y, double z)
Construct from x,y,z.
Definition: Unit3.h:74
Unit3(const Vector3 &p)
Construct from point.
Definition: Unit3.h:69
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Use the exponential map to retract.
Definition: Unit3.h:186
CoordinatesMode
Definition: Unit3.h:185
Unit3 cross(const Unit3 &q) const
Cross-product between two Unit3s.
Definition: Unit3.h:161
Represents a 3D point on a unit sphere.
Definition: Unit3.h:42
size_t dim() const
Dimensionality of tangent space = 2 DOF.
Definition: Unit3.h:181
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Unit3 & operator=(const Unit3 &u)
Copy assignment.
Definition: Unit3.h:91
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
typedef and functions to augment Eigen's MatrixXd
Point3 cross(const Point3 &q, OptionalJacobian< 3, 3 > H_p=boost::none, OptionalJacobian< 3, 3 > H_q=boost::none) const
cross product
Definition: Point3.cpp:49
Unit3(const Point2 &p, double f)
Construct from 2D point in plane at focal length f Unit3(p,1) can be viewed as normalized homogeneous...
Definition: Unit3.h:81
Point2 operator *(double s, const Point2 &p)
multiply with scalar
Definition: Point2.h:170
Unit3()
Default constructor.
Definition: Unit3.h:64