jhu-lcsr / handeye_calib_camodocal

Easy to use and accurate hand eye calibration which has been working reliably for years (2016-present) with kinect, kinectv2, rgbd cameras, optical trackers, and several robots including the ur5 and kuka iiwa.
BSD 2-Clause "Simplified" License
543 stars 178 forks source link

Question about the reason to inverse the first pose of robot and fiducial to camera #7

Closed StanleyYake closed 6 years ago

StanleyYake commented 6 years ago

Hello Hunt, I found you question and solution on robotics.stackexchange.com, and I spend many hours on hand eye calibration, when I try to use your code and look deep in the Ax = xB solution, in the line of your code https://github.com/jhu-lcsr/handeye_calib_camodocal/blob/bdaabb5928fd9c380dc64e821f9ecd1f02dafdca/src/handeye_calibration.cpp#L257 here I only caculate with 2 pose 1 and does this the reason why you get the first inverse and then 2nd multiply with inverse, and next 3rd then multiply with the former multiplied results, namely, 3rd_baseHeef 2nd_baseHeef inv(1st_baseHeef)? I am not sure about this, and I have seen others use 2nd_baseHeef inv(1st_baseHeef) = 2nd_camHfiducial inv(1st_camHfiducial) then 3nd_baseHeef inv(2st_baseHeef) = 3nd_camHfiducial inv(2st_camHfiducial), if you know the reason or useful material, I am very appreciate if you can tell me

supermice commented 6 years ago

Hi, ahundt ! I have got problem about the data feeded to the "handeye_calib_camodocal". I generateed two sets of poses with definiate extrinsic parameter, one for the camera and one for the endeffector to test the algorithm. But the results always went wrong. I think there must be something wrong with the poses I generated.

1, Setup a set of transforms(Tmoves) to simulate the movement of endeffector and generate a set of poses by mutiply Tmoves repetitively. Tendeffector1 = Tmove1 Torigin , origin pose(xyz=(0,0,0),orientation=(1,0,0,0)) Tendeffector2 = Tmove2 Tendeffector1 ......

2, Generate the camera poses by mutiply the extrinsic parameter to the endeffector poses. Tcam1 =Textrinsic Tendeffector1 Tcam2 =Textrinsic Tendeffector2

The poses above is based on the assume that the "base frame" of the endeffort and the "object frame" of the camera are coincidental.

Write these poses generated above to the file named "TransformPairsInput.yml". Then run roslaunch handeye_calib_camodocal handeye_example.launch But the result is different with the extrinsic parameter I set (the result rotation and the norm of translation is different). I've tried to inverse both the Tcams and Tendeffectors and seperately, but it did't work.

I'm confused with the transform used in the code. In the "handeye_calibration.cpp" file, the function below has two parameters,"baseToTip" and "camToTag". Eigen::Affine3d estimateHandEye(const EigenAffineVector& baseToTip, const EigenAffineVector& camToTag) Ttip = T"baseToTip" Tbase Ttag = T"camToTag" Tcam Dose that mean the "baseToTip" is related to base but"camToTag" is related to camera ?

ahundt commented 6 years ago

Hey sorry for the delay! Last month was very busy.

Are you each able to run the pre-saved data correctly?

roslaunch handeye_calib_camodocal handeye_example.launch

@StanleyYake I don't think you have enough joints to reach a sufficient number of varied positions and orientations to find a solution. You may want to look for an alternative.

ahundt commented 6 years ago

@supermice base to tip is about a robot arm, see https://robotics.stackexchange.com/questions/7163/hand-eye-calibration. Can you upload an illustration like the OP so I can understand your situation?

ahundt commented 6 years ago

closing due to inactivity, feel free to comment if something else is needed.