use enum dimension for camera DoF

release/4.3a0
Varun Agrawal 2020-03-27 07:53:40 -04:00
parent 1cb7b223ae
commit de170d5f3a
5 changed files with 15 additions and 34 deletions

View File

@ -33,13 +33,9 @@ class GTSAM_EXPORT Cal3DS2 : public Cal3DS2_Base {
typedef Cal3DS2_Base Base; typedef Cal3DS2_Base Base;
private:
static const size_t dimension_ = 9;
public: public:
enum { dimension = dimension_ }; enum { dimension = 9 };
/// @name Standard Constructors /// @name Standard Constructors
/// @{ /// @{
@ -80,10 +76,10 @@ public:
Vector localCoordinates(const Cal3DS2& T2) const ; Vector localCoordinates(const Cal3DS2& T2) const ;
/// Return dimensions of calibration manifold object /// Return dimensions of calibration manifold object
virtual size_t dim() const { return dimension_ ; } virtual size_t dim() const { return dimension ; }
/// Return dimensions of calibration manifold object /// Return dimensions of calibration manifold object
static size_t Dim() { return dimension_; } static size_t Dim() { return dimension; }
/// @} /// @}
/// @name Clone /// @name Clone

View File

@ -47,11 +47,10 @@ class GTSAM_EXPORT Cal3Unified : public Cal3DS2_Base {
private: private:
double xi_; // mirror parameter double xi_; // mirror parameter
static const size_t dimension_ = 10;
public: public:
enum { dimension = dimension_ }; enum { dimension = 10 };
/// @name Standard Constructors /// @name Standard Constructors
/// @{ /// @{
@ -119,10 +118,10 @@ public:
Vector10 localCoordinates(const Cal3Unified& T2) const ; Vector10 localCoordinates(const Cal3Unified& T2) const ;
/// Return dimensions of calibration manifold object /// Return dimensions of calibration manifold object
virtual size_t dim() const { return dimension_ ; } virtual size_t dim() const { return dimension ; }
/// Return dimensions of calibration manifold object /// Return dimensions of calibration manifold object
static size_t Dim() { return dimension_; } static size_t Dim() { return dimension; }
/// Return all parameters as a vector /// Return all parameters as a vector
Vector10 vector() const ; Vector10 vector() const ;

View File

@ -33,10 +33,9 @@ namespace gtsam {
class GTSAM_EXPORT Cal3_S2 { class GTSAM_EXPORT Cal3_S2 {
private: private:
double fx_, fy_, s_, u0_, v0_; double fx_, fy_, s_, u0_, v0_;
static const size_t dimension_ = 5;
public: public:
enum { dimension = dimension_ }; enum { dimension = 5 };
typedef boost::shared_ptr<Cal3_S2> shared_ptr; ///< shared pointer to calibration object typedef boost::shared_ptr<Cal3_S2> shared_ptr; ///< shared pointer to calibration object
/// @name Standard Constructors /// @name Standard Constructors
@ -194,14 +193,10 @@ public:
/// @{ /// @{
/// return DOF, dimensionality of tangent space /// return DOF, dimensionality of tangent space
inline size_t dim() const { inline size_t dim() const { return dimension; }
return dimension_;
}
/// return DOF, dimensionality of tangent space /// return DOF, dimensionality of tangent space
static size_t Dim() { static size_t Dim() { return dimension; }
return dimension_;
}
/// Given 5-dim tangent vector, create new calibration /// Given 5-dim tangent vector, create new calibration
inline Cal3_S2 retract(const Vector& d) const { inline Cal3_S2 retract(const Vector& d) const {

View File

@ -32,11 +32,10 @@ namespace gtsam {
Cal3_S2 K_; Cal3_S2 K_;
double b_; double b_;
static const size_t dimension_ = 6;
public: public:
enum { dimension = dimension_ }; enum { dimension = 6 };
typedef boost::shared_ptr<Cal3_S2Stereo> shared_ptr; ///< shared pointer to stereo calibration object typedef boost::shared_ptr<Cal3_S2Stereo> shared_ptr; ///< shared pointer to stereo calibration object
/// @name Standard Constructors /// @name Standard Constructors
@ -112,14 +111,10 @@ namespace gtsam {
/// @{ /// @{
/// return DOF, dimensionality of tangent space /// return DOF, dimensionality of tangent space
inline size_t dim() const { inline size_t dim() const { return dimension; }
return dimension_;
}
/// return DOF, dimensionality of tangent space /// return DOF, dimensionality of tangent space
static size_t Dim() { static size_t Dim() { return dimension; }
return dimension_;
}
/// Given 6-dim tangent vector, create new calibration /// Given 6-dim tangent vector, create new calibration
inline Cal3_S2Stereo retract(const Vector& d) const { inline Cal3_S2Stereo retract(const Vector& d) const {

View File

@ -248,14 +248,10 @@ private:
*/ */
class GTSAM_EXPORT CalibratedCamera: public PinholeBase { class GTSAM_EXPORT CalibratedCamera: public PinholeBase {
private:
static const size_t dimension_ = 6;
public: public:
enum { enum {
dimension = dimension_ dimension = 6
}; };
/// @name Standard Constructors /// @name Standard Constructors
@ -330,12 +326,12 @@ public:
/// @deprecated /// @deprecated
inline size_t dim() const { inline size_t dim() const {
return dimension_; return dimension;
} }
/// @deprecated /// @deprecated
inline static size_t Dim() { inline static size_t Dim() {
return dimension_; return dimension;
} }
/// @} /// @}