@@ -313,6 +313,16 @@ class QuaternionFloatingMobilizer final : public MobilizerImpl<T, 7, 6> {
313
313
const Eigen::Ref<const VectorX<T>>& qdot,
314
314
EigenPtr<VectorX<T>> v) const final ;
315
315
316
+ void DoMapAccelerationToQDDot (const systems::Context<T>& context,
317
+ const Eigen::Ref<const VectorX<T>>& vdot,
318
+ EigenPtr<VectorX<T>> qddot) const final ;
319
+ #if 0
320
+ // Maps qddot to vdot by calculating v̇ = Ṅ⁺(q,q̇)⋅q̇ + N⁺(q)⋅q̈.
321
+ void DoMapQDDotToAcceleration(const systems::Context<T>& context,
322
+ const Eigen::Ref<const VectorX<T>>& qddot,
323
+ EigenPtr<VectorX<T>> vdot) const final;
324
+ #endif
325
+
316
326
std::unique_ptr<Mobilizer<double >> DoCloneToScalar (
317
327
const MultibodyTree<double >& tree_clone) const final ;
318
328
@@ -325,12 +335,23 @@ class QuaternionFloatingMobilizer final : public MobilizerImpl<T, 7, 6> {
325
335
private:
326
336
// Helper to compute the kinematic map N(q). L ∈ ℝ⁴ˣ³.
327
337
static Eigen::Matrix<T, 4 , 3 > CalcLMatrix (const Quaternion<T>& q);
328
- // Helper to compute the kinematic map N(q) from angular velocity to
329
- // quaternion time derivative for which q̇_WB = N(q)⋅w_WB.
330
- // With L given by CalcLMatrix we have:
331
- // N(q) = L(q_FM/2)
338
+
339
+ // Returns the 4x3 Nᵣ(q) matrix that relates q̇_FM = Nᵣ(q) * w_FM_F, where
340
+ // q̇_FM = [q̇w, q̇x, q̇y, q̇z]ᵀ (time-derivative of quaternion for frames F and M)
341
+ // w_FM_F = [ωx, ωy, ωz]ᵀ (frame M's angular velocity in F, expressed in F).
342
+ //
343
+ // ⌈ q̇w ⌉ ⌈ -qx -qy -qz ⌉ ⌈ ωx ⌉
344
+ // | q̇x | = 0.5 | qw qz -qy | | ωy |
345
+ // | q̇y | | -qz qw qx | ⌊ ωz ⌋
346
+ // ⌊ q̇z ⌋ ⌊ qy -qx qw ⌋
347
+ //
348
+ // Herein L(q_FM) is the 4x3 matrix shown above, so Nᵣ(q) = 0.5 * L(q_FM).
349
+ // Due to the linear nature of L(q_FM), 0.5 * L(q_FM) = L(0.5 * q_FM).
332
350
static Eigen::Matrix<T, 4 , 3 > AngularVelocityToQuaternionRateMatrix (
333
- const Quaternion<T>& q);
351
+ const Quaternion<T>& q_FM) {
352
+ return CalcLMatrix (
353
+ {0.5 * q_FM.w (), 0.5 * q_FM.x (), 0.5 * q_FM.y (), 0.5 * q_FM.z ()});
354
+ }
334
355
335
356
// Helper to compute the kinematic map N⁺(q) from quaternion time derivative
336
357
// to angular velocity for which w_WB = N⁺(q)⋅q̇_WB.
0 commit comments