Loading...
Searching...
No Matches
Line3.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
* -------------------------------------------------------------------------- */
// \callgraph
#pragma once
#include <gtsam/geometry/Rot3.h>
#include <gtsam/geometry/Pose3.h>
namespace gtsam {
class Line3;
GTSAM_EXPORT Line3 transformTo(const Pose3 &wTc, const Line3 &wL,
OptionalJacobian<4, 6> Dpose = boost::none,
OptionalJacobian<4, 4> Dline = boost::none);
class GTSAM_EXPORT Line3 {
private:
Rot3 R_; // Rotation of line about x and y in world frame
double a_, b_; // Intersection of line with the world x-y plane rotated by R_
// Also the closest point on line to origin
public:
enum { dimension = 4 };
Line3() :
a_(0), b_(0) {}
Line3(const Rot3 &R, const double a, const double b) :
R_(R), a_(a), b_(b) {}
Line3 retract(const Vector4 &v,
OptionalJacobian<4, 4> Dp = boost::none,
OptionalJacobian<4, 4> Dv = boost::none) const;
Vector4 localCoordinates(const Line3 &q,
OptionalJacobian<4, 4> Dp = boost::none,
OptionalJacobian<4, 4> Dq = boost::none) const;
void print(const std::string &s = "") const;
bool equals(const Line3 &l2, double tol = 10e-9) const;
Unit3 project(OptionalJacobian<2, 4> Dline = boost::none) const;
Point3 point(double distance = 0) const;
inline Rot3 R() const {
return R_;
}
inline double a() const {
return a_;
}
inline double b() const {
return b_;
}
friend Line3 transformTo(const Pose3 &wTc, const Line3 &wL,
OptionalJacobian<4, 6> Dpose,
OptionalJacobian<4, 4> Dline);
};
template<>
struct traits<Line3> : public internal::Manifold<Line3> {};
template<>
struct traits<const Line3> : public internal::Manifold<Line3> {};
}
Pose3.h
3D Pose
Rot3.h
3D rotation represented as a rotation matrix or quaternion
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:156
gtsam::Point3
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:36
gtsam::transformTo
Line3 transformTo(const Pose3 &wTc, const Line3 &wL, OptionalJacobian< 4, 6 > Dpose, OptionalJacobian< 4, 4 > Dline)
Transform a line from world to camera frame.
Definition Line3.cpp:94
gtsam::project
Point2_ project(const Point3_ &p_cam)
Expression version of PinholeBase::Project.
Definition expressions.h:131
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::internal::Manifold
Both ManifoldTraits and Testable.
Definition Manifold.h:120
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::equals
Template to create a binary predicate.
Definition Testable.h:111
gtsam::Line3
A 3D line (R,a,b) : (Rot3,Scalar,Scalar).
Definition Line3.h:44
gtsam::Line3::R
Rot3 R() const
Return the rotation of the line.
Definition Line3.h:123
gtsam::Line3::Line3
Line3()
Default constructor is the Z axis.
Definition Line3.h:53
gtsam::Line3::Line3
Line3(const Rot3 &R, const double a, const double b)
Constructor for general line from (R, a, b).
Definition Line3.h:57
gtsam::Line3::b
double b() const
Return the y-coordinate of the intersection of the line with the xy plane.
Definition Line3.h:137
gtsam::Line3::a
double a() const
Return the x-coordinate of the intersection of the line with the xy plane.
Definition Line3.h:130
gtsam::Pose3
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:37
gtsam::Rot3
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Definition Rot3.h:58
gtsam::Unit3
Represents a 3D point on a unit sphere.
Definition Unit3.h:43