Skip to content

Commit

Permalink
Delete pose2.t only if a second solution has been computed. (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-trinh authored and mkrogius committed Apr 8, 2019
1 parent a5ab81d commit b3949d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apriltag_pose.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,10 @@ double estimate_tag_pose(apriltag_detection_info_t* info, apriltag_pose_t* pose)
if (err1 <= err2) {
pose->R = pose1.R;
pose->t = pose1.t;
if (pose2.R) {
matd_destroy(pose2.t);
}
matd_destroy(pose2.R);
matd_destroy(pose2.t);
return err1;
} else {
pose->R = pose2.R;
Expand Down

0 comments on commit b3949d2

Please sign in to comment.