File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
pyorerun/model_interfaces Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -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
@@ -275,8 +273,21 @@ def nb_q(self) -> int:
275273 def dof_names (self ) -> tuple [str , ...]:
276274 """
277275 Returns the names of all degrees of freedom.
276+
277+ Notes
278+ -----
279+ We need to skip the first joint (universe) as it has no DoFs.
280+ Joint DoFs can have individual names if they have multiple DoFs (e.g., a 3-DoF joint).
278281 """
279- return tuple (self .model .names [1 :]) # Skip universe/world
282+ dof_names = []
283+ for joint , name in zip (self .model .joints [1 :], self .model .names [1 :]):
284+ if joint .nq == 0 :
285+ continue
286+
287+ for k in range (joint .nq ):
288+ dof_names .append (f"{ name } _{ k } " )
289+
290+ return tuple (dof_names )
280291
281292 @cached_property
282293 def q_ranges (self ) -> tuple [tuple [float , float ], ...]:
You can’t perform that action at this time.
0 commit comments