解决方案
github链接
问题描述
卸载librealsense2和realsense2-camera ROS wrapper
卸载librealsense2
命令行输入:
dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge
librealsense2卸载完成
删除相应的ROS包
根据教程在重新安装librealsense2和ROS wrapper
教程链接: librealsense2 ROS wrapper
librealsense2按照教程安装:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
验证输入:
realsense-viewer
输入:
modinfo uvcvideo | grep "version:"
librealsense2按照教程更新
sudo apt-get update
sudo apt-get upgrade
ROS Wrapper 根据教程重新安装
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1`
cd ..
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
检验效果:
除了上面的错误外,还出现了下面的错误:
删除ROS Wrapper 使用安装教程中的method 1 进行安装
输入以下命令:
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera
sudo apt-get install ros-$ROS_DISTRO-realsense2-description
之后运行
roslaunch realsense2_camera rs_camera.launch
错误消除,如下所示:
输入以下命令:
dpkg -l | grep librealsense
与之前相比,多出了ros-melodic-librealsense2这个包 问题解决!
|