@@ -33,20 +33,14 @@ def test_configurations_str(self):
33
33
34
34
def test_dyntable (self ):
35
35
r = rp .models .DH .Puma560 ()
36
- r .dyntable ()
36
+ r .dynamics ()
37
37
38
38
def test_linkcolormap (self ):
39
39
r = rp .models .DH .Puma560 ()
40
40
r .linkcolormap ()
41
41
42
42
r .linkcolormap (['r' , 'r' , 'r' , 'r' , 'r' , 'r' ])
43
43
44
- def test_base_error (self ):
45
- r = rp .models .DH .Puma560 ()
46
-
47
- with self .assertRaises (ValueError ):
48
- r .base = 2
49
-
50
44
def test_tool_error (self ):
51
45
r = rp .models .DH .Puma560 ()
52
46
@@ -80,32 +74,37 @@ def test_ikine_LM(self):
80
74
sol3 = panda .ikine_LM (T , q0 = [0 , 1.4 , 0 , 1 , 0 , 0.5 , 1 ])
81
75
82
76
self .assertTrue (sol1 .success )
83
- self .assertAlmostEqual (np .linalg .norm (T - panda .fkine (sol1 .q )), 0 , places = 4 )
77
+ self .assertAlmostEqual (np .linalg .norm (
78
+ T - panda .fkine (sol1 .q )), 0 , places = 4 )
84
79
85
80
self .assertTrue (sol2 .success [0 ])
86
- self .assertAlmostEqual (np .linalg .norm (T - panda .fkine (sol2 .q [0 ,:])), 0 , places = 4 )
81
+ self .assertAlmostEqual (np .linalg .norm (
82
+ T - panda .fkine (sol2 .q [0 , :])), 0 , places = 4 )
87
83
self .assertTrue (sol2 .success [0 ])
88
- self .assertAlmostEqual (np .linalg .norm (T - panda .fkine (sol2 .q [1 ,:])), 0 , places = 4 )
84
+ self .assertAlmostEqual (np .linalg .norm (
85
+ T - panda .fkine (sol2 .q [1 , :])), 0 , places = 4 )
89
86
90
87
self .assertTrue (sol3 .success )
91
- self .assertAlmostEqual (np .linalg .norm (T - panda .fkine (sol3 .q )), 0 , places = 4 )
88
+ self .assertAlmostEqual (np .linalg .norm (
89
+ T - panda .fkine (sol3 .q )), 0 , places = 4 )
92
90
93
91
with self .assertRaises (ValueError ):
94
- panda .ikine_LM (T , q0 = [1 ,2 ])
92
+ panda .ikine_LM (T , q0 = [1 , 2 ])
95
93
96
94
def test_ikine_LM_mask (self ):
97
95
98
96
# simple RR manipulator, solve with mask
99
97
100
98
l0 = rp .RevoluteDH (a = 2.0 )
101
99
l1 = rp .RevoluteDH (a = 1 )
102
-
100
+
103
101
r = rp .DHRobot ([l0 , l1 ]) # RR manipulator
104
102
T = sm .SE3 (- 1 , 2 , 0 )
105
103
sol = r .ikine_LM (T , mask = [1 , 1 , 0 , 0 , 0 , 0 ])
106
104
107
105
self .assertTrue (sol .success )
108
- self .assertAlmostEqual (np .linalg .norm (T .t [:2 ] - r .fkine (sol .q ).t [:2 ]), 0 , places = 4 )
106
+ self .assertAlmostEqual (np .linalg .norm (
107
+ T .t [:2 ] - r .fkine (sol .q ).t [:2 ]), 0 , places = 4 )
109
108
110
109
# test initial condition search, drop iteration limit so it has to do
111
110
# some searching
@@ -114,7 +113,8 @@ def test_ikine_LM_mask(self):
114
113
ilimit = 8 , search = True )
115
114
116
115
self .assertTrue (sol .success )
117
- self .assertAlmostEqual (np .linalg .norm (T .t [:2 ] - r .fkine (sol .q ).t [:2 ]), 0 , places = 4 )
116
+ self .assertAlmostEqual (np .linalg .norm (
117
+ T .t [:2 ] - r .fkine (sol .q ).t [:2 ]), 0 , places = 4 )
118
118
119
119
def test_ikine_LM_transpose (self ):
120
120
# need to test this on a robot with squarish Jacobian, choose Puma
@@ -127,7 +127,6 @@ def test_ikine_LM_transpose(self):
127
127
self .assertTrue (sol .success )
128
128
self .assertAlmostEqual (np .linalg .norm (T - r .fkine (sol .q )), 0 , places = 4 )
129
129
130
-
131
130
def test_ikine_con (self ):
132
131
panda = rp .models .DH .Panda ()
133
132
q = np .array ([0 , - 0.3 , 0 , - 2.2 , 0 , 2.0 , np .pi / 4 ])
@@ -142,7 +141,8 @@ def test_ikine_con(self):
142
141
sol2 = panda .ikine_min (Tt , qlim = True )
143
142
144
143
self .assertTrue (sol1 .success )
145
- self .assertAlmostEqual (np .linalg .norm (T - panda .fkine (sol1 .q )), 0 , places = 4 )
144
+ self .assertAlmostEqual (np .linalg .norm (
145
+ T - panda .fkine (sol1 .q )), 0 , places = 4 )
146
146
nt .assert_array_almost_equal (
147
147
T .A - panda .fkine (sol1 .q ).A , np .zeros ((4 , 4 )), decimal = 4 )
148
148
@@ -153,7 +153,6 @@ def test_ikine_con(self):
153
153
nt .assert_array_almost_equal (
154
154
T .A - panda .fkine (sol2 [1 ].q ).A , np .zeros ((4 , 4 )), decimal = 4 )
155
155
156
-
157
156
def test_ikine_unc (self ):
158
157
puma = rp .models .DH .Puma560 ()
159
158
q = puma .qn
@@ -170,7 +169,7 @@ def test_ikine_unc(self):
170
169
self .assertTrue (sol1 [1 ].success )
171
170
nt .assert_array_almost_equal (
172
171
T .A - puma .fkine (sol1 [1 ].q ).A , np .zeros ((4 , 4 )), decimal = 4 )
173
-
172
+
174
173
self .assertTrue (sol2 .success )
175
174
nt .assert_array_almost_equal (
176
175
T .A - puma .fkine (sol2 .q ).A , np .zeros ((4 , 4 )), decimal = 4 )
@@ -190,8 +189,8 @@ def test_ikine_unc(self):
190
189
unittest .main ()
191
190
# pytest.main(['tests/test_SerialLink.py'])
192
191
193
- # import roboticstoolbox as rtb
194
- # from spatialmath import SE3
192
+ # import roboticstoolbox as rtb
193
+ # from spatialmath import SE3
195
194
196
195
# l0 = rtb.RevoluteDH(a=2.0)
197
196
# l1 = rtb.RevoluteDH(a=1)
@@ -211,7 +210,6 @@ def test_ikine_unc(self):
211
210
# # print(sol)
212
211
# # print(r1.fkine(sol.q))
213
212
214
-
215
213
# sol = r1.ikine_LM(
216
214
# T, mask=[1, 1, 0, 0, 0, 0],
217
215
# ilimit=8, search=True)
0 commit comments