1010from genesis .repr_base import RBC
1111from genesis .utils import geom as gu
1212
13- from genesis .utils .misc import DeprecationError
13+ from genesis .utils .misc import DeprecationError , tensor_to_array
1414
1515from .rigid_geom import RigidGeom , RigidVisGeom , _kernel_get_free_verts , _kernel_get_fixed_verts
1616
@@ -262,7 +262,7 @@ def get_pos(self, envs_idx=None):
262262 envs_idx : int or array of int, optional
263263 The indices of the environments to get the position. If None, get the position of all environments. Default is None.
264264 """
265- return self ._solver .get_links_pos ([ self ._idx ] , envs_idx ).squeeze (- 2 )
265+ return self ._solver .get_links_pos (self ._idx , envs_idx ).squeeze (- 2 )
266266
267267 @gs .assert_built
268268 def get_quat (self , envs_idx = None ):
@@ -274,7 +274,7 @@ def get_quat(self, envs_idx=None):
274274 envs_idx : int or array of int, optional
275275 The indices of the environments to get the quaternion. If None, get the quaternion of all environments. Default is None.
276276 """
277- return self ._solver .get_links_quat ([ self ._idx ] , envs_idx ).squeeze (- 2 )
277+ return self ._solver .get_links_quat (self ._idx , envs_idx ).squeeze (- 2 )
278278
279279 @gs .assert_built
280280 def get_vel (self , envs_idx = None ) -> torch .Tensor :
@@ -286,7 +286,7 @@ def get_vel(self, envs_idx=None) -> torch.Tensor:
286286 envs_idx : int or array of int, optional
287287 The indices of the environments to get the linear velocity. If None, get the linear velocity of all environments. Default is None.
288288 """
289- return self ._solver .get_links_vel ([ self ._idx ] , envs_idx ).squeeze (- 2 )
289+ return self ._solver .get_links_vel (self ._idx , envs_idx ).squeeze (- 2 )
290290
291291 @gs .assert_built
292292 def get_ang (self , envs_idx = None ) -> torch .Tensor :
@@ -298,7 +298,7 @@ def get_ang(self, envs_idx=None) -> torch.Tensor:
298298 envs_idx : int or array of int, optional
299299 The indices of the environments to get the angular velocity. If None, get the angular velocity of all environments. Default is None.
300300 """
301- return self ._solver .get_links_ang ([ self ._idx ] , envs_idx ).squeeze (- 2 )
301+ return self ._solver .get_links_ang (self ._idx , envs_idx ).squeeze (- 2 )
302302
303303 @gs .assert_built
304304 def get_verts (self ):
@@ -545,7 +545,7 @@ def invweight(self):
545545 The invweight of the link.
546546 """
547547 if self ._invweight is None :
548- self ._invweight = self ._solver .get_links_invweight ([ self ._idx ]). cpu (). numpy ( )[..., 0 , :]
548+ self ._invweight = tensor_to_array ( self ._solver .get_links_invweight (self ._idx ) )[..., 0 , :]
549549 return self ._invweight
550550
551551 @property
0 commit comments