ZED - Jetson TX1 and Rtabmap

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ZED - Jetson TX1 and Rtabmap

sohaib50k
Hi,

I've been working on the Jetson TX1 and using the Zed camera.

I've not been able to get the mapping part work till now, basically everything else works.

Screenie of error :


The error is some sort of an OpenCV error, maybe due to the OpenCV4 tegra? SInce I'm using that and haven't compiled OpenCV from source.

Things I've tried:

I've tried remapping correctly.
Tried both the 16bit and 32bit depth formats provided by the ZED SDK,
Tried ZED's own odometry.
Reply | Threaded
Open this post in threaded view
|

Re: ZED - Jetson TX1 and Rtabmap

matlabbe
Administrator
In the error OpenCV3 from kinetic is used. I see that you are building rtabmap_ros from source, I assume rtabmap too. If rtabmap is built against OpenCV4Tegra, rtabmap_ros would link indirectly on two versions of OpenCV: OpenCV4Tegra and OpenCV3.1. That is wrong. rtabmap_ros is linking to OpenCV3 because of cv_bridge. The trick is to remove vision_opencv binaries from kinetic installation, then rebuild vision_opencv stack so that cv_bridge links on OpenCV4Tegra instead of OpenCV3.

You can do this to see which OpenCV is linked:
$ ldd librtabmap_ros.so

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: ZED - Jetson TX1 and Rtabmap

javieryu
matlabbe wrote
In the error OpenCV3 from kinetic is used. I see that you are building rtabmap_ros from source, I assume rtabmap too. If rtabmap is built against OpenCV4Tegra, rtabmap_ros would link indirectly on two versions of OpenCV: OpenCV4Tegra and OpenCV3.1. That is wrong. rtabmap_ros is linking to OpenCV3 because of cv_bridge. The trick is to remove vision_opencv binaries from kinetic installation, then rebuild vision_opencv stack so that cv_bridge links on OpenCV4Tegra instead of OpenCV3.

You can do this to see which OpenCV is linked:
$ ldd librtabmap_ros.so

cheers,
Mathieu
Could you elaborate on this solution? I am having the same problem, but I don't know quite what you mean by "rebuild the vision_opencv stack".

Thanks,
Javier
Reply | Threaded
Open this post in threaded view
|

Re: ZED - Jetson TX1 and Rtabmap

matlabbe
Administrator

Something like this:
$ sudo apt-get remove ros-kinetic-cv-bridge
$ cd ~/catkin_ws/src
$ git clone https://github.com/ros-perception/vision_opencv.git
$ cd ~/catkin_ws
$ catkin_make
Reply | Threaded
Open this post in threaded view
|

Re: ZED - Jetson TX1 and Rtabmap

javieryu
Hi Mathieu,

I tried the solution that you posted above, but I am still having the same issue. I used "ldd" to check that cv_bridge is correctly being linked to OpenCV4Tegra, and also that rtabmap_ros is being linked to OpenCV4Tegra. *See screen shot for outputs*

My best guess is that the issue is stemming from the the fact that librtabmap_ros.so has depends for both OpenCV4Tegra and OpenCV3, but I am not really sure.

Any ideas on how to proceed? My only other plan was to install 14.04 and use the Indigo packages instead.

Thanks again,
Javier

Screen shot of outputs:
Reply | Threaded
Open this post in threaded view
|

Re: ZED - Jetson TX1 and Rtabmap

matlabbe
Administrator
Hi,

make sure that rtabmap library is also linking to OpenCV2. Maybe the OpenCV3 linked in librtabmap_ros.so is coming from librtabmap_core.so.

Delete everything in the build directory so that cmake didn't kept in cache the latest libraries found. You can see at the end of cmake of rtabmap library which OpenCV version cmake has found first.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: ZED - Jetson TX1 and Rtabmap

javieryu
It was the standalone library that was causing the version conflicts. Editing the CMakeLists.txt in the rtabmap library directory to require OpenCV 2 solved the problem.

Thanks Mathieu!