(in branch) Made Rot3 derive from Value
parent
402ab48df8
commit
8f4eb68cb5
|
|
@ -32,6 +32,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <gtsam/base/Value.h>
|
||||||
#include <gtsam/geometry/Point3.h>
|
#include <gtsam/geometry/Point3.h>
|
||||||
#include <gtsam/3rdparty/Eigen/Eigen/Geometry>
|
#include <gtsam/3rdparty/Eigen/Eigen/Geometry>
|
||||||
|
|
||||||
|
|
@ -49,7 +50,7 @@ namespace gtsam {
|
||||||
* @ingroup geometry
|
* @ingroup geometry
|
||||||
* \nosubgrouping
|
* \nosubgrouping
|
||||||
*/
|
*/
|
||||||
class Rot3 {
|
class Rot3 : public Value {
|
||||||
public:
|
public:
|
||||||
static const size_t dimension = 3;
|
static const size_t dimension = 3;
|
||||||
|
|
||||||
|
|
@ -92,6 +93,9 @@ namespace gtsam {
|
||||||
*/
|
*/
|
||||||
Rot3(const Quaternion& q);
|
Rot3(const Quaternion& q);
|
||||||
|
|
||||||
|
/** Virtual destructor */
|
||||||
|
virtual ~Rot3() {}
|
||||||
|
|
||||||
/* Static member function to generate some well known rotations */
|
/* 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.
|
/// 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 */
|
/** equals with an tolerance */
|
||||||
bool equals(const Rot3& p, double tol = 1e-9) const;
|
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
|
/// @name Group
|
||||||
/// @{
|
/// @{
|
||||||
|
|
@ -235,7 +242,7 @@ namespace gtsam {
|
||||||
static size_t Dim() { return dimension; }
|
static size_t Dim() { return dimension; }
|
||||||
|
|
||||||
/// return dimensionality of tangent space, DOF = 3
|
/// 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.
|
* 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
|
/// Returns local retract coordinates in neighborhood around current rotation
|
||||||
Vector localCoordinates(const Rot3& t2, Rot3::CoordinatesMode mode = ROT3_DEFAULT_COORDINATES_MODE) const;
|
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
|
/// @name Lie Group
|
||||||
/// @{
|
/// @{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue