24 #include <gtsam/base/concepts.h> 27 #include <gtsam/dllexport.h> 28 #include <boost/serialization/nvp.hpp> 33 CheiralityException> {
42 Key nearbyVariable()
const {
return j_;}
66 typedef Point2Vector MeasurementVector;
82 static Matrix26 Dpose(
const Point2& pn,
double d);
90 static Matrix23 Dpoint(
const Point2& pn,
double d,
const Matrix3& Rt);
106 static Pose3 LevelPose(
const Pose2& pose2,
double height);
137 pose_(
Pose3::Expmap(v)) {
145 bool equals(
const PinholeBase &camera,
double tol = 1e-9)
const;
148 void print(
const std::string& s =
"PinholeBase")
const;
193 std::pair<Point2, bool> projectSafe(
const Point3& pw)
const;
213 static Point3 BackprojectFromCamera(
const Point2& p,
const double depth,
227 return std::make_pair(3, 5);
235 friend class boost::serialization::access;
236 template<
class Archive>
237 void serialize(Archive & ar,
const unsigned int ) {
238 ar & BOOST_SERIALIZATION_NVP(pose_);
288 static CalibratedCamera Level(
const Pose2& pose2,
double height);
298 static CalibratedCamera Lookat(
const Point3& eye,
const Point3& target,
299 const Point3& upVector);
329 inline size_t dim()
const {
334 inline static size_t Dim() {
356 Matrix31 Dpoint_ddepth;
357 const Point3 point = BackprojectFromCamera(pn, depth,
358 Dresult_dp ? &Dpoint_dpn : 0,
359 Dresult_ddepth ? &Dpoint_ddepth : 0);
361 Matrix33 Dresult_dpoint;
364 Dresult_dp) ? &Dresult_dpoint : 0);
367 *Dresult_dp = Dresult_dpoint * Dpoint_dpn;
369 *Dresult_ddepth = Dresult_dpoint * Dpoint_ddepth;
382 return pose().
range(point, Dcamera, Dpoint);
392 return this->pose().
range(pose, Dcamera, Dpose);
403 return pose().
range(camera.
pose(), H1, H2);
414 friend class boost::serialization::access;
415 template<
class Archive>
416 void serialize(Archive & ar,
const unsigned int ) {
418 & boost::serialization::make_nvp(
"PinholeBase",
419 boost::serialization::base_object<PinholeBase>(*
this));
433 template <
typename T>
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:350
Definition: CalibratedCamera.h:53
Base class and basic functions for Manifold types.
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
Base exception type that uses tbb_exception if GTSAM is compiled with TBB.
Definition: ThreadsafeException.h:39
const Point3 & translation(OptionalJacobian< 3, 6 > H=boost::none) const
get translation
Definition: Pose3.cpp:265
PinholeBase()
default constructor
Definition: CalibratedCamera.h:124
const Rot3 & rotation() const
get rotation
Definition: CalibratedCamera.h:160
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
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:400
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Point3 transformFrom(const Point3 &p, OptionalJacobian< 3, 6 > Dpose=boost::none, OptionalJacobian< 3, 3 > Dpoint=boost::none) const
takes point in Pose coordinates and transforms it to world coordinates
Definition: Pose3.cpp:312
Definition: CalibratedCamera.h:32
double range(const Point3 &point, OptionalJacobian< 1, 6 > H1=boost::none, OptionalJacobian< 1, 3 > H2=boost::none) const
Calculate range to a landmark.
Definition: Pose3.cpp:348
Definition: BearingRange.h:193
Point2_ project(const Point3_ &p_cam)
Expression version of PinholeBase::Project.
Definition: expressions.h:57
Represents a 3D point on a unit sphere.
Definition: Unit3.h:42
PinholeBase(const Pose3 &pose)
constructor with pose
Definition: CalibratedCamera.h:128
Definition: CalibratedCamera.h:250
Rot3 Rotation
Pose Concept requirements.
Definition: CalibratedCamera.h:58
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
const Point3 & translation() const
get translation
Definition: CalibratedCamera.h:165
CalibratedCamera(const Pose3 &pose)
construct with pose
Definition: CalibratedCamera.h:266
virtual ~CalibratedCamera()
destructor
Definition: CalibratedCamera.h:315
Definition: BearingRange.h:39
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:390
const Rot3 & rotation(OptionalJacobian< 3, 6 > H=boost::none) const
get rotation
Definition: Pose3.cpp:272
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
size_t dim() const
Definition: CalibratedCamera.h:329
CalibratedCamera()
default constructor
Definition: CalibratedCamera.h:262
const Pose3 & pose() const
return pose, constant version
Definition: CalibratedCamera.h:155
Point2 Measurement
Some classes template on either PinholeCamera or StereoCamera, and this typedef informs those classes...
Definition: CalibratedCamera.h:65
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:226
CalibratedCamera(const Vector &v)
construct from vector
Definition: CalibratedCamera.h:306
static size_t Dim()
Definition: CalibratedCamera.h:334
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:379
Base exception type that uses tbb_exception if GTSAM is compiled with TBB.