Added "Group Action" groupings for Doxygen...

release/4.3a0
Frank Dellaert 2012-01-24 05:03:56 +00:00
parent 982e248f31
commit 977888e956
5 changed files with 93 additions and 89 deletions

View File

@ -34,11 +34,11 @@ namespace gtsam {
private: private:
double fx_, fy_, s_, u0_, v0_; double fx_, fy_, s_, u0_, v0_;
public:
/// @name Standard Constructors /// @name Standard Constructors
/// @{ /// @{
public:
/// Create a default calibration that leaves coordinates unchanged /// Create a default calibration that leaves coordinates unchanged
Cal3_S2() : Cal3_S2() :
fx_(1), fy_(1), s_(0), u0_(0), v0_(0) { fx_(1), fy_(1), s_(0), u0_(0), v0_(0) {

View File

@ -178,22 +178,15 @@ public:
} }
/// @} /// @}
/// @name Standard Interface /// @name Group Action on Point2
/// @{ /// @{
/** return transformation matrix */ /** Return point coordinates in pose coordinate frame */
Matrix matrix() const;
/**
* Return point coordinates in pose coordinate frame
*/
Point2 transform_to(const Point2& point, Point2 transform_to(const Point2& point,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H1=boost::none,
boost::optional<Matrix&> H2=boost::none) const; boost::optional<Matrix&> H2=boost::none) const;
/** /** Return point coordinates in global frame */
* Return point coordinates in global frame
*/
Point2 transform_from(const Point2& point, Point2 transform_from(const Point2& point,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H1=boost::none,
boost::optional<Matrix&> H2=boost::none) const; boost::optional<Matrix&> H2=boost::none) const;
@ -201,6 +194,34 @@ public:
/** syntactic sugar for transform_from */ /** syntactic sugar for transform_from */
inline Point2 operator*(const Point2& point) const { return transform_from(point);} inline Point2 operator*(const Point2& point) const { return transform_from(point);}
/// @}
/// @name Standard Interface
/// @{
/// get x
inline double x() const { return t_.x(); }
/// get y
inline double y() const { return t_.y(); }
/// get theta
inline double theta() const { return r_.theta(); }
/// translation
inline const Point2& t() const { return t_; }
/// rotation
inline const Rot2& r() const { return r_; }
/// translation
inline const Point2& translation() const { return t_; }
/// rotation
inline const Rot2& rotation() const { return r_; }
//// return transformation matrix
Matrix matrix() const;
/** /**
* Calculate bearing to a landmark * Calculate bearing to a landmark
* @param point 2D location of landmark * @param point 2D location of landmark
@ -237,26 +258,6 @@ public:
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H1=boost::none,
boost::optional<Matrix&> H2=boost::none) const; boost::optional<Matrix&> H2=boost::none) const;
/** get functions for x, y, theta */
/// get x
inline double x() const { return t_.x(); }
/// get y
inline double y() const { return t_.y(); }
/// get theta
inline double theta() const { return r_.theta(); }
/** shorthand access functions */
inline const Point2& t() const { return t_; }
inline const Rot2& r() const { return r_; }
/** full access functions required by Pose concept */
inline const Point2& translation() const { return t_; }
inline const Rot2& rotation() const { return r_; }
private: private:
/// @} /// @}

View File

@ -165,6 +165,21 @@ namespace gtsam {
0., 0., 0., 0.); 0., 0., 0., 0.);
} }
/// @}
/// @name Group Action on Point3
/// @{
/** receives the point in Pose coordinates and transforms it to world coordinates */
Point3 transform_from(const Point3& p,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H2=boost::none) const;
/** syntactic sugar for transform_from */
inline Point3 operator*(const Point3& p) const { return transform_from(p); }
/** receives the point in world coordinates and transforms it to Pose coordinates */
Point3 transform_to(const Point3& p,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H2=boost::none) const;
/// @} /// @}
/// @name Standard Interface /// @name Standard Interface
/// @{ /// @{
@ -187,19 +202,9 @@ namespace gtsam {
/** convert to 4*4 matrix */ /** convert to 4*4 matrix */
Matrix matrix() const; Matrix matrix() const;
/** receives a pose in world coordinates and transforms it to local coordinates */
Pose3 transform_to(const Pose3& pose) const; Pose3 transform_to(const Pose3& pose) const;
/** receives the point in Pose coordinates and transforms it to world coordinates */
Point3 transform_from(const Point3& p,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H2=boost::none) const;
/** syntactic sugar for transform_from */
inline Point3 operator*(const Point3& p) const { return transform_from(p); }
/** receives the point in world coordinates and transforms it to Pose coordinates */
Point3 transform_to(const Point3& p,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H2=boost::none) const;
/** /**
* Calculate range to a landmark * Calculate range to a landmark
* @param point 3D location of landmark * @param point 3D location of landmark
@ -230,6 +235,8 @@ namespace gtsam {
ar & BOOST_SERIALIZATION_NVP(R_); ar & BOOST_SERIALIZATION_NVP(R_);
ar & BOOST_SERIALIZATION_NVP(t_); ar & BOOST_SERIALIZATION_NVP(t_);
} }
/// @}
}; // Pose3 class }; // Pose3 class
/** /**
@ -243,6 +250,5 @@ namespace gtsam {
inline Matrix wedge<Pose3>(const Vector& xi) { inline Matrix wedge<Pose3>(const Vector& xi) {
return Pose3::wedge(xi(0),xi(1),xi(2),xi(3),xi(4),xi(5)); return Pose3::wedge(xi(0),xi(1),xi(2),xi(3),xi(4),xi(5));
} }
/// @}
} // namespace gtsam } // namespace gtsam

View File

@ -44,9 +44,6 @@ namespace gtsam {
/** normalize to make sure cos and sin form unit vector */ /** normalize to make sure cos and sin form unit vector */
Rot2& normalize(); Rot2& normalize();
/// @name Standard Constructors
/// @{
/** private constructor from cos/sin */ /** private constructor from cos/sin */
inline Rot2(double c, double s) : inline Rot2(double c, double s) :
c_(c), s_(s) { c_(c), s_(s) {
@ -54,6 +51,9 @@ namespace gtsam {
public: public:
/// @name Constructors and named constructors
/// @{
/** default constructor, zero rotation */ /** default constructor, zero rotation */
Rot2() : Rot2() :
c_(1.0), s_(0.0) { c_(1.0), s_(0.0) {
@ -172,20 +172,35 @@ namespace gtsam {
} }
/// @} /// @}
/// @name Vector Space /// @name Group Action on Point2
/// @{ /// @{
/** /**
* Creates a unit vector as a Point2 * rotate point from rotated coordinate frame to world \f$ p^w = R_c^w p^c \f$
*/ */
inline Point2 unit() const { Point2 rotate(const Point2& p, boost::optional<Matrix&> H1 = boost::none,
return Point2(c_, s_); boost::optional<Matrix&> H2 = boost::none) const;
/** syntactic sugar for rotate */
inline Point2 operator*(const Point2& p) const {
return rotate(p);
} }
/**
* rotate point from world to rotated frame \f$ p^c = (R_c^w)^T p^w \f$
*/
Point2 unrotate(const Point2& p, boost::optional<Matrix&> H1 = boost::none,
boost::optional<Matrix&> H2 = boost::none) const;
/// @} /// @}
/// @name Standard Interface /// @name Standard Interface
/// @{ /// @{
/// Creates a unit vector as a Point2
inline Point2 unit() const {
return Point2(c_, s_);
}
/** return angle (RADIANS) */ /** return angle (RADIANS) */
double theta() const { double theta() const {
return ::atan2(s_, c_); return ::atan2(s_, c_);
@ -213,25 +228,6 @@ namespace gtsam {
/** return 2*2 transpose (inverse) rotation matrix */ /** return 2*2 transpose (inverse) rotation matrix */
Matrix transpose() const; Matrix transpose() const;
/**
* rotate point from rotated coordinate frame to
* world = R*p
*/
Point2 rotate(const Point2& p, boost::optional<Matrix&> H1 = boost::none,
boost::optional<Matrix&> H2 = boost::none) const;
/** syntactic sugar for rotate */
inline Point2 operator*(const Point2& p) const {
return rotate(p);
}
/**
* rotate point from world to rotated
* frame = R'*p
*/
Point2 unrotate(const Point2& p, boost::optional<Matrix&> H1 = boost::none,
boost::optional<Matrix&> H2 = boost::none) const;
/// @} /// @}
/// @name Advanced Interface /// @name Advanced Interface
/// @{ /// @{

View File

@ -267,26 +267,27 @@ namespace gtsam {
static Vector Logmap(const Rot3& R); static Vector Logmap(const Rot3& R);
/// @} /// @}
/// @name Standard Interface /// @name Group Action on Point3
/// @{ /// @{
/** /**
* rotate point from rotated coordinate frame to * rotate point from rotated coordinate frame to world \f$ p^w = R_c^w p^c \f$
* world = R*p
*/ */
Point3 rotate(const Point3& p, Point3 rotate(const Point3& p, boost::optional<Matrix&> H1 = boost::none,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H2=boost::none) const; boost::optional<Matrix&> H2 = boost::none) const;
/// rotate point from rotated coordinate frame to world = R*p /// rotate point from rotated coordinate frame to world = R*p
Point3 operator*(const Point3& p) const; Point3 operator*(const Point3& p) const;
/** /**
* rotate point from world to rotated * rotate point from world to rotated frame \f$ p^c = (R_c^w)^T p^w \f$
* frame = R'*p
*/ */
Point3 unrotate(const Point3& p, Point3 unrotate(const Point3& p, boost::optional<Matrix&> H1 = boost::none,
boost::optional<Matrix&> H1=boost::none, boost::optional<Matrix&> H2=boost::none) const; boost::optional<Matrix&> H2 = boost::none) const;
/// @}
/// @name Standard Interface
/// @{
/** return 3*3 rotation matrix */ /** return 3*3 rotation matrix */
Matrix matrix() const; Matrix matrix() const;