Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Short Guide to Getting Fast-LIVO to Work in Noetic (Compile Bugs + Solutions) #53

Closed
seajayshore opened this issue Mar 14, 2023 · 6 comments

Comments

@seajayshore
Copy link

seajayshore commented Mar 14, 2023

Thanks to the author(s) for this great piece of work & other users for their help solving issues.
I got Fast-LIVO working on my machine yesterday and wrote a list of errors with solutions that may help other new users like me!

NOTE: This list is correct on March 14 2023 with the Fast-LIVO commit a8918c2 (Feb 7 2023)

My Setup:

  • Ubuntu 20.04 + ROS Noetic
  • AMD Ryzen 3600X CPU + Nvidia 1660S GPU

Prerequisites I already had installed:

  • PCL 1.10.0
    • ros-noetic-pcl-ros 1.7.4
  • Eigen 3.3.7
  • OpenCV 4.2.0 (Noetic's standard version)

Installing Other Prerequisites:

I had never used Sophus or VIKit before.
I followed the basic instructions in Fast-LIVO's README and here are my errors & solutions from that:

1. Sophus

  • Had error with assigning a complex number in so2.cpp, something like:
    • error: lvalue required as left operand of assignment...
    • 32 | unit_complex_.real() = 1.;
    • 33 | unit_complex_.imag() = 0.;
  • According to this GitHib issue from SVO (related to Fast-LIVO) it's a "known issue" and solved by replacing the 2 lines above with:
    • unit_complex_ = std::complex<double>(1,0);
  • Sophus now compiled! :-)

2. VIKit

  • There are various errors where the compiler complains that parameters like CV_RANSAC are not declared (I think this is syntax changes from OpenCV 3.X -> 4.X).
  • The solution is to update the syntax from CV_... to cv::..., specifically:
    • In .cpp files located at .../fast_livo_ws/src/rpg_vikit/vikit_common/src
      • In homography.cpp (line 48)
        • CV_RANSAC -> cv::RANSAC
      • In pinhole_camera.cpp (line 112)
        • CV_INTER_LINEAR -> cv::INTER_LINEAR
      • In img_align.cpp (lines 237 & 437)
        • CV_WINDOW_AUTOSIZE -> cv::WINDOW_AUTOSIZE
  • VIKit now compiled! :-)

Compile Fast-LIVO & Test With Official Data

After the errors above were solved I had no problems compiling the main Fast-LIVO code with catkin_make.

Before using your own data (where many things can go wrong) it's good to test that the author's "official" data works well.

In my case I ran the hku2.bag data with the standard mapping_avia.launch profile and it worked really well.

Crash When Running My Own Data:

When running your own custom data, specifically when you have different (larger?) image height & width, a crash may occur and the terminal will read something like:

  • [laserMapping-1] process has died [pid 2096, exit code -11, ...]

This could happen for a number of different reasons - you are reccomended to learn how to use gdb (below) to debug "properly" incase your crash is different to mine!

My specific crash seems to be common and happens like so:

  • Launch Fast-LIVO OK
  • Start playing a rosbag OK
  • Fast-LIVO starts to initialise OK
  • Suddenly it crashes after the first 1-2 messages from VIO appear in the terminal

In this case the crash is probably from an error processing line ~376 in lidar_selection.cpp where the following line:

  • float it[height * width] = {0.0};
    Can be changed to:
  • std::vector<float> it(height*width, 0);

(Here is a link to a user confirming a similar error & their solution that I copied).

After this Fast-LIVO doesn't crash with my custom data - however that doesn't mean it works well! :-P
Calibraiton, synchronisation, etc. all need to be good!

Enabling GDB (for the Complete Beginner):

I am really new to using GDB but I found it very easy to debug the crash above once I learned how to start it!

With Fast-LIVO we are launching everything using a launch file - in this case all you have to do is to add the line launch-prefix="gdb -ex run --args" to the node description in the launch file.

Specifically change:

<node pkg="fast_livo" type="fastlivo_mapping" name="laserMapping" output="screen" >
	<rosparam file="$(find fast_livo)/config/camera_pinhole_resize.yaml" />
</node>

to:

<node pkg="fast_livo" type="fastlivo_mapping" name="laserMapping" output="screen" launch-prefix="gdb -ex run --args">
	<rosparam file="$(find fast_livo)/config/camera_pinhole_resize.yaml" />
</node>

And now when you launch Fast-LIVO like normal it will launch attached to the GDB debugger! :-)

@zhh2005757
Copy link

Thanks for great contributions! Helps me a lot!

@hyeongaa
Copy link

I have an issue of running launch FAST-LIVO.

I have problem of

[laserMapping-2] process has died [pid 29207, exit code -11, cmd /home/hyss/livo_ws/devel/lib/fast_livo/fastlivo_mapping __name:=laserMapping __log:=/home/hyss/.ros/log/3e90916c-cfb4-11ee-a012-65f897d77de0/laserMapping-2.log].
log file: /home/hyss/.ros/log/3e90916c-cfb4-11ee-a012-65f897d77de0/laserMapping-2*.log

when I execute the command "roslaunch fast-livo mapping_avia.launch"

I followed your instructions and I cannot find the error.

Also, I run the gdb and I got this error

Thread 1 "fastlivo_mappin" received signal SIGSEGV, Segmentation fault.
0x00007ffff60d393b in cv::initUndistortRectifyMap(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::InputArray const&, cv::Size, int, cv::_OutputArray const&, cv::_OutputArray const&) () from /lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2

@Hohaizzz
Copy link

我有一个运行启动FAST-LIVO的问题。

我有问题

[laserMapping-2] 进程已死 [pid 29207,退出代码 -11,cmd /home/hyss/livo_ws/devel/lib/fast_livo/fastlivo_mapping __name:=laserMapping __log:=/home/hyss/.ros/log/3e90916c-cfb4-11ee-a012-65f897d77de0/laserMapping-2.log]。日志文件:/home/hyss/.ros/log/3e90916c-cfb4-11ee-a012-65f897d77de0/laserMapping-2*.log

当我执行命令“roslaunch fast-livo mapping_avia.launch”时

我按照您的说明操作,但找不到错误。

另外,我运行gdb并收到此错误

线程 1“fastlivo_mappin”接收信号 SIGSEGV,分段故障。 0x00007ffff60d393b cv::initUndistortRectifyMap(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::InputArray const&, cv::Size, int, cv::_OutputArray const&, cv::_OutputArray const&) () from /lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2

同样的问题,请问您解决了吗

@ouguangjun
Copy link

I have an issue of running launch FAST-LIVO.

I have problem of

[laserMapping-2] process has died [pid 29207, exit code -11, cmd /home/hyss/livo_ws/devel/lib/fast_livo/fastlivo_mapping __name:=laserMapping __log:=/home/hyss/.ros/log/3e90916c-cfb4-11ee-a012-65f897d77de0/laserMapping-2.log]. log file: /home/hyss/.ros/log/3e90916c-cfb4-11ee-a012-65f897d77de0/laserMapping-2*.log

when I execute the command "roslaunch fast-livo mapping_avia.launch"

I followed your instructions and I cannot find the error.

Also, I run the gdb and I got this error

Thread 1 "fastlivo_mappin" received signal SIGSEGV, Segmentation fault. 0x00007ffff60d393b in cv::initUndistortRectifyMap(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::InputArray const&, cv::Size, int, cv::_OutputArray const&, cv::_OutputArray const&) () from /lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2

I also have this problem (ros: noetic, opencv 4.2), I tried to track this API and found that there might be a problem with "/rpg_vikit/vikit_common/src/pinhole_camera.cpp". I tried to catkin make fast livo on ubuntu 18.04 (ros:melodic, opencv 3.2) using docker, this problem did not arise. I think the problem is the opencv version, this API might need to be adjusted due to opencv version changes

@Cureser
Copy link

Cureser commented Nov 5, 2024

[ INFO] [1730771598.803767110]: Found parameter: laserMapping/cam_model, value: Pinhole
[ INFO] [1730771598.804458051]: Found parameter: laserMapping/cam_width, value: 640
[ INFO] [1730771598.804647089]: Found parameter: laserMapping/cam_height, value: 512
[ INFO] [1730771598.804846275]: Found parameter: laserMapping/cam_fx, value: 431.795
[ INFO] [1730771598.805026845]: Found parameter: laserMapping/cam_fy, value: 431.55
[ INFO] [1730771598.805207710]: Found parameter: laserMapping/cam_cx, value: 310.833
[ INFO] [1730771598.805381376]: Found parameter: laserMapping/cam_cy, value: 266.986
[ INFO] [1730771598.805556992]: Found parameter: laserMapping/cam_d0, value: -0.0944205
[ INFO] [1730771598.805728547]: Found parameter: laserMapping/cam_d1, value: 0.0946728
[ INFO] [1730771598.805904258]: Found parameter: laserMapping/cam_d2, value: -0.00807971
[ INFO] [1730771598.806075470]: Found parameter: laserMapping/cam_d3, value: 8.07461e-05
--Type for more, q to quit, c to continue without paging--

Thread 1 "fastlivo_mappin" received signal SIGSEGV, Segmentation fault.
0x00007ffff54df93b in cv::initUndistortRectifyMap(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::InputArray const&, cv::Size, int, cv::_OutputArray const&, cv::_OutputArray const&) ()
from /lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2

How can I fix the process died problem

@DioBakery
Copy link

My gdb debugging results are:
Thread 1 "fastlivo_mappin" received signal SIGSEGV, Segmentation fault. 0x000055555559e464 in lidar_selection::Frame::w2c (xyz_w=..., this=0x55555dd99700) at /home/cgy/fast_livo_ws/src/FAST-LIVO/include/frame.h:89 89 inline Vector2d w2c(const Vector3d& xyz_w) const { return cam_->world2cam( T_f_w_ * xyz_w ); }
Has anyone ever had this problem?
(My OS is also noetic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants