8000 Merge branch 'master' of github.com:petercorke/robotics-toolbox-python · oridong/robotics-toolbox-python@aa07739 · GitHub
[go: up one dir, main page]

Skip to content

Commit aa07739

Browse files
committed
Merge branch 'master' of github.com:petercorke/robotics-toolbox-python
2 parents a90edc5 + 5468a89 commit aa07739

File tree

17 files changed

+1492
-1594
lines changed

17 files changed

+1492
-1594
lines changed

roboticstoolbox/models/ETS/Planar2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import numpy as np
44
from roboticstoolbox.robot.ETS import ETS2
5-
from roboticstoolbox.robot.ERobot import ERobot
6-
from roboticstoolbox.robot.ELink import ELink
5+
from roboticstoolbox.robot.ERobot import ERobot2
6+
from roboticstoolbox.robot.ELink import ELink2
77

88

9-
class Planar2(ERobot):
9+
class Planar2(ERobot2):
1010
"""
1111
Create model of a branched planar manipulator::
1212
@@ -29,9 +29,9 @@ def __init__(self):
2929

3030
# ets = ETS2.r() * ETS2.tx(a1) * ETS2.r() * ETS2.tx(a2)
3131

32-
l0 = ELink(ETS2.r(), name='link0')
33-
l1 = ELink(ETS2.tx(a1) * ETS2.r(), name='link1', parent=l0)
34-
l2 = ELink(ETS2.tx(a2), name='ee', parent=l1)
32+
l0 = ELink2(ETS2.r(), name='link0')
33+
l1 = ELink2(ETS2.tx(a1) * ETS2.r(), name='link1', parent=l0)
34+
l2 = ELink2(ETS2.tx(a2), name='ee', parent=l1)
3535

3636
super().__init__(
3737
[l0, l1, l2],

roboticstoolbox/models/URDF/LBR.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class LBR(ERobot):
3131

3232
def __init__(self):
3333

34-
elinks, name = super().urdf_to_ets_args(
34+
links, name = self.URDF_read(
3535
"kuka_description/kuka_lbr_iiwa/urdf/lbr_iiwa_14_r820.xacro")
3636

3737
super().__init__(
38-
elinks,
38+
links,
3939
name=name,
4040
manufacturer='Kuka'
4141
# gripper_links=elinks[9]

roboticstoolbox/models/URDF/Puma560.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ class Puma560(ERobot):
2626
- qs, arm is stretched out in the x-direction
2727
- qn, arm is at a nominal non-singular configuration
2828
29+
.. warning:: This file has been modified so that the zero-angle pose is the
30+
same as the DH model in the toolbox. ``j3`` rotation is changed from
31+
-𝜋/2 to 𝜋/2. Dimensions are also slightly different. Both models
32+
include the pedestal height.
33+
34+
.. note:: The original file is from https://github.com/nimasarli/puma560_description/blob/master/urdf/puma560_robot.urdf.xacro
35+
2936
.. codeauthor:: Jesse Haviland
3037
.. sectionauthor:: Peter Corke
3138
"""

roboticstoolbox/models/URDF/YuMi.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,23 @@ class YuMi(ERobot):
3232
def __init__(self):
3333

3434
links, name = self.URDF_read(
35-
"yumi_description/urdf/yumi.xacro")
35+
"yumi_description/urdf/yumi.urdf")
3636

3737
super().__init__(
3838
links,
3939
name=name,
40-
manufacturer='ABB'
40+
manufacturer='ABB',
41+
# gripper_links=links[20]
4142
)
4243

43-
self.addconfiguration(
44-
"qz", np.array([0, 0, 0, 0, 0, 0, 0]))
45-
self.addconfiguration(
46-
"qr", np.array([0, -0.3, 0, -2.2, 0, 2.0, np.pi/4]))
44+
# self.addconfiguration(
45+
# "qz", np.zeros((14,)))
46+
# self.addconfiguration(
47+
# "qr", np.array([0, -0.3, 0, -2.2, 0, 2.0, np.pi/4]))
4748

4849

4950
if __name__ == '__main__': # pragma nocover
5051

5152
robot = YuMi()
5253
print(robot)
54+

roboticstoolbox/models/URDF/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from roboticstoolbox.models.URDF.PR2 import PR2
1818
from roboticstoolbox.models.URDF.LBR import LBR
1919
from roboticstoolbox.models.URDF.KinovaGen3 import KinovaGen3
20+
from roboticstoolbox.models.URDF.YuMi import YuMi
2021

2122
__all__ = [
2223
'Panda',
@@ -37,5 +38,6 @@
3738
'Mico',
3839
'PR2',
3940
'LBR',
40-
'KinovaGen3'
41+
'KinovaGen3',
42+
'YuMi'
4143
]

roboticstoolbox/models/list.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from roboticstoolbox.robot.BaseRobot import BaseRobot
21
from roboticstoolbox.robot.Robot import Robot
3-
from roboticstoolbox.robot.Robot2 import Robot2
2+
from roboticstoolbox.robot.ERobot import ERobot2
43
from ansitable import ANSITable, Column
54
# import importlib
65

@@ -58,7 +57,7 @@ def make_table(border):
5857
for category in categories:
5958
group = m.__dict__[category]
6059
for cls in group.__dict__.values():
61-
if isinstance(cls, type) and issubclass(cls, BaseRobot):
60+
if isinstance(cls, type) and issubclass(cls, Robot):
6261
# we found a BaseRobot subclass, instantiate it
6362
try:
6463
robot = cls()
@@ -77,10 +76,11 @@ def make_table(border):
7776
continue # pragma nocover
7877

7978
dims = 0
80-
if isinstance(robot, Robot):
81-
dims = 3
82-
elif isinstance(robot, Robot2):
79+
80+
if isinstance(robot, ERobot2):
8381
dims = 2
82+
else:
83+
dims = 3
8484
# add the row
8585
table.row(
8686
cls.__name__,

roboticstoolbox/robot/BaseRobot.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

roboticstoolbox/robot/DHRobot.py

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,12 @@ def __str__(self):
121121
:return: Pretty print of the robot model
122122
:rtype: str
123123
"""
124-
if self.mdh:
125-
dh = "modified"
126-
else:
127-
dh = "standard"
128-
if self.manufacturer is None:
129-
manuf = ""
130-
else:
131-
manuf = f" (by {self.manufacturer})"
132-
s = f"{self.name}{manuf}: {self.n} axes ({self.structure})"
124+
125+
s = f"DHRobot: {self.name}"
126+
127+
if self.manufacturer is not None and len(self.manufacturer) > 0:
128+
s += f" (by {self.manufacturer})"
129+
s += f", {self.n} joints ({self.structure})"
133130

134131
deg = 180 / np.pi
135132

@@ -138,6 +135,10 @@ def __str__(self):
138135
if any([link.mesh is not None for link in self.links]):
139136
s += ", geometry"
140137

138+
if self.mdh:
139+
dh = "modified"
140+
else:
141+
dh = "standard"
141142
s += f", {dh} DH parameters\n"
142143

143144
def qstr(j, link):
@@ -975,7 +976,7 @@ def jacobe(self, q, half=None):
975976

976977
return J
977978

978-
def jacob0(self, q=None, T=None, half=None, analytical=None):
979+
def jacob0(self, q=None, T=None, half=None, analytical=None, start=None, end=None):
979980
r"""
980981
Manipulator Jacobian in world frame
981982
@@ -1069,7 +1070,7 @@ def jacob0(self, q=None, T=None, half=None, analytical=None):
10691070
return J0
10701071

10711072

1072-
def hessian0(self, q=None, J0=None):
1073+
def hessian0(self, q=None, J0=None, start=None, end=None):
10731074
r"""
10741075
Manipulator Hessian in base frame
10751076
@@ -1124,6 +1125,12 @@ def hessian0(self, q=None, J0=None):
11241125
"""
11251126

11261127
return self.ets().hessian0(q, J0)
1128+
1129+
def _get_limit_links(self, end=None, start=None):
1130+
# For compatibility with ERobot
1131+
1132+
return None, None, None
1133+
11271134
# -------------------------------------------------------------------------- #
11281135

11291136
def _init_rne(self):
@@ -1612,10 +1619,13 @@ def ikine_6s(self, T, config, ikfunc):
16121619

16131620
solutions.append(solution)
16141621

1615-
if len(solutions) == 1:
1622+
if len(T) == 1:
16161623
return solutions[0]
16171624
else:
1618-
return solutions
1625+
return iksol(
1626+
np.vstack([sol.q for sol in solutions]),
1627+
np.array([sol.success for sol in solutions]),
1628+
[sol.reason for sol in solutions])
16191629

16201630
def config_validate(self, config, allowables):
16211631
"""

0 commit comments

Comments
 (0)
0