Go to the documentation of this file.
27 double z,
double vx,
double vy,
double vz) :
55 cout <<
s <<
":" << endl;
57 cout <<
" T" <<
t().transpose() << endl;
63 double max_accel,
double dt)
const {
71 const double yaw2 =
r2.ypr()(0);
74 const double mag_v1 =
v1.norm();
77 double dv =
bound(vel_rate - mag_v1, - (max_accel *
dt), max_accel *
dt);
78 double mag_v2 = mag_v1 + dv;
88 double pitch_rate,
double heading_rate,
double lift_control,
double dt)
const {
94 Vector rot_rates = (
Vector(3) << 0.0, pitch_rate, heading_rate).finished();
98 const double thrust = 50.0;
99 const double lift = 50.0;
100 const double drag = 0.1;
101 double yaw2 =
r2.yaw();
102 double pitch2 =
r2.pitch();
103 double forward_accel = -thrust *
sin(pitch2);
109 - drag * (
Vector(3) <<
v1.x(),
v1.y(), 0.0).finished()
110 + Vector::Unit(3,2)*(loss_lift - lift_control);
144 imu.head<3>() =
r2.transpose() * (accel -
kGravity);
156 imu.tail<3>() = Enb * dR;
173 Matrix36 D_t1_pose, D_t2_other;
175 const Point3 t2 =
other.pose().translation(H2 ? &D_t2_other : 0);
176 Matrix13 D_d_t1, D_d_t2;
177 double d =
distance3(t1, t2, H1 ? &D_d_t1 : 0, H2 ? &D_d_t2 : 0);
178 if (H1) *H1 << D_d_t1 * D_t1_pose, 0,0,0;
179 if (H2) *H2 << D_d_t2 * D_t2_other, 0,0,0;
188 Matrix6 D_newpose_trans, D_newpose_pose;
189 Pose3 newpose =
trans.compose(
pose(), D_newpose_trans, D_newpose_pose);
192 Matrix3 D_newvel_R, D_newvel_v;
197 Dglobal->topLeftCorner<6,6>() = D_newpose_pose;
198 Dglobal->bottomRightCorner<3,3>() = D_newvel_v;
203 Dtrans->topLeftCorner<6,6>() = D_newpose_trans;
204 Dtrans->bottomLeftCorner<3,3>() = D_newvel_R;
206 return PoseRTV(newpose, newvel);
211 assert(euler.size() == 3);
212 const double s1 =
sin(euler.x()),
c1 =
cos(euler.x());
213 const double t2 =
tan(euler.y()),
c2 =
cos(euler.y());
215 Ebn << 1.0, s1 * t2,
c1 * t2,
229 const double s1 =
sin(euler.x()),
c1 =
cos(euler.x());
230 const double s2 =
sin(euler.y()),
c2 =
cos(euler.y());
231 Enb << 1.0, 0.0, -s2,
Vector3 xyz(OptionalJacobian< 3, 3 > H={}) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE FixedSegmentReturnType< internal::get_fixed_value< NType >::value >::Type tail(NType n)
bool equals(const PoseRTV &other, double tol=1e-6) const
PoseRTV transformed_from(const Pose3 &trans, ChartJacobian Dglobal={}, OptionalJacobian< 9, 6 > Dtrans={}) const
typedef and functions to augment Eigen's VectorXd
static const double d[K][N]
Jet< T, N > sin(const Jet< T, N > &f)
Vector3 rpy(OptionalJacobian< 3, 3 > H={}) const
static Matrix RRTMbn(const Vector3 &euler)
double bound(double a, double min, double max)
Vector3 Velocity3
Velocity is currently typedef'd to Vector3.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
static Rot3 Yaw(double t)
Positive yaw is to right (as in aircraft heading). See ypr.
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
PoseRTV generalDynamics(const Vector &accel, const Vector &gyro, double dt) const
General Dynamics update - supply control inputs in body frame.
const Rot3 & rotation() const
Jet< T, N > cos(const Jet< T, N > &f)
Point3 translationIntegration(const Rot3 &r2, const Velocity3 &v2, double dt) const
static Rot2 fromAngle(double theta)
Named constructor from angle in radians.
Vector6 imuPrediction(const PoseRTV &x2, double dt) const
static const Vector kGravity
void print(const Matrix &A, const string &s, ostream &stream)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE FixedSegmentReturnType< internal::get_fixed_value< NType >::value >::Type segment(Index start, NType n)
StridedVectorType vy(make_vector(y, *n, std::abs(*incy)))
Point3 rotate(const Point3 &p, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
void print(const std::string &s="") const
const Velocity3 & v() const
bool equals(const Pose3 &pose, double tol=1e-9) const
assert equality up to a tolerance
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
Pose3 with translational velocity.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE FixedSegmentReturnType< internal::get_fixed_value< NType >::value >::Type head(NType n)
const EIGEN_DEVICE_FUNC TanReturnType tan() const
const Point3 & translation() const
PoseRTV planarDynamics(double vel_rate, double heading_rate, double max_accel, double dt) const
const Velocity3 & velocity() const
Matrix trans(const Matrix &A)
static Matrix RRTMnb(const Vector3 &euler)
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
const Pose3 & pose() const
double distance3(const Point3 &p1, const Point3 &q, OptionalJacobian< 1, 3 > H1, OptionalJacobian< 1, 3 > H2)
distance between two points
PoseRTV flyingDynamics(double pitch_rate, double heading_rate, double lift_control, double dt) const
double range(const PoseRTV &other, OptionalJacobian< 1, 9 > H1={}, OptionalJacobian< 1, 9 > H2={}) const
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
StridedVectorType vx(make_vector(x, *n, std::abs(*incx)))
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:12:45