acfr / cam_lidar_calibration

(ITSC 2021) Optimising the selection of samples for robust lidar camera calibration. This package estimates the calibration parameters from camera to lidar frame.
Apache License 2.0
436 stars 102 forks source link

tf static_transform_broadcaster does not fit calibration result #45

Closed kohlisch-git closed 10 months ago

kohlisch-git commented 1 year ago

Hi, first of all thanks for your awesome repository, the calibration process is very intuitive and provides good feedback and good results. I have tested your method among others and it produced the best results.

I have then used the results of the calibration in a static_transform_publisher to complete the tf_tree and look up the transformation in my project. I then noticed the results were pretty bad and went back to investigate. If I take the obtained transformation from the calibration back to matlab and apply it to project the pointclouds captured with the calibrated sensors onto the image, everything is fine.

If I then take a static_transform_publisher with the same parameters, rectify the image and overly the lidar points in rviz, everything is again quite off (not off like source and target frame confused, but a few degrees in rotation and/or a few 100 mm in translation). The source and target frames are correct, which i verified by switching them up which was worse. I have also inverted the transformation and switched the source and target frame, which got me the same result.

I wrote my static_transform_publisher as:

What am i doing wrong? Thanks again for your awesome work and your help!

jclinton830 commented 1 year ago

@kohlisch-git I think you forgot to attach some details to your question. Can you please check the part where you say

I wrote my static_transform_publisher as:

kohlisch-git commented 1 year ago

Yes, that part is missing....

<node pkg="tf" type="static_transform_publisher" name="link_name" args="x y z yaw pitch roll lidar_rame camera_frame period"/>

with the values for x, y, z, roll, pitch, yaw from the calibration.

chinitaberrio commented 1 year ago

Hi @kohlisch-git

The transformation publisher seems to be correct. Here is an example of a publisher we use:

  <node pkg="tf2_ros" type="static_transform_publisher" required="true"
        name="transformation_ouster_to_camera_0"
        args="x y z yaw pitch roll os_sensor camera_0"/>

I'm unsure how you project the point cloud into the image frame. Is it a code you wrote?