Made Event into new-style manifold
parent
4e9d31d40d
commit
7c455efe50
|
@ -31,6 +31,7 @@ class Event {
|
||||||
Point3 location_; ///< Location at time event was generated
|
Point3 location_; ///< Location at time event was generated
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
enum { dimension = 4 };
|
||||||
|
|
||||||
/// Speed of sound
|
/// Speed of sound
|
||||||
static const double Speed;
|
static const double Speed;
|
||||||
|
@ -72,15 +73,6 @@ public:
|
||||||
&& location_.equals(other.location_, tol);
|
&& location_.equals(other.location_, tol);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Manifold stuff:
|
|
||||||
|
|
||||||
size_t dim() const {
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
static size_t Dim() {
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Updates a with tangent space delta
|
/// Updates a with tangent space delta
|
||||||
inline Event retract(const Vector4& v) const {
|
inline Event retract(const Vector4& v) const {
|
||||||
return Event(time_ + v[0], location_.retract(v.tail(3)));
|
return Event(time_ + v[0], location_.retract(v.tail(3)));
|
||||||
|
@ -111,16 +103,7 @@ const double Event::Speed = 330;
|
||||||
const Matrix14 Event::JacobianZ = (Matrix14() << 0,0,0,1).finished();
|
const Matrix14 Event::JacobianZ = (Matrix14() << 0,0,0,1).finished();
|
||||||
|
|
||||||
// Define GTSAM traits
|
// Define GTSAM traits
|
||||||
namespace traits {
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct GTSAM_EXPORT dimension<Event> : public boost::integral_constant<int, 4> {
|
struct GTSAM_EXPORT traits<Event> : internal::Manifold<Event> {};
|
||||||
};
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct GTSAM_EXPORT is_manifold<Event> : public boost::true_type {
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} //\ namespace gtsam
|
} //\ namespace gtsam
|
||||||
|
|
Loading…
Reference in New Issue