22 #include <gtsam/base/VectorSpace.h> 23 #include <boost/serialization/nvp.hpp> 38 enum { dimension = 3 };
44 uL_(0), uR_(0), v_(0) {
49 uL_(uL), uR_(uR), v_(v) {
54 uL_(v(0)), uR_(v(1)), v_(v(2)) {}
61 void print(
const std::string& s =
"")
const;
65 return (fabs(uL_ - q.uL_) < tol && fabs(uR_ - q.uR_) < tol
66 && fabs(v_ - q.v_) < tol);
90 return StereoPoint2(uL_ + b.uL_, uR_ + b.uR_, v_ + b.v_);
95 return StereoPoint2(uL_ - b.uL_, uR_ - b.uR_, v_ - b.v_);
106 inline double uL()
const {
return uL_;}
109 inline double uR()
const {
return uR_;}
112 inline double v()
const {
return v_;}
116 return Vector3(uL_, uR_, v_);
134 inline Vector localCoordinates(
const StereoPoint2& t2)
const {
return Logmap(between(t2)); }
135 inline StereoPoint2 retract(
const Vector& v)
const {
return compose(Expmap(v)); }
141 GTSAM_EXPORT
friend std::ostream &operator<<(std::ostream &os,
const StereoPoint2& p);
150 friend class boost::serialization::access;
151 template<
class ARCHIVE>
152 void serialize(ARCHIVE & ar,
const unsigned int ) {
153 ar & BOOST_SERIALIZATION_NVP(uL_);
154 ar & BOOST_SERIALIZATION_NVP(uR_);
155 ar & BOOST_SERIALIZATION_NVP(v_);
double v() const
get v
Definition: StereoPoint2.h:112
double uR() const
get uR
Definition: StereoPoint2.h:109
VectorSpace provides both Testable and VectorSpaceTraits.
Definition: VectorSpace.h:207
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:140
StereoPoint2(const Vector3 &v)
construct from 3D vector
Definition: StereoPoint2.h:53
Definition: StereoPoint2.h:32
BinarySumExpression< T > operator-(const Expression< T > &e1, const Expression< T > &e2)
Construct an expression that subtracts one expression from another.
Definition: Expression.h:279
bool operator==(const Matrix &A, const Matrix &B)
equality is just equal_with_abs_tol 1e-9
Definition: Matrix.h:102
BinarySumExpression< T > operator+(const Expression< T > &e1, const Expression< T > &e2)
Construct an expression that sums two input expressions of the same type T The type T must be a vecto...
Definition: Expression.h:273
static StereoPoint2 identity()
identity
Definition: StereoPoint2.h:74
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
StereoPoint2 operator-() const
inverse
Definition: StereoPoint2.h:79
Point2 right() const
convenient function to get a Point2 from the right image
Definition: StereoPoint2.h:125
bool equals(const StereoPoint2 &q, double tol=1e-9) const
equals
Definition: StereoPoint2.h:64
StereoPoint2()
default constructor
Definition: StereoPoint2.h:43
Point2 point2() const
convenient function to get a Point2 from the left image
Definition: StereoPoint2.h:120
Vector3 vector() const
convert to vector
Definition: StereoPoint2.h:115
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
double uL() const
get uL
Definition: StereoPoint2.h:106
StereoPoint2(double uL, double uR, double v)
constructor
Definition: StereoPoint2.h:48