@@ -63,8 +63,6 @@ def mesh_path(self) -> list[str]:
6363 ".mesh" ,
6464 ".ply" ,
6565 ]:
66- if self ._mesh_dir and not os .path .isabs (mesh_path_str ):
67- mesh_path_str = str (self ._mesh_dir / mesh_path_str )
6866 mesh_paths .append (mesh_path_str )
6967 return mesh_paths
7068
@@ -158,10 +156,9 @@ def marker_names(self) -> tuple[str, ...]:
158156 In Pinocchio, markers can be represented as frames or operational frames.
159157 This returns all frame names that could represent markers.
160158 """
161- # Get all frames that are not joint frames
162159 marker_frames = []
163160 for frame in self .model .frames :
164- if frame .type == pin .FrameType .OP_FRAME :
161+ if frame .type == pin .FrameType .SENSOR :
165162 marker_frames .append (frame .name )
166163 return tuple (marker_frames )
167164
@@ -275,8 +272,21 @@ def nb_q(self) -> int:
275272 def dof_names (self ) -> tuple [str , ...]:
276273 """
277274 Returns the names of all degrees of freedom.
275+
276+ Notes
277+ -----
278+ We need to skip the first joint (universe) as it has no DoFs.
279+ Joint DoFs can have individual names if they have multiple DoFs (e.g., a 3-DoF joint).
278280 """
279- return tuple (self .model .names [1 :]) # Skip universe/world
281+ dof_names = []
282+ for joint , name in zip (self .model .joints [1 :], self .model .names [1 :]):
283+ if joint .nq == 0 :
284+ continue
285+
286+ for k in range (joint .nq ):
287+ dof_names .append (f"{ name } _{ k } " )
288+
289+ return tuple (dof_names )
280290
281291 @cached_property
282292 def q_ranges (self ) -> tuple [tuple [float , float ], ...]:
0 commit comments