@@ -1230,14 +1230,7 @@ def get_ang(self, envs_idx=None):
12301230 return self ._solver .get_links_ang (self .base_link_idx , envs_idx )[..., 0 , :]
12311231
12321232 @gs .assert_built
1233- def get_links_pos (
1234- self ,
1235- links_idx_local = None ,
1236- envs_idx = None ,
1237- * ,
1238- ref : Literal ["link_origin" , "link_com" , "root_com" ] = "link_origin" ,
1239- unsafe = False ,
1240- ):
1233+ def get_links_pos (self , links_idx_local = None , envs_idx = None ):
12411234 """
12421235 Returns the position of a given reference point for all the entity's links.
12431236
@@ -1247,19 +1240,14 @@ def get_links_pos(
12471240 The indices of the links. Defaults to None.
12481241 envs_idx : None | array_like, optional
12491242 The indices of the environments. If None, all environments will be considered. Defaults to None.
1250- ref: "link_origin" | "link_com" | "root_com"
1251- The reference point being used to express the position of each link.
1252- * "root_com": center of mass of the sub-entities to which the link belongs. As a reminder, a single
1253- kinematic tree (aka. 'RigidEntity') may compromise multiple "physical" entities, i.e. a kinematic tree
1254- that may have at most one free joint, at its root.
12551243
12561244 Returns
12571245 -------
12581246 pos : torch.Tensor, shape (n_links, 3) or (n_envs, n_links, 3)
12591247 The position of all the entity's links.
12601248 """
12611249 links_idx = self ._get_global_idx (links_idx_local , self .n_links , self ._link_start , unsafe = True )
1262- return self ._solver .get_links_pos (links_idx , envs_idx , ref = ref )
1250+ return self ._solver .get_links_pos (links_idx , envs_idx )
12631251
12641252 @gs .assert_built
12651253 def get_links_quat (self , links_idx_local = None , envs_idx = None ):
@@ -1318,14 +1306,7 @@ def get_vAABB(self, envs_idx=None):
13181306 return torch .stack ((aabbs [..., 0 , :].min (dim = - 2 ).values , aabbs [..., 1 , :].max (dim = - 2 ).values ), dim = - 2 )
13191307
13201308 @gs .assert_built
1321- def get_links_vel (
1322- self ,
1323- links_idx_local = None ,
1324- envs_idx = None ,
1325- * ,
1326- ref : Literal ["link_origin" , "link_com" ] = "link_origin" ,
1327- unsafe = False ,
1328- ):
1309+ def get_links_vel (self , links_idx_local = None , envs_idx = None ):
13291310 """
13301311 Returns linear velocity of all the entity's links expressed at a given reference position in world coordinates.
13311312
@@ -1335,16 +1316,14 @@ def get_links_vel(
13351316 The indices of the links. Defaults to None.
13361317 envs_idx : None | array_like, optional
13371318 The indices of the environments. If None, all environments will be considered. Defaults to None.
1338- ref: "link_origin" | "link_com"
1339- The reference point being used to expressed the velocity of each link.
13401319
13411320 Returns
13421321 -------
13431322 vel : torch.Tensor, shape (n_links, 3) or (n_envs, n_links, 3)
13441323 The linear velocity of all the entity's links.
13451324 """
13461325 links_idx = self ._get_global_idx (links_idx_local , self .n_links , self ._link_start , unsafe = True )
1347- return self ._solver .get_links_vel (links_idx , envs_idx , ref = ref )
1326+ return self ._solver .get_links_vel (links_idx , envs_idx )
13481327
13491328 @gs .assert_built
13501329 def get_links_ang (self , links_idx_local = None , envs_idx = None ):
@@ -1800,6 +1779,7 @@ class RigidEntity(KinematicEntity):
18001779
18011780 if TYPE_CHECKING :
18021781 material : gs .materials .Rigid
1782+ _solver : "RigidSolver"
18031783
18041784 def __init__ (
18051785 self ,
@@ -3176,6 +3156,61 @@ def get_AABB(self, envs_idx=None, *, allow_fast_approx: bool = False):
31763156 def get_aabb (self ):
31773157 raise DeprecationError ("This method has been removed. Please use 'get_AABB()' instead." )
31783158
3159+ @gs .assert_built
3160+ def get_links_pos (
3161+ self ,
3162+ links_idx_local = None ,
3163+ envs_idx = None ,
3164+ * ,
3165+ ref : Literal ["link_origin" , "link_com" , "root_com" ] = "link_origin" ,
3166+ ):
3167+ """
3168+ Returns the position of a given reference point for all the entity's links.
3169+
3170+ Parameters
3171+ ----------
3172+ links_idx_local : None | array_like
3173+ The indices of the links. Defaults to None.
3174+ envs_idx : None | array_like, optional
3175+ The indices of the environments. If None, all environments will be considered. Defaults to None.
3176+ ref: "link_origin" | "link_com" | "root_com"
3177+ The reference point being used to express the position of each link.
3178+ * "root_com": center of mass of the sub-entities to which the link belongs. As a reminder, a single
3179+ kinematic tree (aka. 'RigidEntity') may compromise multiple "physical" entities, i.e. a kinematic tree
3180+ that may have at most one free joint, at its root.
3181+
3182+ Returns
3183+ -------
3184+ pos : torch.Tensor, shape (n_links, 3) or (n_envs, n_links, 3)
3185+ The position of all the entity's links.
3186+ """
3187+ links_idx = self ._get_global_idx (links_idx_local , self .n_links , self ._link_start , unsafe = True )
3188+ return self ._solver .get_links_pos (links_idx , envs_idx , ref = ref )
3189+
3190+ @gs .assert_built
3191+ def get_links_vel (
3192+ self , links_idx_local = None , envs_idx = None , * , ref : Literal ["link_origin" , "link_com" ] = "link_origin"
3193+ ):
3194+ """
3195+ Returns linear velocity of all the entity's links expressed at a given reference position in world coordinates.
3196+
3197+ Parameters
3198+ ----------
3199+ links_idx_local : None | array_like
3200+ The indices of the links. Defaults to None.
3201+ envs_idx : None | array_like, optional
3202+ The indices of the environments. If None, all environments will be considered. Defaults to None.
3203+ ref: "link_origin" | "link_com"
3204+ The reference point being used to expressed the velocity of each link.
3205+
3206+ Returns
3207+ -------
3208+ vel : torch.Tensor, shape (n_links, 3) or (n_envs, n_links, 3)
3209+ The linear velocity of all the entity's links.
3210+ """
3211+ links_idx = self ._get_global_idx (links_idx_local , self .n_links , self ._link_start , unsafe = True )
3212+ return self ._solver .get_links_vel (links_idx , envs_idx , ref = ref )
3213+
31793214 @gs .assert_built
31803215 def get_links_acc (self , links_idx_local = None , envs_idx = None ):
31813216 links_idx = self ._get_global_idx (links_idx_local , self .n_links , self ._link_start , unsafe = True )
0 commit comments