Skip to content

Commit

Permalink
uid
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyanx02 committed Jan 5, 2025
1 parent bc2e122 commit 5aa897b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions genesis/engine/entities/rigid_entity/rigid_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,16 +1447,16 @@ def get_joint(self, name=None, id=None):
else:
gs.raise_exception("Neither `name` nor `id` is provided.")

def get_link(self, name=None, id=None):
def get_link(self, name=None, uid=None):
"""
Get a RigidLink object by name or id.
Get a RigidLink object by name or uid.
Parameters
----------
name : str, optional
The name of the link. Defaults to None.
id : str, optional
The id of the link. This can be a substring of the link's id. Defaults to None.
uid : str, optional
The uid of the link. This can be a substring of the link's uid. Defaults to None.
Returns
-------
Expand All @@ -1470,14 +1470,14 @@ def get_link(self, name=None, id=None):
return link
gs.raise_exception(f"Link not found for name: {name}.")

elif id is not None:
elif uid is not None:
for link in self._links:
if id in str(link.id):
if uid in str(link.uid):
return link
gs.raise_exception(f"Link not found for id: {id}.")
gs.raise_exception(f"Link not found for uid: {uid}.")

else:
gs.raise_exception("Neither `name` nor `id` is provided.")
gs.raise_exception("Neither `name` nor `uid` is provided.")

@gs.assert_built
def get_pos(self, envs_idx=None):
Expand Down

0 comments on commit 5aa897b

Please sign in to comment.