-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add a script to use OpenCV's calibration for the eye-to-hand case #943
Comments
Looking at the eye-in-hand script and thinking about what needs to change to accommodate the change of variant... The first thing I notice is this verification: atom/atom_evaluation/scripts/other_calibrations/cv_eye_in_hand.py Lines 95 to 133 in e28f67e
This doesn't make much sense in the eye-to-hand case, since the hand is not supposed to be in the chain between the base and camera. It is, however, supposed to be in the chain between the base and pattern. I'll change this verification to check for that instead. |
Simply changing the camera to the pattern in this verification doesn't work, as I suspected, since the getChain() gets the tf chain from the base to the pattern (base to world to pattern, which doesn't go through the hand link). What I can do is check that we aren't in an eye-in-hand configuration, meaning I simply check that, in the chain from the camera link to the base link, the hand link isn't there. The chain should be: If the hand link belongs to the chain, we know the configuration is wrong. |
The second verification, I'm not so sure about: atom/atom_evaluation/scripts/other_calibrations/cv_eye_in_hand.py Lines 135 to 146 in e28f67e
Obviously, it doesn't really work in an eye-to-hand configuration. But should there be another verification here in it's place? Maybe I check if the hand-pattern tf is fixed? |
Added an additional check for if the hand link is in the chain between the pattern link and the base link... I wasn't thinking right before when I said it wouldn't work, but I think the additional check I added is good, if redundant (maybe its "mirror" should be included in the eye-in-hand?) |
This check is not working properly... I forgot the pattern link is not in the transformation pool acquired from the collections. But I think the check can still be made easily. I'll fix it soon. |
Fixed this by checking for the pattern's parent link. That way the getChain() function works properly |
Again, I wasn't thinking right. We can just check if the TF from the hand link to the pattern is fixed. As above, though, we need to use the pattern link's parent for this:
|
The next step is to look at the transformations calculated and the ones we effectively want, which will change with regards to the eye-in-hand variant. |
Right. Makes sense.
Perhaps check that the the camera to base chain only contains fixed transforms? Also, perhaps check that the base to pattern contains the hand chain. |
Implemented! Now, the OpenCV calibration returns |
this is using the cvcalibrateHandEye? It only returns one transformation, in the case of the eye-in-hand the hand to camera, in the case of the eye-to-hand the camera to base. |
You're right! The other method returned the other two, I was mistaken |
Running:
returns:
The good news is the calibration is working correctly and returning the correct tfs, since the estimated and GT |
right, if estimated b_T_c is correct, then the problem is surely in the computation of cp_T_cc. |
Hi @miguelriemoliveira! So I've been trying to figure this out since this morning... Still didn't get anywhere, but I may have detected an error in the eye-in-hand case. So one of my doubts was: "If the Turns out that maybe atom/atom_evaluation/scripts/other_calibrations/cv_eye_in_hand.py Lines 327 to 335 in 144c6f0
Shouldn't we get the ground truth from When I change this the results aren't good, so I wanted to check first. I believe this is an error because the tfs in atom/atom_evaluation/scripts/other_calibrations/cv_eye_in_hand.py Lines 317 to 325 in 144c6f0
So when we compare later we're just comparing a transformation against itself, right? If this is an error then maybe there isn't a problem in the calculation of |
Maybe we should return to |
yes, you are right. But since we did not change the dataset it should be the same, no?
ah, if we do this before then we must use the ground truth dataset.
I agree. |
Investigating now... |
Reopening the issue regarding the |
After changing the dataset used for comparison to
So it seems that the |
Hello @miguelriemoliveira! I (apparently) found out what's wrong! So, as I commented on #912, nothing was wrong with that, besides a typo in the translation error units. Eye-in-hand is working okay. About eye-to-hand, now. I had to invert one of the tfs used as input for
It is now in compliance with the documentation: So I just misread the documentation. I will now rename the variables and check if the comments make sense so the code is cleaner and I'll push it. |
Just finished refactoring the code so it's clear now that it uses Tagging @miguelriemoliveira and @manuelgitgomes for visibility. Once you have confirmed this is working, this issue can be closed, I think. |
Great news! |
Really happy to ear this. Congrats! |
Thank you @miguelriemoliveira! I think I'll close this one and try to implement Ali's method next. Afterwards I'll move on to Lidar-camera/Lidar-Lidar calibrations, I think. |
The idea is to create a brother-script to
cv_eye_in_hand.py
which performs the same calibration (with the same four methods but applied to the eye-to-hand case.I'm going to start working on this now.
Tagging @miguelriemoliveira, @manuelgitgomes and @brunofavs for visibility.
The text was updated successfully, but these errors were encountered: