Closed Camilochiang closed 2 years ago
So after removing a previous installation (sudo apt remove ros-melodic-realsense2-camera
), I'm getting the same error that has been previously reported by in the above mentioned question
//librealsense2_camera.so: undefined symbol: _ZN2cv3MatC1Ev
Hi @Camilochiang It is a known issue that align and pointcloud can have problems such as heavy FPS lag or missing color on Jetson boards specifically. The problem does not usually occur on non-Jetson computers such as desktop and laptop PCs. https://github.com/IntelRealSense/realsense-ros/issues/1967 discusses the Jetson pointcloud problem, though the align problem began at around the same time.
A couple of RealSense ROS users in that case resolved the pointcloud issue using librealsense 2.43.0 and wrapper 2.2.23 - as described at https://github.com/IntelRealSense/realsense-ros/issues/1967#issuecomment-1029789663 - so it may be worth trying that configuration to see whether it resolves the align problem too, since it began at around the same time as the pointcloud problem.
Currently, using the older configuration described in https://github.com/IntelRealSense/realsense-ros/issues/1967#issuecomment-1029789663 is the best known solution.
In regard to the error undefined symbol: _ZN2cv3MatC1Ev, if you have built the ROS wrapper from source then can you make sure that you have ddynamic_reconfigure installed by using the command below, please:
sudo apt install ros-melodic-ddynamic-reconfigure
Hei @MartyG-RealSense . Yes, I had the ros-melodic-ddynamic-reconfigure
module installed.
I retry with the following configuration and no success. Error undefined symbol: _ZN2cv3MatC1Ev still present
cd
cd ASPEN/Software/transfer/
rs-fw-update -f Signed_Image_UVC_5_12_12_100.bin
#LibRealSense
cd /home/aspen/Others
sudo rm -r librealsense-2.50.0
#wget https://github.com/IntelRealSense/realsense-ros/archive/refs/tags/v2.43.0.zip
# had to do it manually
unzip librealsense-2.43.0.zip
rm librealsense-2.43.0.zip
cd librealsense-2.43.0
mkdir build && cd build
cmake -DFORCE_RSUSB_BACKEND=ON \
-DBUILD_PYTHON_BINDINGS=true \
-DPYTHON_EXECUTABLE=/usr/bin/python3.6 \
-DCMAKE_BUILD_TYPE=release \
-DBUILD_EXAMPLES=true \
-DBUILD_GRAPHICAL_EXAMPLES=true \
-DBUILD_WITH_CUDA=true ..
make -j4
sudo make install
#Checking dynamic presence
sudo apt install ros-melodic-ddynamic-reconfigure
#Wrapper
cd /home/aspen/ASPEN/Software/ROS/src
wget https://github.com/IntelRealSense/realsense-ros/archive/refs/tags/2.2.23.zip
unzip 2.2.23.zip
rm 2.2.23.zip
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
source /home/$USER/ASPEN/Software/ROS/devel/setup.bash
roslaunch realsense2_camera rs_camera.launch
Specs:
- Jetpack 4.6 [L4T 32.6.1]
- Opencv 4.5.3
- firmware 5.12.12.100
- lib 2.43.0
- wrapper 2.2.23
Something that call my attention is that meanwhile installing opencv from source all libraries were installed to /usr/local/lib/aarch64-linux-gnu
, for example:
sudo make install
...
-- Set runtime path of "/usr/local/lib/aarch64-linux-gnu/libopencv_core.so.4.5.3" to "/usr/local/lib/aarch64-linux-gnu"
-- Set runtime path of "/usr/local/lib/aarch64-linux-gnu/libopencv_flann.so.4.5.3" to "/usr/local/lib/aarch64-linux-gnu"
-- Set runtime path of "/usr/local/lib/aarch64-linux-gnu/libopencv_imgproc.so.4.5.3" to "/usr/local/lib/aarch64-linux-gnu"
-- Set runtime path of "/usr/local/lib/aarch64-linux-gnu/libopencv_ml.so.4.5.3" to "/usr/local/lib/aarch64-linux-gnu"
Meanwhile when installing the ros-wrapper with catkin_make install
, librealsense2_camera.so
doesnt have a path...
-- Set runtime path of "/home/aspen/ASPEN/Software/ROS/install/lib/librealsense2_camera.so" to ""
I suspect that manually coping that file to /usr/local/lib/python3.6/dist-packages/cv2/python-3.6
may solve the problem. I will have a look
Okay, please do let me know how your manual file-copying goes.
Camilochiang Maybe I found a solution try adding/modifying to CMakeLists in realsense2_camera. Now im testing this solution but it looks promising. (even work with -DFORCE_RSUSB_BACKEND:=false):
Thanks so much @koralm for sharing your possible solution with @Camilochiang and the RealSense ROS community :)
Hei @MartyG-RealSense . The suggested solution from @koralm did the trick. I guess that should also work with more recent versions but so far is working (more than 15 aligned FPS) in:
It's excellent to hear that the solution of @koralm worked for you - thanks very much for the update!
Hello @Camilochiang and @MartyG-RealSense. I'm facing the same problem but using ROS Galactic, I can change the firmware and the librealsense versions you say, but what about the 2.2.23 wrapper version in ROS2?
Hi @edgarcamilocamacho The 2.2.23 wrapper is for ROS1. The equivalent ROS2 wrapper for matching to SDK 2.43.0 is 3.1.5 but ROS2 Galactic support was not introduced until wrapper 3.2.2 which is designed for matching with SDK 2.48.0.
Thanks, @MartyG-RealSense. I am using that one right now, and modified the CMakeList to accept galactic. Just some problems with TF naming, but after manually setting them it is working. It can be a temporal solution while one the 3.X.X or 4.X.X version is fixed.
Thanks so much @edgarcamilocamacho for sharing your workaround solution for ROS2 with the RealSense ROS community!
Camilochiang Maybe I found a solution try adding/modifying to CMakeLists in realsense2_camera. Now im testing this solution but it looks promising. (even work with -DFORCE_RSUSB_BACKEND:=false):
1. find_package( OpenCV REQUIRED ) 2. include_directories( include ${realsense2_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ) 3. target_link_libraries(${PROJECT_NAME} ${realsense2_LIBRARY} ${catkin_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OpenCV_LIBRARIES} )
I tried this and I'm getting the same symbol issue error. I'm using an AGX Orin. Does anyone have any ideas?
Here's my cmakelists:
EDIT: Perhaps I was a bit hasty to complain. However, this problem comes and goes for whatever reason. Sometimes it works, sometimes it doesn't. I have no idea why. Though, it only started to kind of work after I made this OpenCV modification. Any ideas?
why this not included by default?
Hei. I recently move to a jetson xavier NX and tried to use GPU to get better results of alignment, but after checking with jtop there is 0 GPU usage and the aligned topic only give 1.5 FPS, meanwhile color and depth give the right values (in this case 15 FPS)
Here my steps:
Specs:
I check This question but not sure why it may be failing. Any suggestions people? @MartyG-RealSense ?