24#include <gtsam/base/concepts.h>
27#include <gtsam/dllexport.h>
28#include <boost/serialization/nvp.hpp>
41 Key nearbyVariable()
const {
return j_;}
58 typedef Point3 Translation;
65 typedef Point2Vector MeasurementVector;
81 static Matrix26 Dpose(
const Point2& pn,
double d);
89 static Matrix23 Dpoint(
const Point2& pn,
double d,
const Matrix3& Rt);
105 static Pose3 LevelPose(
const Pose2& pose2,
double height);
145 virtual void print(
const std::string& s =
"PinholeBase")
const;
190 std::pair<Point2, bool> projectSafe(
const Point3& pw)
const;
210 static Point3 BackprojectFromCamera(
const Point2& p,
const double depth,
224 return std::make_pair(3, 5);
232 friend class boost::serialization::access;
233 template<
class Archive>
234 void serialize(Archive & ar,
const unsigned int ) {
235 ar & BOOST_SERIALIZATION_NVP(pose_);
285 static CalibratedCamera Level(
const Pose2& pose2,
double height);
295 static CalibratedCamera Lookat(
const Point3& eye,
const Point3& target,
326 void print(
const std::string& s =
"CalibratedCamera")
const override {
331 inline size_t dim()
const {
336 inline static size_t Dim() {
358 Matrix31 Dpoint_ddepth;
359 const Point3 point = BackprojectFromCamera(pn, depth,
360 Dresult_dp ? &Dpoint_dpn : 0,
361 Dresult_ddepth ? &Dpoint_ddepth : 0);
363 Matrix33 Dresult_dpoint;
366 Dresult_dp) ? &Dresult_dpoint : 0);
369 *Dresult_dp = Dresult_dpoint * Dpoint_dpn;
371 *Dresult_ddepth = Dresult_dpoint * Dpoint_ddepth;
384 return pose().
range(point, Dcamera, Dpoint);
394 return this->pose().
range(pose, Dcamera, Dpose);
405 return pose().
range(camera.
pose(), H1, H2);
416 friend class boost::serialization::access;
417 template<
class Archive>
418 void serialize(Archive & ar,
const unsigned int ) {
420 & boost::serialization::make_nvp(
"PinholeBase",
421 boost::serialization::base_object<PinholeBase>(*
this));
Base exception type that uses tbb_allocator if GTSAM is compiled with TBB.
Base class and basic functions for Manifold types.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:112
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
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
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:35
Point2_ project(const Point3_ &p_cam)
Expression version of PinholeBase::Project.
Definition: expressions.h:96
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Template to create a binary predicate.
Definition: Testable.h:111
Base exception type that uses tbb_allocator if GTSAM is compiled with TBB.
Definition: ThreadsafeException.h:42
Definition: BearingRange.h:39
Definition: BearingRange.h:193
Definition: CalibratedCamera.h:32
Definition: CalibratedCamera.h:52
PinholeBase()
Default constructor.
Definition: CalibratedCamera.h:123
virtual void print(const std::string &s="PinholeBase") const
print
Definition: CalibratedCamera.cpp:74
PinholeBase(const Pose3 &pose)
Constructor with pose.
Definition: CalibratedCamera.h:126
const Point3 & translation() const
get translation
Definition: CalibratedCamera.h:162
const Rot3 & rotation() const
get rotation
Definition: CalibratedCamera.h:157
Point2 Measurement
Some classes template on either PinholeCamera or StereoCamera, and this typedef informs those classes...
Definition: CalibratedCamera.h:64
const Pose3 & pose() const
return pose, constant version
Definition: CalibratedCamera.h:152
static std::pair< size_t, size_t > translationInterval()
Return the start and end indices (inclusive) of the translation component of the exponential map para...
Definition: CalibratedCamera.h:223
Rot3 Rotation
Pose Concept requirements.
Definition: CalibratedCamera.h:57
virtual ~PinholeBase()=default
Default destructor.
Definition: CalibratedCamera.h:247
Point3 backproject(const Point2 &pn, double depth, OptionalJacobian< 3, 6 > Dresult_dpose=boost::none, OptionalJacobian< 3, 2 > Dresult_dp=boost::none, OptionalJacobian< 3, 1 > Dresult_ddepth=boost::none) const
backproject a 2-dimensional point to a 3-dimensional point at given depth
Definition: CalibratedCamera.h:352
CalibratedCamera()
default constructor
Definition: CalibratedCamera.h:259
double range(const Pose3 &pose, OptionalJacobian< 1, 6 > Dcamera=boost::none, OptionalJacobian< 1, 6 > Dpose=boost::none) const
Calculate range to another pose.
Definition: CalibratedCamera.h:392
size_t dim() const
Definition: CalibratedCamera.h:331
CalibratedCamera(const Vector &v)
construct from vector
Definition: CalibratedCamera.h:303
virtual ~CalibratedCamera()
destructor
Definition: CalibratedCamera.h:312
static size_t Dim()
Definition: CalibratedCamera.h:336
double range(const CalibratedCamera &camera, OptionalJacobian< 1, 6 > H1=boost::none, OptionalJacobian< 1, 6 > H2=boost::none) const
Calculate range to another camera.
Definition: CalibratedCamera.h:402
void print(const std::string &s="CalibratedCamera") const override
print
Definition: CalibratedCamera.h:326
double range(const Point3 &point, OptionalJacobian< 1, 6 > Dcamera=boost::none, OptionalJacobian< 1, 3 > Dpoint=boost::none) const
Calculate range to a landmark.
Definition: CalibratedCamera.h:381
CalibratedCamera(const Pose3 &pose)
construct with pose
Definition: CalibratedCamera.h:263
Point3 transformFrom(const Point3 &point, OptionalJacobian< 3, 6 > Hself=boost::none, OptionalJacobian< 3, 3 > Hpoint=boost::none) const
takes point in Pose coordinates and transforms it to world coordinates
Definition: Pose3.cpp:342
double range(const Point3 &point, OptionalJacobian< 1, 6 > Hself=boost::none, OptionalJacobian< 1, 3 > Hpoint=boost::none) const
Calculate range to a landmark.
Definition: Pose3.cpp:378
const Point3 & translation(OptionalJacobian< 3, 6 > Hself=boost::none) const
get translation
Definition: Pose3.cpp:303
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself=boost::none) const
get rotation
Definition: Pose3.cpp:310
Represents a 3D point on a unit sphere.
Definition: Unit3.h:42