Skip to content

Commit fc0fc44

Browse files
committed
Fix z scaling
1 parent d60047a commit fc0fc44

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

gisnav/gisnav/_transformations.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,10 @@ def poses_to_twist(
443443
pose2.pose.pose.orientation.z,
444444
pose2.pose.pose.orientation.w,
445445
]
446-
r1 = tf_transformations.quaternion_matrix(q1)
447-
r2 = tf_transformations.quaternion_matrix(q2)
448-
r_diff = r2 * r1.T
449446

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+
)
452450

453451
# Converting quaternion to rotation vector (axis-angle)
454452
angle = 2 * np.arccos(q_diff[3]) # Compute the rotation angle

gisnav/gisnav/core/pose_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,10 @@ def camera_optical_twist_in_camera_optical_frame(
336336
x, y, z = (
337337
scaling * 320.0,
338338
scaling * 180.0,
339-
scaling * 205.0,
339+
scaling * -205.0,
340340
) # todo do not hard code
341341
previous_pose = tf_.create_identity_pose_stamped(x, y, z)
342+
previous_pose.header = msg.reference.header
342343
current_pose = self._get_pose(msg)
343344
if current_pose is not None:
344345
return tf_.poses_to_twist(current_pose, previous_pose)

0 commit comments

Comments
 (0)