gtsam
Loading...
Searching...
No Matches
PoseRTV.h
Go to the documentation of this file.
1
6
7#pragma once
8
9#include <gtsam/config.h>
10
11#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V43
12
13#include <gtsam_unstable/dllexport.h>
16
17namespace gtsam {
18
20typedef Vector3 Velocity3;
21
28class GTSAM_UNSTABLE_EXPORT PoseRTV : public ProductLieGroup<Pose3,Velocity3> {
29protected:
30
31 typedef ProductLieGroup<Pose3,Velocity3> Base;
32 typedef OptionalJacobian<9, 9> ChartJacobian;
33
34public:
35
36 // constructors - with partial versions
37 PoseRTV() {}
38 PoseRTV(const Point3& t, const Rot3& rot, const Velocity3& vel)
39 : Base(Pose3(rot, t), vel) {}
40 PoseRTV(const Rot3& rot, const Point3& t, const Velocity3& vel)
41 : Base(Pose3(rot, t), vel) {}
42 explicit PoseRTV(const Point3& t)
43 : Base(Pose3(Rot3(), t),Vector3::Zero()) {}
44 PoseRTV(const Pose3& pose, const Velocity3& vel)
45 : Base(pose, vel) {}
46 explicit PoseRTV(const Pose3& pose)
47 : Base(pose,Vector3::Zero()) {}
48
49 // Construct from Base
50 PoseRTV(const Base& base)
51 : Base(base) {}
52
54 PoseRTV(double roll, double pitch, double yaw, double x, double y, double z,
55 double vx, double vy, double vz);
56
58 explicit PoseRTV(const Vector& v);
59
60 // access
61 const Pose3& pose() const { return first; }
62 const Velocity3& v() const { return second; }
63 const Point3& t() const { return pose().translation(); }
64 const Rot3& R() const { return pose().rotation(); }
65
66 // longer function names
67 const Point3& translation() const { return pose().translation(); }
68 const Rot3& rotation() const { return pose().rotation(); }
69 const Velocity3& velocity() const { return second; }
70
71 // Access to vector for ease of use with Matlab
72 // and avoidance of Point3
73 Vector vector() const;
74 Vector translationVec() const { return pose().translation(); }
75 const Velocity3& velocityVec() const { return velocity(); }
76
77 // testable
78 bool equals(const PoseRTV& other, double tol=1e-6) const;
79 void print(const std::string& s="") const;
80
83 using Base::dimension;
84 using Base::dim;
85 using Base::Dim;
86 using Base::retract;
87 using Base::localCoordinates;
88 using Base::LocalCoordinates;
90
93
95 double range(const PoseRTV& other,
96 OptionalJacobian<1,9> H1={},
97 OptionalJacobian<1,9> H2={}) const;
99
102
105 PoseRTV planarDynamics(double vel_rate, double heading_rate, double max_accel, double dt) const;
106
111 PoseRTV flyingDynamics(double pitch_rate, double heading_rate, double lift_control, double dt) const;
112
114 PoseRTV generalDynamics(const Vector& accel, const Vector& gyro, double dt) const;
115
119 Vector6 imuPrediction(const PoseRTV& x2, double dt) const;
120
124 Point3 translationIntegration(const Rot3& r2, const Velocity3& v2, double dt) const;
125
129 inline Point3 translationIntegration(const PoseRTV& x2, double dt) const {
130 return translationIntegration(x2.rotation(), x2.velocity(), dt);
131 }
132
134 inline Vector translationIntegrationVec(const PoseRTV& x2, double dt) const {
135 return translationIntegration(x2, dt);
136 }
137
145 PoseRTV transformed_from(const Pose3& trans,
146 ChartJacobian Dglobal = {},
147 OptionalJacobian<9, 6> Dtrans = {}) const;
148
152
155 static Matrix RRTMbn(const Vector3& euler);
156 static Matrix RRTMbn(const Rot3& att);
157
160 static Matrix RRTMnb(const Vector3& euler);
161 static Matrix RRTMnb(const Rot3& att);
163
164private:
165#if GTSAM_ENABLE_BOOST_SERIALIZATION
167 friend class boost::serialization::access;
168 template<class Archive>
169 void serialize(Archive & ar, const unsigned int /*version*/) {
170 ar & BOOST_SERIALIZATION_NVP(first);
171 ar & BOOST_SERIALIZATION_NVP(second);
172 }
173#endif
174};
175
176
177template<>
178struct traits<PoseRTV> : public internal::LieGroup<PoseRTV> {};
179
180// Define Range functor specializations that are used in RangeFactor
181template <typename A1, typename A2> struct Range;
182
183template<>
184struct Range<PoseRTV, PoseRTV> : HasRange<PoseRTV, PoseRTV, double> {};
185
186} // \namespace gtsam
187
188#endif // GTSAM_ALLOW_DEPRECATED_SINCE_V43
Group product of two Lie Groups.
3D Pose manifold SO(3) x R^3 and group SE(3)
Global functions in a separate testing namespace.
Definition chartTesting.h:28
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
Vector3 Velocity3
Velocity is currently typedef'd to Vector3.
Definition Gal3.h:33
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Both LieGroupTraits and Testable.
Definition Lie.h:346
Direct product Lie group G × H.
Definition ProductLieGroup.h:69
Definition BearingRange.h:42
Definition BearingRange.h:196