Skip to content

Commit 6b12278

Browse files
committed
polish URDF doco
systematically add comments, and change URDF path specification
1 parent 1bfad9d commit 6b12278

File tree

17 files changed

+385
-87
lines changed

17 files changed

+385
-87
lines changed

roboticstoolbox/models/URDF/Mico.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,32 @@
66
import roboticstoolbox as rp
77

88

9-
class j2n4s300(ERobot):
9+
class Mico(ERobot):
10+
"""
11+
Class that imports a Mico URDF model
1012
11-
def __init__(self):
13+
``Panda()`` is a class which imports a Kinova Mico robot definition
14+
from a URDF file. The model describes its kinematic and graphical
15+
characteristics.
16+
17+
.. runblock:: pycon
18+
19+
>>> import roboticstoolbox as rtb
20+
>>> robot = rtb.models.URDF.Mico()
21+
>>> print(robot)
1222
13-
mpath = Path(rp.__file__).parent
14-
fpath = mpath / 'models' / 'xacro' / 'kinova_description' / 'urdf'
15-
fname = 'j2n4s300_standalone.xacro'
23+
Defined joint configurations are:
24+
25+
- qz, zero joint angle configuration, 'L' shaped configuration
26+
- qr, vertical 'READY' configuration
27+
28+
.. codeauthor:: Jesse Haviland
29+
.. sectionauthor:: Peter Corke
30+
"""
31+
def __init__(self):
1632

1733
args = super().urdf_to_ets_args(
18-
(fpath / fname).as_posix())
34+
"kinova_description/urdf/j2n4s300_standalone.xacro")
1935

2036
super().__init__(
2137
args[0],

roboticstoolbox/models/URDF/PR2.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ class PR2(ERobot):
99

1010
def __init__(self):
1111

12-
mpath = Path(rp.__file__).parent
13-
fpath = mpath / 'models' / 'xacro' / 'pr2_description' / 'robots'
14-
fname = 'pr2.urdf.xacro'
15-
tld = mpath / 'models' / 'xacro' / 'pr2_description'
16-
17-
args = super(PR2, self).urdf_to_ets_args(
18-
(fpath / fname).as_posix(), tld)
12+
args = super().urdf_to_ets_args(
13+
"pr2_description/robots/pr2.urdf.xacro",
14+
"pr2_description")
1915

2016
super(PR2, self).__init__(
2117
args[0],

roboticstoolbox/models/URDF/Panda.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,36 @@
33
import numpy as np
44
import roboticstoolbox as rp
55
from roboticstoolbox.robot.ERobot import ERobot
6-
from pathlib import Path
76

87

98
class Panda(ERobot):
9+
"""
10+
Class that imports a Panda URDF model
1011
11-
def __init__(self):
12+
``Panda()`` is a class which imports a Franka-Emika Panda robot definition
13+
from a URDF file. The model describes its kinematic and graphical
14+
characteristics.
15+
16+
.. runblock:: pycon
17+
18+
>>> import roboticstoolbox as rtb
19+
>>> robot = rtb.models.URDF.Panda()
20+
>>> print(robot)
1221
13-
mpath = Path(rp.__file__).parent
14-
fpath = mpath / 'models' / 'xacro' / 'franka_description' / 'robots'
15-
fname = 'panda_arm_hand.urdf.xacro'
22+
Defined joint configurations are:
23+
24+
- qz, zero joint angle configuration, 'L' shaped configuration
25+
- qr, vertical 'READY' configuration
26+
- qs, arm is stretched out in the x-direction
27+
- qn, arm is at a nominal non-singular configuration
28+
29+
.. codeauthor:: Jesse Haviland
30+
.. sectionauthor:: Peter Corke
31+
"""
32+
def __init__(self):
1633

17-
args = super(Panda, self).urdf_to_ets_args(
18-
(fpath / fname).as_posix())
34+
args = super().urdf_to_ets_args(
35+
"franka_description/robots/panda_arm_hand.urdf.xacro")
1936

2037
super().__init__(
2138
args[0],
@@ -36,4 +53,4 @@ def __init__(self):
3653
if __name__ == '__main__': # pragma nocover
3754

3855
robot = Panda()
39-
print(robot)
56+
print(robot.links)

roboticstoolbox/models/URDF/Puma560.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,34 @@
88

99

1010
class Puma560(ERobot):
11+
"""
12+
Class that imports a Puma 560 URDF model
1113
12-
def __init__(self):
14+
``Puma560()`` is a class which imports a Unimation Puma560 robot definition
15+
from a URDF file. The model describes its kinematic and graphical
16+
characteristics.
17+
18+
.. runblock:: pycon
19+
20+
>>> import roboticstoolbox as rtb
21+
>>> robot = rtb.models.URDF.Puma560()
22+
>>> print(robot)
23+
24+
Defined joint configurations are:
1325
14-
mpath = Path(rp.__file__).parent
15-
fpath = mpath / 'models' / 'xacro' / \
16-
'puma560_description' / 'urdf'
17-
fname = 'puma560_robot.urdf.xacro'
26+
- qz, zero joint angle configuration, 'L' shaped configuration
27+
- qr, vertical 'READY' configuration
28+
- qs, arm is stretched out in the x-direction
29+
- qn, arm is at a nominal non-singular configuration
30+
31+
.. codeauthor:: Jesse Haviland
32+
.. sectionauthor:: Peter Corke
33+
"""
34+
35+
def __init__(self):
1836

19-
args = super(Puma560, self).urdf_to_ets_args(
20-
(fpath / fname).as_posix())
37+
args = super().urdf_to_ets_args(
38+
"puma560_description/urdf/puma560_robot.urdf.xacro")
2139

2240
super().__init__(
2341
args[0],

roboticstoolbox/models/URDF/UR10.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,33 @@
77

88

99
class UR10(ERobot):
10+
"""
11+
Class that imports a UR10 URDF model
1012
11-
def __init__(self):
13+
``UR3()`` is a class which imports a Universal Robotics UR310 robot
14+
definition from a URDF file. The model describes its kinematic and
15+
graphical characteristics.
16+
17+
.. runblock:: pycon
18+
19+
>>> import roboticstoolbox as rtb
20+
>>> robot = rtb.models.URDF.UR10()
21+
>>> print(robot)
22+
23+
Defined joint configurations are:
1224
13-
mpath = Path(rp.__file__).parent
14-
fpath = mpath / 'models' / 'xacro' / 'ur_description' / 'urdf'
15-
fname = 'ur10_joint_limited_robot.urdf.xacro'
25+
- qz, zero joint angle configuration, 'L' shaped configuration
26+
- qr, vertical 'READY' configuration
27+
28+
.. codeauthor:: Jesse Haviland
29+
.. sectionauthor:: Peter Corke
30+
"""
31+
32+
def __init__(self):
1633

17-
args = super(UR10, self).urdf_to_ets_args((fpath / fname).as_posix())
34+
args = super().urdf_to_ets_args(
35+
"ur_description/urdf/ur10_joint_limited_robot.urdf.xacro"
36+
)
1837

1938
super().__init__(
2039
args[0],

roboticstoolbox/models/URDF/UR3.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,31 @@
77

88

99
class UR3(ERobot):
10+
"""
11+
Class that imports a UR3 URDF model
1012
11-
def __init__(self):
13+
``UR3()`` is a class which imports a Universal Robotics UR3 robot definition
14+
from a URDF file. The model describes its kinematic and graphical
15+
characteristics.
16+
17+
.. runblock:: pycon
18+
19+
>>> import roboticstoolbox as rtb
20+
>>> robot = rtb.models.URDF.UR3()
21+
>>> print(robot)
1222
13-
mpath = Path(rp.__file__).parent
14-
fpath = mpath / 'models' / 'xacro' / 'ur_description' / 'urdf'
15-
fname = 'ur3_joint_limited_robot.urdf.xacro'
23+
Defined joint configurations are:
24+
25+
- qz, zero joint angle configuration, 'L' shaped configuration
26+
- qr, vertical 'READY' configuration
27+
28+
.. codeauthor:: Jesse Haviland
29+
.. sectionauthor:: Peter Corke
30+
"""
31+
def __init__(self):
1632

17-
args = self.urdf_to_ets_args((fpath / fname).as_posix())
33+
args = self.urdf_to_ets_args(
34+
"ur_description/urdf/ur3_joint_limited_robot.urdf.xacro")
1835

1936
super().__init__(
2037
args[0],

roboticstoolbox/models/URDF/UR5.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,36 @@
77

88

99
class UR5(ERobot):
10+
"""
11+
Class that imports a UR5 URDF model
12+
13+
``UR3()`` is a class which imports a Universal Robotics UR5 robot definition
14+
from a URDF file. The model describes its kinematic and graphical
15+
characteristics.
16+
17+
.. runblock:: pycon
18+
19+
>>> import roboticstoolbox as rtb
20+
>>> robot = rtb.models.URDF.UR5()
21+
>>> print(robot)
22+
23+
Defined joint configurations are:
24+
25+
- qz, zero joint angle configuration, 'L' shaped configuration
26+
- qr, vertical 'READY' configuration
27+
28+
.. codeauthor:: Jesse Haviland
29+
.. sectionauthor:: Peter Corke
30+
"""
1031

1132
def __init__(self):
1233

1334
mpath = Path(rp.__file__).parent
1435
fpath = mpath / 'models' / 'xacro' / 'ur_description' / 'urdf'
1536
fname = 'ur5_joint_limited_robot.urdf.xacro'
1637

17-
args = super().urdf_to_ets_args((fpath / fname).as_posix())
38+
args = super().urdf_to_ets_args(
39+
"ur_description/urdf/ur5_joint_limited_robot.urdf.xacro")
1840

1941
super().__init__(
2042
args[0],

roboticstoolbox/models/URDF/px100.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,34 @@
77

88

99
class px100(ERobot):
10+
"""
11+
Class that imports a PX100 URDF model
1012
11-
def __init__(self):
13+
``px100()`` is a class which imports an Interbotix px100 robot definition
14+
from a URDF file. The model describes its kinematic and graphical
15+
characteristics.
16+
17+
.. runblock:: pycon
18+
19+
>>> import roboticstoolbox as rtb
20+
>>> robot = rtb.models.URDF.px100()
21+
>>> print(robot)
1222
13-
mpath = Path(rp.__file__).parent
14-
fpath = mpath / 'models' / 'xacro' / 'interbotix_descriptions' / 'urdf'
15-
fname = 'px100.urdf.xacro'
23+
Defined joint configurations are:
24+
25+
- qz, zero joint angle configuration, 'L' shaped configuration
26+
- qr, vertical 'READY' configuration
27+
28+
:reference:
29+
- http://www.support.interbotix.com/html/specifications/px100.html
30+
31+
.. codeauthor:: Jesse Haviland
32+
.. sectionauthor:: Peter Corke
33+
"""
34+
def __init__(self):
1635

1736
args = super().urdf_to_ets_args(
18-
(fpath / fname).as_posix())
37+
"interbotix_descriptions/urdf/px100.urdf.xacro")
1938

2039
super().__init__(
2140
args[0],
@@ -32,4 +51,4 @@ def __init__(self):
3251
if __name__ == '__main__': # pragma nocover
3352

3453
robot = px100()
35-
print(robot)
54+
print(robot.links[0].mesh)

roboticstoolbox/models/URDF/px150.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,34 @@
77

88

99
class px150(ERobot):
10+
"""
11+
Class that imports a PX150 URDF model
1012
11-
def __init__(self):
13+
``px150()`` is a class which imports an Interbotix px150 robot definition
14+
from a URDF file. The model describes its kinematic and graphical
15+
characteristics.
16+
17+
.. runblock:: pycon
18+
19+
>>> import roboticstoolbox as rtb
20+
>>> robot = rtb.models.URDF.px150()
21+
>>> print(robot)
22+
23+
Defined joint configurations are:
1224
13-
mpath = Path(rp.__file__).parent
14-
fpath = mpath / 'models' / 'xacro' / 'interbotix_descriptions' / 'urdf'
15-
fname = 'px150.urdf.xacro'
25+
- qz, zero joint angle configuration, 'L' shaped configuration
26+
- qr, vertical 'READY' configuration
27+
28+
:reference:
29+
- http://www.support.interbotix.com/html/specifications/px150.html
30+
31+
.. codeauthor:: Jesse Haviland
32+
.. sectionauthor:: Peter Corke
33+
"""
34+
def __init__(self):
1635

1736
args = super().urdf_to_ets_args(
18-
(fpath / fname).as_posix())
37+
"interbotix_descriptions/urdf/px150.urdf.xacro")
1938

2039
super().__init__(
2140
args[0],

roboticstoolbox/models/URDF/rx150.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,34 @@
77

88

99
class rx150(ERobot):
10+
"""
11+
Class that imports a RX150 URDF model
1012
11-
def __init__(self):
13+
``rx150()`` is a class which imports an Interbotix rx150 robot definition
14+
from a URDF file. The model describes its kinematic and graphical
15+
characteristics.
16+
17+
.. runblock:: pycon
18+
19+
>>> import roboticstoolbox as rtb
20+
>>> robot = rtb.models.URDF.rx150()
21+
>>> print(robot)
22+
23+
Defined joint configurations are:
1224
13-
mpath = Path(rp.__file__).parent
14-
fpath = mpath / 'models' / 'xacro' / 'interbotix_descriptions' / 'urdf'
15-
fname = 'rx150.urdf.xacro'
25+
- qz, zero joint angle configuration, 'L' shaped configuration
26+
- qr, vertical 'READY' configuration
27+
28+
:reference:
29+
- http://www.support.interbotix.com/html/specifications/rx150.html
30+
31+
.. codeauthor:: Jesse Haviland
32+
.. sectionauthor:: Peter Corke
33+
"""
34+
def __init__(self):
1635

1736
args = super().urdf_to_ets_args(
18-
(fpath / fname).as_posix())
37+
"interbotix_descriptions/urdf/rx150.urdf.xacro")
1938

2039
super().__init__(
2140
args[0],

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