(in branch) Made Rot3 derive from Value

release/4.3a0
Richard Roberts 2012-01-14 23:12:28 +00:00
parent 402ab48df8
commit 8f4eb68cb5
1 changed files with 15 additions and 2 deletions

View File

@ -32,6 +32,7 @@
#endif
#endif
#include <gtsam/base/Value.h>
#include <gtsam/geometry/Point3.h>
#include <gtsam/3rdparty/Eigen/Eigen/Geometry>
@ -49,7 +50,7 @@ namespace gtsam {
* @ingroup geometry
* \nosubgrouping
*/
class Rot3 {
class Rot3 : public Value {
public:
static const size_t dimension = 3;
@ -92,6 +93,9 @@ namespace gtsam {
*/
Rot3(const Quaternion& q);
/** Virtual destructor */
virtual ~Rot3() {}
/* Static member function to generate some well known rotations */
/// Rotation around X axis as in http://en.wikipedia.org/wiki/Rotation_matrix, counterclockwise when looking from unchanging axis.
@ -184,6 +188,9 @@ namespace gtsam {
/** equals with an tolerance */
bool equals(const Rot3& p, double tol = 1e-9) const;
/** equals implementing generic Value interface */
virtual bool equals_(const Value& p, double tol = 1e-9) const { return CallDerivedEquals(this, p, tol); }
/// @}
/// @name Group
/// @{
@ -235,7 +242,7 @@ namespace gtsam {
static size_t Dim() { return dimension; }
/// return dimensionality of tangent space, DOF = 3
size_t dim() const { return dimension; }
virtual size_t dim() const { return dimension; }
/**
* The method retract() is used to map from the tangent space back to the manifold.
@ -265,6 +272,12 @@ namespace gtsam {
/// Returns local retract coordinates in neighborhood around current rotation
Vector localCoordinates(const Rot3& t2, Rot3::CoordinatesMode mode = ROT3_DEFAULT_COORDINATES_MODE) const;
/// Generic Value interface version of retract
virtual std::auto_ptr<Value> retract_(const Vector& omega) const { return CallDerivedRetract(this, omega); }
/// Generic Value interface version of localCoordinates
virtual Vector localCoordinates_(const Value& value) const { return CallDerivedLocalCoordinates(this, value); }
/// @}
/// @name Lie Group
/// @{