hku-mars/r3live

rosbag replay a wired result

Marshall-Hu opened this issue · 17 comments

right window shows a mess pointcloud.
should I change code somewhere or miss something?
2022-01-04 17-37-13屏幕截图

The console gives this kind of error:
/ws_livox/src/r3live/r3live/src/loam/IMU_Processing.cpp, 132, check_state fail !!!! 0.793862 3.76128 -10.1187
here is my pc software version:
2022-01-05 12-03-26屏幕截图

With referring to issue #11
I suggest you check if the OpenCV you use for compiling the codes matches exactly the openCV in your runtime environment. That is, the OpenCV version oriented by R3LIVE should as the same as the version info printed in your terminal after types:

pkg-config --modversion opencv

@ziv-lin Hi, I have tried several time to uninstall OpenCV whitch I build from source code. And I check OpenCV version:
2022-01-06 00-13-10屏幕截图
But after delete OpenCV, I compile r3live. It success with cv 3.3.1 whitch is installed by Ros-Kinetic-visionCV :
2022-01-06 00-12-47屏幕截图
Then I replay rosbag, i get error:
2022-01-06 00-20-44屏幕截图

It Seems that IMU-Processing works in the wrong way. Should I remove kinetic-ros opencv, and then try to build cv from source code?

I also try build cv 3.3.1 from source code. and then pkg-config --modversion opencvcheck OpenCV version with 3.3.1.
Run and get IMU_Processing errors. The result is that Lidar moving Path and Color Point Cloud not mapping as expected.

I change set(OpenCV_DIR "/home/cmown/opencv-3.4.16/build") in the r3live CMakeLists.txt . And console outputs like this:
2022-01-06 16-39-16屏幕截图
But when it success compiling, run and get opencv3.3.1:
2022-01-06 16-42-35屏幕截图
type pkg-config --modversion opencv, I got opencv3.4.16. So I really don't know how to set opencv right version

So it look that you have a mess.

  1. First starting by removing all your custom installations (you may need to install purge)
    sudo apt-get purge '*opencv*'
    now check the version of opencv
    pkg-config --modversion opencv
    This should give you the default version in your machine before all your installations or none, not sure.
  2. Re instally opencv
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
# I download the 3.4.16 version and decompress on /home/ubuntu
cd /home/ubuntu/opencv-3.4.16
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make install
pkg-config --modversion opencv

ps: dont change anything of r3live dude. your problem is on opencv, not r3live

Make sure that the LIBRARY you build and run with the same is very very important to achieve the correct result you expected. If you have some troubles in modifying your current software environment, I suggest your try R3LIVE in a new clean machine to see if it work.

Make sure that the LIBRARY you build and run with the same is very very important to achieve the correct result you expected. If you have some troubles in modifying your current software environment, I suggest your try R3LIVE in a new clean machine to see if it work.

So it look that you have a mess.

1. First starting by removing all your custom installations (you may need to install purge)
   `sudo apt-get purge '*opencv*' `
   now check the version of opencv
   `pkg-config --modversion opencv`
   This should give you the default version in your machine before all your installations or none, not sure.

2. Re instally opencv
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
# I download the 3.4.16 version and decompress on /home/ubuntu
cd /home/ubuntu/opencv-3.4.16
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make install
pkg-config --modversion opencv

ps: dont change anything of r3live dude. your problem is on opencv, not r3live

Hi C.
thanks to giving these steps. After doing this and catkin build r3live, it cause cmake error: Missing cv-brige . So I have to apt-get install this ros-xxx-cv-bridge. But this apt instruction lead to install ROS-Opencv with 3.3.1 in the path "/opt/ros/kinetic/include/opencv-3.3.1-dev". Finally r3live compliled with 3.3.1 not 3.4.16
My confuseing is why cv3.3.1 works in a wired way in my first post image. I notice that I installed Sophus lib with fuzzy CV version, does this cause some trouble?

Make sure that the LIBRARY you build and run with the same is very very important to achieve the correct result you expected. If you have some troubles in modifying your current software environment, I suggest your try R3LIVE in a new clean machine to see if it work.

Sure that is final way. Thanks to your nice work Lin! Cheer For U!
ps:any new i will post here :d

What do you get now from pkg-config --modversion opencv ?

Maybe repeat the process installing cv-bridge before..

What do you get now from pkg-config --modversion opencv ?

after purge and install 3.4.16. pkg-config is 3.4.16. but compile r3live is 3.3.1

if i purge opencv*, then i got 3.4.16(because i build it myself and make install. and i make uninstall, then i got nothing. it say missing opencv.

If you install opencv 3.4.16 and install from source cv-bridge, then you should be fine...
https://github.com/ros-perception/vision_opencv

If you install opencv 3.4.16 and install from source cv-bridge, then you should be fine... https://github.com/ros-perception/vision_opencv

Yeah, I finally get the right answer.
And through my trip, Eigen version and opencv version should be kind of couple:
cv3.4.16 seems not working with Eigen.version > 3.3.7 while compile r3live. so here is my:
2022-01-07 00-59-44屏幕截图

Thx again C.

@ziv-lin Hi, I have tried several time to uninstall OpenCV whitch I build from source code. And I check OpenCV version: 2022-01-06 00-13-10屏幕截图 But after delete OpenCV, I compile r3live. It success with cv 3.3.1 whitch is installed by Ros-Kinetic-visionCV : 2022-01-06 00-12-47屏幕截图 Then I replay rosbag, i get error: 2022-01-06 00-20-44屏幕截图

It Seems that IMU-Processing works in the wrong way. Should I remove kinetic-ros opencv, and then try to build cv from source code?

Hi, I still have this "check_state fail" error when running my own setup. Even after building and running with same openCV. The error occurs when I capture objects at < 2.5 meters. when capturing objects at long range it will work perfectly. Is this normal behaviour?

image

cywm39 commented

@mameesie I have the same problem. Have you solved it?

@cywm39 Sorry for the late reply I didnt use github for a while, no i did not solve it, did you?