@@ -173,6 +173,24 @@ def root_view(self):
173173 """
174174 raise NotImplementedError ()
175175
176+ @property
177+ def num_jacobi_joints (self ) -> int :
178+ """Size of the Jacobian's joint axis (its last dimension).
179+
180+ For most backends this equals :attr:`num_joints`. Some
181+ backends prepend the 6 floating-base DoFs to the Jacobian's
182+ joint axis without counting them in :attr:`num_joints`; on
183+ those, ``num_jacobi_joints`` is ``num_joints + 6`` for
184+ floating-base assets. The default returns :attr:`num_joints`;
185+ backends that carry extra leading columns override.
186+
187+ To convert a logical joint index (from :meth:`find_joints`)
188+ into the matching Jacobian column index, add the difference
189+ ``num_jacobi_joints - num_joints`` — ``0`` for the default
190+ convention, ``6`` for the prepend-floating-base convention.
191+ """
192+ return self .num_joints
193+
176194 def get_jacobians (self ) -> wp .array :
177195 """Per-env geometric Jacobians, referenced at each link origin in world frame.
178196
@@ -181,26 +199,30 @@ def get_jacobians(self) -> wp.array:
181199
182200 .. code-block:: text
183201
184- J[:, body_idx , 0:3, :] @ q_dot == data.body_link_lin_vel_w[:, body_idx]
185- J[:, body_idx , 3:6, :] @ q_dot == data.body_link_ang_vel_w[:, body_idx]
202+ J[:, jacobi_body_idx , 0:3, :] @ q_dot == data.body_link_lin_vel_w[:, body_idx]
203+ J[:, jacobi_body_idx , 3:6, :] @ q_dot == data.body_link_ang_vel_w[:, body_idx]
186204
187205 Linear rows ``[0:3]`` give the velocity at the link origin (the
188206 body's USD prim transform / actor frame) in world frame.
189207 Angular rows ``[3:6]`` give the body's angular velocity in
190208 world frame. Both share the contract used by
191209 :attr:`~isaaclab.assets.ArticulationData.body_link_pos_w` and
192210 :attr:`~isaaclab.assets.ArticulationData.body_link_lin_vel_w`.
211+ For fixed-base articulations, ``jacobi_body_idx`` excludes the
212+ fixed root body and is therefore ``body_idx - 1``. For
213+ floating-base articulations, ``jacobi_body_idx == body_idx``.
193214
194215 Implementations whose native Jacobian is expressed at a
195216 different reference point (e.g. body center of mass) MUST shift
196217 the linear rows to the link origin before returning so the
197218 contract above holds across backends.
198219
199- Floating-base joint-dim convention differs across backends:
200- some prepend the floating-base 6 DoFs to the joint dimension,
201- others fold them into the native joint-DoF count. The total
202- joint dimension is the same; only how :attr:`num_joints` is
203- reported differs.
220+ The joint-dimension size is reported by
221+ :attr:`num_jacobi_joints`. Backends that prepend floating-base
222+ DoFs to the Jacobian columns expose the offset implicitly via
223+ ``num_jacobi_joints - num_joints``; callers that index into
224+ the joint axis should consult that property rather than
225+ hard-coding a constant.
204226
205227 Returns:
206228 The per-env geometric Jacobian. Shape
0 commit comments