Skip to content

Commit 176f21c

Browse files
authored
Merge pull request #287 from tassos/AL5D-support
Al5D Support
2 parents 8f11232 + 0592dcd commit 176f21c

File tree

15 files changed

+290
-0
lines changed

15 files changed

+290
-0
lines changed

roboticstoolbox/models/DH/AL5D.py

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
"""
2+
@author: Tassos Natsakis
3+
"""
4+
5+
import numpy as np
6+
from roboticstoolbox import DHRobot, RevoluteMDH
7+
from spatialmath import SE3
8+
9+
class AL5D(DHRobot):
10+
"""
11+
Class that models a Lynxmotion AL5D manipulator
12+
13+
:param symbolic: use symbolic constants
14+
:type symbolic: bool
15+
16+
``AL5D()`` is an object which models a Lynxmotion AL5D robot and
17+
describes its kinematic and dynamic characteristics using modified DH
18+
conventions.
19+
20+
.. runblock:: pycon
21+
22+
>>> import roboticstoolbox as rtb
23+
>>> robot = rtb.models.DH.AL5D()
24+
>>> print(robot)
25+
26+
Defined joint configurations are:
27+
28+
- qz, zero joint angle configuration
29+
30+
.. note::
31+
- SI units are used.
32+
33+
:References:
34+
35+
- 'Reference of the robot <http://www.lynxmotion.com/c-130-al5d.aspx>'_
36+
37+
.. codeauthor:: Tassos Natsakis
38+
""" # noqa
39+
40+
def __init__(self, symbolic=False):
41+
42+
if symbolic:
43+
import spatialmath.base.symbolic as sym
44+
zero = sym.zero()
45+
pi = sym.pi()
46+
else:
47+
from math import pi
48+
zero = 0.0
49+
50+
# robot length values (metres)
51+
a = [0, 0.002, 0.14679, 0.17751]
52+
d = [-0.06858, 0, 0, 0]
53+
54+
alpha = [pi, pi/2, pi, pi]
55+
offset = [pi/2, pi, -0.0427, -0.0427-pi/2]
56+
57+
# mass data as measured
58+
mass = [0.187, 0.044, 0.207, 0.081]
59+
60+
# center of mass as calculated through CAD model
61+
center_of_mass = [
62+
[0.01724, -0.00389, 0.00468],
63+
[0.07084, 0.00000, 0.00190],
64+
[0.05615, -0.00251, -0.00080],
65+
[0.04318, 0.00735, -0.00523],
66+
]
67+
68+
# moments of inertia are practically zero
69+
moments_of_inertia = [
70+
[0, 0, 0, 0, 0, 0],
71+
[0, 0, 0, 0, 0, 0],
72+
[0, 0, 0, 0, 0, 0],
73+
[0, 0, 0, 0, 0, 0]
74+
]
75+
76+
joint_limits = [
77+
[-pi/2, pi/2],
78+
[-pi/2, pi/2],
79+
[-pi,2, pi/2],
80+
[-pi/2, pi/2],
81+
]
82+
83+
links = []
84+
85+
for j in range(4):
86+
link = RevoluteMDH(
87+
d=d[j],
88+
a=a[j],
89+
alpha=alpha[j],
90+
offset=offset[j],
91+
r=center_of_mass[j],
92+
I=moments_of_inertia[j],
93+
G=1,
94+
B=0,
95+
Tc=[0,0],
96+
qlim=joint_limits[j]
97+
)
98+
links.append(link)
99+
100+
tool=SE3(0.07719,0,0)
101+
102+
super().__init__(
103+
links,
104+
name="AL5D",
105+
manufacturer="Lynxmotion",
106+
keywords=('dynamics', 'symbolic'),
107+
symbolic=symbolic,
108+
tool=tool
109+
)
110+
111+
# zero angles
112+
self.addconfiguration("home", np.array([pi/2, pi/2, pi/2, pi/2]))
113+
114+
if __name__ == '__main__': # pragma nocover
115+
116+
al5d = AL5D(symbolic=False)
117+
print(al5d)
118+
print(al5d.dyntable())

roboticstoolbox/models/DH/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from roboticstoolbox.models.DH.TwoLink import TwoLink
2222
from roboticstoolbox.models.DH.Hyper3d import Hyper3d
2323
from roboticstoolbox.models.DH.P8 import P8
24+
from roboticstoolbox.models.DH.AL5D import AL5D
2425

2526

2627
__all__ = [
@@ -47,4 +48,5 @@
4748
'Baxter',
4849
'TwoLink',
4950
'P8',
51+
'AL5D',
5052
]

roboticstoolbox/models/URDF/AL5D.py

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env python
2+
3+
import numpy as np
4+
from roboticstoolbox.robot.ERobot import ERobot
5+
from math import pi
6+
7+
class AL5D(ERobot):
8+
"""
9+
Class that imports a AL5D URDF model
10+
11+
``AL5D()`` is a class which imports a Lynxmotion AL5D robot definition
12+
from a URDF file. The model describes its kinematic and graphical
13+
characteristics.
14+
15+
.. runblock:: pycon
16+
17+
>>> import roboticstoolbox as rtb
18+
>>> robot = rtb.models.URDF.AL5D()
19+
>>> print(robot)
20+
21+
Defined joint configurations are:
22+
23+
- qz, zero joint angle configuration, 'L' shaped configuration
24+
- up, robot poiting upwards
25+
26+
.. codeauthor:: Tassos Natsakis
27+
"""
28+
29+
def __init__(self):
30+
31+
links, name, urdf_string, urdf_filepath = self.URDF_read(
32+
"al5d_description/urdf/al5d_robot.urdf"
33+
)
34+
35+
super().__init__(
36+
links,
37+
name=name,
38+
urdf_string=urdf_string,
39+
urdf_filepath=urdf_filepath,
40+
)
41+
42+
self.manufacturer = "Lynxmotion"
43+
44+
# zero angles, upper arm pointing up, lower arm straight ahead
45+
self.addconfiguration("qz", np.array([0, 0, 0, 0]))
46+
47+
# reference pose robot pointing upwards
48+
self.addconfiguration("up", np.array([0.0000, 0.0000, 1.5707, 0.0000]))
49+
50+
if __name__ == "__main__": # pragma nocover
51+
52+
robot = AL5D()
53+
print(robot)

roboticstoolbox/models/URDF/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from roboticstoolbox.models.URDF.LBR import LBR
2020
from roboticstoolbox.models.URDF.KinovaGen3 import KinovaGen3
2121
from roboticstoolbox.models.URDF.YuMi import YuMi
22+
from roboticstoolbox.models.URDF.AL5D import AL5D
2223

2324
__all__ = [
2425
"Panda",
@@ -42,4 +43,5 @@
4243
"LBR",
4344
"KinovaGen3",
4445
"YuMi",
46+
"AL5D",
4547
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?xml version="1.0" ?>
2+
<robot name="AL5D" xmlns:xacro="http://www.ros.org/wiki/xacro">
3+
<material name="gray">
4+
<color rgba="0.8 0.8 0.8 0.9"/>
5+
</material>
6+
<material name="black">
7+
<color rgba="0.3 0.3 0.3 0.9"/>
8+
</material>
9+
10+
<link name="base">
11+
<visual>
12+
<geometry>
13+
<mesh filename="package://al5d_description/meshes/base.stl" scale="0.001 0.001 0.001"/>
14+
</geometry>
15+
<origin rpy="0 0 0"/>
16+
<material name="black"/>
17+
</visual>
18+
<inertial>
19+
<mass value="0.092"/>
20+
<inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0"/>
21+
</inertial>
22+
</link>
23+
24+
<link name="link1">
25+
<visual>
26+
<geometry>
27+
<mesh filename="package://al5d_description/meshes/link1.stl" scale="0.001 0.001 0.001"/>
28+
</geometry>
29+
<origin rpy="0 0 0" xyz="0 0 0"/>
30+
<material name="black"/>
31+
</visual>
32+
<inertial>
33+
<mass value="0.187"/>
34+
<inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0"/>
35+
</inertial>
36+
</link>
37+
38+
<link name="link2">
39+
<visual>
40+
<geometry>
41+
<mesh filename="package://al5d_description/meshes/link2.stl" scale="0.001 0.001 0.001"/>
42+
</geometry>
43+
<origin xyz="0 0 0"/>
44+
<material name="gray"/>
45+
</visual>
46+
<inertial>
47+
<mass value="0.044"/>
48+
<inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0"/>
49+
</inertial>
50+
</link>
51+
52+
<link name="link3">
53+
<visual>
54+
<geometry>
55+
<mesh filename="package://al5d_description/meshes/link3.stl" scale="0.001 0.001 0.001"/>
56+
</geometry>
57+
<origin rpy="0 0 -0.0427" xyz="0 0 0"/>
58+
<material name="gray"/>
59+
</visual>
60+
<inertial>
61+
<mass value="0.207"/>
62+
<inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0"/>
63+
</inertial>
64+
</link>
65+
66+
<link name="link4">
67+
<visual>
68+
<geometry>
69+
<mesh filename="package://al5d_description/meshes/link4.stl" scale="0.001 0.001 0.001"/>
70+
</geometry>
71+
<origin rpy="0 0 1.528096327" xyz="0 0 0"/>
72+
<material name="black"/>
73+
</visual>
74+
<inertial>
75+
<mass value="0.081"/>
76+
<inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0.0" iyz="0.0" izz="0.0"/>
77+
</inertial>
78+
</link>
79+
80+
<joint name="j1" type="revolute">
81+
<parent link="base"/>
82+
<child link="link1"/>
83+
<origin rpy="0 3.141592653 0" xyz="0 0 0.06858"/>
84+
<axis xyz="0 0 1"/>
85+
<!-- This is descibed in child frame -->
86+
<limit effort="1000.0" lower="-1.570796325" upper="1.570796325" velocity="0"/>
87+
</joint>
88+
89+
<joint name="j2" type="revolute">
90+
<parent link="link1"/>
91+
<child link="link2"/>
92+
<origin rpy="0 1.570796325 -1.570796325" xyz="0.002 0 0"/>
93+
<axis xyz="0 0 1"/>
94+
<!-- This is descibed in child frame -->
95+
<limit effort="1000.0" lower="-1.570796325" upper="1.570796325" velocity="0"/>
96+
</joint>
97+
98+
<joint name="j3" type="revolute">
99+
<parent link="link2"/>
100+
<child link="link3"/>
101+
<origin rpy="0 3.141592653 1.570796325" xyz="0.14679 0 0"/>
102+
<axis xyz="0 0 1"/>
103+
<!-- This is descibed in child frame -->
104+
<limit effort="1000.0" lower="-1.570796325" upper="1.570796325" velocity="0"/>
105+
</joint>
106+
107+
<joint name="j4" type="revolute">
108+
<parent link="link3"/>
109+
<child link="link4"/>
110+
<origin rpy="3.141592653 0 1.570796325" xyz="0.17751 0 0"/>
111+
<axis xyz="0 0 1"/>
112+
<limit effort="1000.0" lower="-1.570796325" upper="1.570796325" velocity="0"/>
113+
</joint>
114+
</robot>
115+

0 commit comments

Comments
 (0)