@@ -127,6 +127,8 @@ def test_rot2jac(self):
127127 nt .assert_array_almost_equal (A3 , exp2jac (gamma ))
128128
129129 def test_angvelxform (self ):
130+ # compare inverse result against rpy/eul/exp2jac
131+ # compare forward and inverse results
130132
131133 gamma = [0.1 , 0.2 , 0.3 ]
132134 A = angvelxform (gamma , full = False , representation = "rpy/zyx" )
@@ -152,6 +154,73 @@ def test_angvelxform(self):
152154 nt .assert_array_almost_equal (Ai , exp2jac (gamma ))
153155 nt .assert_array_almost_equal (A @ Ai , np .eye (3 ))
154156
157+
158+ def test_angvelxform_dot_eul (self ):
159+ rep = 'eul'
160+ gamma = [0.1 , 0.2 , 0.3 ]
161+ gamma_d = [2 , 3 , 4 ]
162+ H = numhess (lambda g : angvelxform (g , representation = rep , full = False ), gamma )
163+ Adot = np .zeros ((3 ,3 ))
164+ for i in range (3 ):
165+ Adot += H [:, :, i ] * gamma_d [i ]
166+ res = angvelxform_dot (gamma , gamma_d , representation = rep , full = False )
167+ nt .assert_array_almost_equal (Adot , res , decimal = 4 )
168+
169+ def test_angvelxform_dot_rpy_xyz (self ):
170+ rep = 'rpy/xyz'
171+ gamma = [0.1 , 0.2 , 0.3 ]
172+ gamma_d = [2 , 3 , 4 ]
173+ H = numhess (lambda g : angvelxform (g , representation = rep , full = False ), gamma )
174+ Adot = np .zeros ((3 ,3 ))
175+ for i in range (3 ):
176+ Adot += H [:, :, i ] * gamma_d [i ]
177+ res = angvelxform_dot (gamma , gamma_d , representation = rep , full = False )
178+ nt .assert_array_almost_equal (Adot , res , decimal = 4 )
179+
180+ def test_angvelxform_dot_rpy_zyx (self ):
181+ rep = 'rpy/zyx'
182+ gamma = [0.1 , 0.2 , 0.3 ]
183+ gamma_d = [2 , 3 , 4 ]
184+ H = numhess (lambda g : angvelxform (g , representation = rep , full = False ), gamma )
185+ Adot = np .zeros ((3 ,3 ))
186+ for i in range (3 ):
187+ Adot += H [:, :, i ] * gamma_d [i ]
188+ res = angvelxform_dot (gamma , gamma_d , representation = rep , full = False )
189+ nt .assert_array_almost_equal (Adot , res , decimal = 4 )
190+
191+ @unittest .skip ("bug in angvelxform_dot for exponential coordinates" )
192+ def test_angvelxform_dot_exp (self ):
193+ rep = 'exp'
194+ gamma = [0.1 , 0.2 , 0.3 ]
195+ gamma_d = [2 , 3 , 4 ]
196+ H = numhess (lambda g : angvelxform (g , representation = rep , full = False ), gamma )
197+ Adot = np .zeros ((3 ,3 ))
198+ for i in range (3 ):
199+ Adot += H [:, :, i ] * gamma_d [i ]
200+ res = angvelxform_dot (gamma , gamma_d , representation = rep , full = False )
201+ nt .assert_array_almost_equal (Adot , res , decimal = 4 )
202+
203+ def test_x_tr (self ):
204+ # test transformation between pose and task-space vector representation
205+
206+ T = transl (1 , 2 , 3 ) @ eul2tr ((0.2 , 0.3 , 0.4 ))
207+
208+ x = tr2x (T )
209+ nt .assert_array_almost_equal (x2tr (x ), T )
210+
211+ x = tr2x (T , representation = 'eul' )
212+ nt .assert_array_almost_equal (x2tr (x , representation = 'eul' ), T )
213+
214+ x = tr2x (T , representation = 'rpy/xyz' )
215+ nt .assert_array_almost_equal (x2tr (x , representation = 'rpy/xyz' ), T )
216+
217+ x = tr2x (T , representation = 'rpy/zyx' )
218+ nt .assert_array_almost_equal (x2tr (x , representation = 'rpy/zyx' ), T )
219+
220+ x = tr2x (T , representation = 'exp' )
221+ nt .assert_array_almost_equal (x2tr (x , representation = 'exp' ), T )
222+
223+
155224 # def test_angvelxform_dot(self):
156225
157226 # gamma = [0.1, 0.2, 0.3]
0 commit comments