@@ -40,6 +40,7 @@ class FrameBodyPoseCache {
40
40
: X_BF_pool_(num_frame_body_pose_slots_needed),
41
41
X_FB_pool_(num_frame_body_pose_slots_needed),
42
42
is_X_BF_identity_(num_frame_body_pose_slots_needed),
43
+ M_BBo_B_pool_(num_mobods, SpatialInertia<T>::NaN()),
43
44
X_MbF_pool_(num_frames),
44
45
X_FMb_pool_(num_frames),
45
46
is_X_MbF_identity_(num_frames),
@@ -74,6 +75,12 @@ class FrameBodyPoseCache {
74
75
return static_cast <bool >(is_X_BF_identity_[body_pose_index]);
75
76
}
76
77
78
+ const SpatialInertia<T>& get_M_BBo_B (MobodIndex index) const {
79
+ // This method must be very fast in Release.
80
+ DRAKE_ASSERT (0 <= index && index < ssize (M_BBo_B_pool_));
81
+ return M_BBo_B_pool_[index];
82
+ }
83
+
77
84
void SetX_BF (int body_pose_index, const math::RigidTransform<T>& X_BF) {
78
85
// This method is only called when parameters change.
79
86
DRAKE_DEMAND (0 <= body_pose_index && body_pose_index < ssize (X_BF_pool_));
@@ -88,6 +95,14 @@ class FrameBodyPoseCache {
88
95
}
89
96
}
90
97
98
+ void SetM_BBo_B (MobodIndex index, const SpatialInertia<T>& M_BBo_B) {
99
+ // This method is only called when parameters change.
100
+ DRAKE_DEMAND (0 <= index && index < ssize (M_BBo_B_pool_));
101
+ M_BBo_B_pool_[index] = M_BBo_B;
102
+ }
103
+
104
+ // M-frame quantities below.
105
+
91
106
const math::RigidTransform<T>& get_X_MbF (FrameIndex index) const {
92
107
// This method must be very fast in Release.
93
108
DRAKE_ASSERT (0 <= index && index < ssize (X_MbF_pool_));
@@ -140,6 +155,10 @@ class FrameBodyPoseCache {
140
155
std::vector<math::RigidTransform<T>> X_FB_pool_;
141
156
std::vector<uint8_t > is_X_BF_identity_; // fast vector<bool> equivalent
142
157
158
+ // Spatial inertia of mobilized body B, about its body origin Bo, expressed
159
+ // in B. These are indexed by MobodIndex.
160
+ std::vector<SpatialInertia<T>> M_BBo_B_pool_;
161
+
143
162
// These are indexed by Frame::index().
144
163
std::vector<math::RigidTransform<T>> X_MbF_pool_;
145
164
std::vector<math::RigidTransform<T>> X_FMb_pool_;
0 commit comments