Skip to content

Commit d58b5f7

Browse files
committed
use first EE or gripper, with warning petercorke#243
1 parent 370139a commit d58b5f7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

roboticstoolbox/robot/ERobot.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -892,20 +892,19 @@ def _get_limit_links(self, end=None, start=None):
892892
tool = None
893893
if end is None:
894894

895-
# if we have a gripper, use it
896-
if len(self.grippers) == 1:
895+
if len(self.grippers) > 0:
897896
end = self.grippers[0].links[0]
898897
tool = self.grippers[0].tool
899-
elif len(self.grippers) > 1:
900-
# if more than one gripper, user must choose
901-
raise ValueError("Must specify which gripper")
898+
if len(self.grippers) > 1:
899+
# Warn user: more than one gripper
900+
print("More than one gripper present, using robot.grippers[0]")
902901

903902
# no grippers, use ee link if just one
904-
elif len(self.ee_links) == 1:
903+
elif len(self.ee_links) > 0:
905904
end = self.ee_links[0]
906-
else:
907-
# if more than one EE, user must choose
908-
raise ValueError("Must specify which end-effector")
905+
if len(self.ee_links) > 1:
906+
# Warn user: more than one EE
907+
print("More than one end-effector present, using robot.ee_links[0]")
909908

910909
# Cache result
911910
self._cache_end = end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy