The ROS Wrapper for Intel RealSense Devices provides a ROS nodelet interface between the camera and the ROS system. Intel updates this ROS package on a fairly regular basis, which could lead to API version mismatch errors.
When this happens, the camera (sometimes) works fine on realsense-viewer but any code using the RealSense nodelet fails to compile. The specific error message is something like:
Failed to load nodelet [/camera/realsense2_camera] of type [realsense2_camera/RealSenseNodeFactory] even after refreshing the cache: API version mismatch: librealsense.so was compiled with API version 2.18.1 but the application was compiled with 2.16.4! Make sure correct version of the library is installed (make install)
-
- Navigate to your github repository folder for the ROS Wrapper for Intel RealSense Devices:
cd ~/robot_ws/src/realsense - To avoid loosing any local changes made, first do a git stash followed by a git pull. This will temporarily set your local changes aside while updating the repository from remote, and then merge your changes afterwards. The command sequence to use is:
git stashthengit pull origin developmentand lastly,git stash apply --index - Finally, compile:
cd ~/robot_wsthencatkin_make
- Navigate to your github repository folder for the ROS Wrapper for Intel RealSense Devices:
This will update your API version to the latest Intel release.