File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -443,12 +443,10 @@ def poses_to_twist(
443
443
pose2 .pose .pose .orientation .z ,
444
444
pose2 .pose .pose .orientation .w ,
445
445
]
446
- r1 = tf_transformations .quaternion_matrix (q1 )
447
- r2 = tf_transformations .quaternion_matrix (q2 )
448
- r_diff = r2 * r1 .T
449
446
450
- # TODO do not convert to matrices above, just use quaternions
451
- q_diff = tf_transformations .quaternion_from_matrix (r_diff )
447
+ q_diff = tf_transformations .quaternion_multiply (
448
+ q2 , tf_transformations .quaternion_inverse (q1 )
449
+ )
452
450
453
451
# Converting quaternion to rotation vector (axis-angle)
454
452
angle = 2 * np .arccos (q_diff [3 ]) # Compute the rotation angle
Original file line number Diff line number Diff line change @@ -336,9 +336,10 @@ def camera_optical_twist_in_camera_optical_frame(
336
336
x , y , z = (
337
337
scaling * 320.0 ,
338
338
scaling * 180.0 ,
339
- scaling * 205.0 ,
339
+ scaling * - 205.0 ,
340
340
) # todo do not hard code
341
341
previous_pose = tf_ .create_identity_pose_stamped (x , y , z )
342
+ previous_pose .header = msg .reference .header
342
343
current_pose = self ._get_pose (msg )
343
344
if current_pose is not None :
344
345
return tf_ .poses_to_twist (current_pose , previous_pose )
You can’t perform that action at this time.
0 commit comments