PJLab-ADG / SensorsCalibration

OpenCalib: A Multi-sensor Calibration Toolbox for Autonomous Driving
Apache License 2.0
2.29k stars 545 forks source link

How to get Extrinsic Calibration Matrix from lidar2lidar auto_calib #107

Open maxpepi opened 1 year ago

maxpepi commented 1 year ago

Hi, I want to use your autocalibration function to calibrate multiple lidars, thanks for the great work! I have one question: If I run the auto_calib Program in my docker container it seems to run just fine, I do get the calibration cost and so on in my Terminal. Is there a way to get the Transformation Matrix? Thanks in advance, Max.

maxpepi commented 12 months ago

If anyone else has the same Problem, I solved it as follows:

as a workaround, i just added

` std::ofstream outputFile("transformations.txt"); // Öffnet die Datei für den Schreibzugriff

for (auto iter = refined_extrinsics.begin(); iter != refined_extrinsics.end(); iter++) { int32_t slave_id = iter->first; Eigen::Matrix4d transform = iter->second;

outputFile << "Transformation Matrix for slave_id " << slave_id << ":\n" << transform << std::endl;

}

outputFile.close(); `

to the run_lidar2lidar c++ file. Also, you can print the matrix by adding:

std::cout << "Transformation Matrix for slave_id " << slave_id << ":\n" << transform << std::endl;

maxpepi commented 12 months ago

For output, see attached Screenshot image