From 7673aaf74214bb5fafbb432383161c4a8a324f6e Mon Sep 17 00:00:00 2001 From: Falko Schindler Date: Wed, 6 Dec 2017 09:11:52 +0100 Subject: [PATCH] changing sign of z_rotation() to follow conventions of a right-handed coordinate system with yaw, pitch and roll defined as right-handed rotations about z-, y- and x-axis (http://nghiaho.com/?page_id=846, http://planning.cs.uiuc.edu/node102.html); partly reverts pull request #200 (https://github.com/openmv/openmv/pull/200/files); relates to discussion in openmv forum (http://forums.openmv.io/viewtopic.php?f=6&t=538); note that rotation() is probably effected by this change (but it should not!) --- src/omv/img/apriltag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omv/img/apriltag.c b/src/omv/img/apriltag.c index 8e323e77c..a9fe06fe5 100644 --- a/src/omv/img/apriltag.c +++ b/src/omv/img/apriltag.c @@ -11943,7 +11943,7 @@ void imlib_find_apriltags(list_t *out, image_t *ptr, rectangle_t *roi, apriltag_ lnk_data.z_translation = MATD_EL(pose, 2, 3); lnk_data.x_rotation = fast_atan2f(MATD_EL(pose, 2, 1), MATD_EL(pose, 2, 2)); lnk_data.y_rotation = fast_atan2f(-MATD_EL(pose, 2, 0), fast_sqrtf(sq(MATD_EL(pose, 2, 1)) + sq(MATD_EL(pose, 2, 2)))); - lnk_data.z_rotation = -fast_atan2f(MATD_EL(pose, 1, 0), MATD_EL(pose, 0, 0)); + lnk_data.z_rotation = fast_atan2f(MATD_EL(pose, 1, 0), MATD_EL(pose, 0, 0)); matd_destroy(pose);