zivid / zivid-python-samples

Python code samples for Zivid
https://zivid.com
BSD 3-Clause "New" or "Revised" License
41 stars 16 forks source link

Calibration issues (Still getting an offset) #190

Open LucaMIMOUNI opened 19 hours ago

LucaMIMOUNI commented 19 hours ago

Hey everyone,

System

I am trying to calibrate the Zivid2 camera with roboDK and Eye in Hand (Eih) Calibration; following this tutorial calibration_tuto . However I m getting bad results, let me explain ...

To reproduce

cd path_to_/zivid-python-samples
python source/applications/advanced/hand_eye_calibration/robodk_hand_eye_calibration/robodk_hand_eye_calibration.py --eih --ip <my_IP> --target-keyword Target checkerboard

RoboDK

I've try lots of different camera orientations and positions. I've find that this configuration was giving the 'best' results

image

I've try to verify each of theses position with zivid studio so that it respect the requirement talked here zivid2_images

Finally I am getting the transformation matrix :

Screenshot from 2024-12-03 12-43-10

Furthermore by running this scripts :

python source/applications/advanced/hand_eye_calibration/verify_hand_eye_with_visualization.py --input-path source/applications/advanced/hand_eye_calibration/robodk_hand_eye_calibration/datasets/handeye/2024-11-26_10-10-44/ checkerboard

I can verify the callibration, it giving me this, is it a good result ? What should I get ?

Screenshot from 2024-12-03 15-39-33

Finally, by editing my urdf, I can create the zivid_optical_frame transformation with tool0 (End-effector frame):

    <!-- Zivid Virtual link (Needed for Tf), NB don't change following link name -->
    <link name="${tf_prefix}zivid_optical_frame"/>

    <joint name="${tf_prefix}tool0_to_zivid" type="fixed">
        <parent link="${tf_prefix}tool0"/>
        <child link="${tf_prefix}zivid_optical_frame"/>
        <origin xyz="-0.04791497 -0.09082433  0.0549876" rpy="0.00623345 0.03804821 0.01494255"/> <!-- xyz="-0.0333822 -0.08950235  0.04547501" rpy="0.00417424 0.071262 0.02065126"-->
    </joint>

However, I'm still getting an offset as we can see on rviz:

image

The table scan should fit my stl.

Other comments

It seems like the click sound of the photo comes when the robot is still traveling, it could be the culprit but if so, how to make sure that the robot is stop before taking the photo ?