-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
Fix handeye #24897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handeye #24897
Conversation
|
@JStech Great job! Thanks a lot for the contribution! We need some time to analyze the implementation and understand the fix. |
|
/cc @catree |
catree
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //Rotation axis for Rcij | ||
| Mat Pcij = 2*rot2quatMinimal(Hcij); | ||
|
|
||
| // Discard motions with rotation too small or too close to pi radians |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
|
|
||
| Mat qgij = rot2quat(Rgij); | ||
| if (qgij.at<double>(0, 0) < 0) { | ||
| qgij *= -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this can be checked with this online tool: https://www.andre-gaschler.com/rotationconverter/
JStech
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, @catree.
MoveIt Calibration uses crigroup/handeye under the hood. I don't see any condition checking on the Tsai method, so it might be susceptible to the same issue (although they don't use all pairs of poses, just the motions in order). Their Daniilidis implementation uses a dual quaternion function that won't generate a negative real component (because the angle output by the axis-angle function comes from atan2, which only outputs [-pi, pi]).
|
The failed checks aren't related to the changes. Can I retrigger CI somehow? |
|
CI is still failing, and it seems unrelated to the patch: π€· |
|
@catree Is the PR redy for integration. |
|
@asmorkalov Looks good to me π |
Fixes to the hand-eye calibration methods, from #24871.
The Tsai method is sensitive to poses separated by small rotations, so I filter those out.
The Horaud and Daniilidis methods use quaternions (and dual quaternions), where$q$ and $-q$ represent the same transform. However, these methods depend on the gripper motion and camera motion having the same sign for the real part. The fix was simply to multiply the (dual) quaternions by -1 if their real part is negative.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.
The feature is well documented and sample code can be built with the project CMakeN/A