ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.29k stars 1.4k forks source link

kalidr :Compilation failure #479

Closed zw-nuist-176 closed 2 years ago

zw-nuist-176 commented 2 years ago

Some problems occurred during compilation. 1、sudo pip install python-igraph --upgrade

2021-10-28 15-39-26 的屏幕截图

Can you solve this problem by entering such content:sudo pip3 install python-igraph --upgrade ?

2、when"catkin build -DCMAKE_BUILD_TYPE=Release -j4",Some problems occurred。 2021-10-28 15-33-46 的屏幕截图 2021-10-28 15-34-15 的屏幕截图

I hope you can teach me how to solve these problems? Thank you for your help.

Ceopee commented 2 years ago

I recommend you to use python3 instead of python 2.8. Maybe this causes the failure. Check pip list too see installed packages. Maybe there is related module that you need to delete. For the 2nd problem, it looks like a namespace issue with OpenCV. You only need cv::namespace to related lines. Change lines 305/306:

    m_cap.set(cv::CAP_PROP_FRAME_WIDTH, m_width);
    m_cap.set(cv::CAP_PROP_FRAME_HEIGHT, m_height);

and line 383: cv::cvtColor(image, image_gray, cv::COLOR_BGR2GRAY);

zw-nuist-176 commented 2 years ago

@Ceopee Thank you for your help, I'll give it a try. Thank you for your answer.

zw-nuist-176 commented 2 years ago

@Ceopee Sorry to disturb you again because of my work. I follow your suggestions and links. After the implementation, there are still errors. The green suggested namespace appears when the error is reported. After my operation (final modification, as shown in Figure 1 and Figure 2), the previous problems are solved, but new problems appear (as shown in Figure 3 and Figure 4). It makes me feel at a loss. Yes, please help me solve the problem again and successfully install kalibr. Thank you very much! 2021-11-06 11-33-11 的屏幕截图 2021-11-06 11-33-00 的屏幕截图

2021-11-06 11-33-39 的屏幕截图 2021-11-06 11-33-44 的屏幕截图 2021-11-06 11-34-00 的屏幕截图

Wish you a happy weekend!

Ceopee commented 2 years ago

They all have the same namespace or Opencv C Api issues. I guess you can ignore the warnings and notes. For the errors, just go to related file(read red lines) like GridCalibrationTargetCheckboard, GridDetector etc. change stated lines. With the same behavior that we did previously, you can make some changes like here CV_FONT_HERSHEY_SIMPLEX to cv::FONT_HERSHEY_SIMPLEX. I am not going to look into all these errors. You can basically find the related conversions.

Read the error output. It gives the clue then make some search 🎉

Tsingkai commented 2 years ago

Do you solve these problems? I meet these peoblems, too. Ubuntu 20.04 LTS Refer to https://blog.csdn.net/hanyeguxingwo/article/details/121293315?spm=1001.2014.3001.5501, I solved many problems like changing CV_FONT_HERSHEY_SIMPLEX to cv::FONT_HERSHEY_SIMPLEX,but nothing to instead CvSize…… Thx!

zw-nuist-176 commented 2 years ago

@Tsingkai Your question ,I read someone else's post,may be the version problem.But it don't uninstall ,reinstall. I don‘t do more work.Because I find a lot of work to do if modify the OpenCV code to adapt constantly. There are so many bugs ,I'm going to calibrate the camera in different way.if you have a better solution ,please let me know.

Tsingkai commented 2 years ago

https://github.com/ori-drs/kalibr Checkout this repository,I replaced all files that had errors during compilation, and then I succeeded. It fixes all syntax problems, opencv and python3.

zw-nuist-176 commented 2 years ago

@Tsingkai Really good. I will practice it when I have time.

Tsingkai commented 2 years ago

new problem,maybe two version code caused

File "kalibr_workspace/devel/bin/kalibr_calibrate_cameras", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "kalibr_workspace/src/Kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_cameras", line 10, in <module>
    import kalibr_camera_calibration as kcc
  File "kalibr_workspace/devel/lib/python3/dist-packages/kalibr_camera_calibration/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 2, in <module>
  File "kalibr_workspace/devel/lib/python3/dist-packages/numpy_eigen/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 3, in <module>
ModuleNotFoundError: No module named 'libnumpy_eigen'
zw-nuist-176 commented 2 years ago

@Tsingkai so many bugs need to do. @_@`害

FrozenSmile commented 2 years ago

pip uninstall igraph sudo apt-get install python-igraph

goldbattle commented 2 years ago

Hi please try PR https://github.com/ethz-asl/kalibr/pull/515 to see if that solves your issue.