File tree Expand file tree Collapse file tree 1 file changed +23
-8
lines changed Expand file tree Collapse file tree 1 file changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -467,14 +467,29 @@ def reach(self):
467
467
subsequently change this will not be reflected.
468
468
"""
469
469
if self ._reach is None :
470
- d = 0
471
- for link in self :
472
- for et in link .ets ():
473
- if et .isprismatic :
474
- d += abs (et .eta )
475
- if link .isprismatic and link .qlim is not None :
476
- d += link .qlim [1 ]
477
- self ._reach = d
470
+ d_all = []
471
+ for link in self .ee_links :
472
+ d = 0
473
+ while True :
474
+ for et in link .ets ():
475
+ if et .istranslation :
476
+ if et .isjoint :
477
+ # the length of a prismatic joint depends on the
478
+ # joint limits. They might be set in the ET
479
+ # or in the Link depending on how the robot
480
+ # was constructed
481
+ if link .qlim is not None :
482
+ d += max (link .qlim )
483
+ elif et .qlim is not None :
484
+ d += max (et .qlim )
485
+ else :
486
+ d += abs (et .eta )
487
+ link = link .parent
488
+ if link is None :
489
+ d_all .append (d )
490
+ break
491
+
492
+ self ._reach = max (d_all )
478
493
return self ._reach
479
494
480
495
# --------------------------------------------------------------------- #
You can’t perform that action at this time.
0 commit comments