1. 记录格式有误 /etc/apt/sources.list.d/ros-latest.lis
问题如下
E: 文件 list 第 1 行的记录格式有误 /etc/apt/sources.list.d/ros-latest.list (Component)
E: 无法读取源列表。
sudo rm /etc/apt/sources.list.d/ros-latest.list
解决方法:
先删掉原先的那个ros
的ros-latest.list
使用源文件,然后再添加,但是添加的方式与官方上添加的方式有区别,差别在于有xenial
。
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-get update
2.ROSBUG:libopencv_imgcodecs3.so.3.3.1: undefined reference to TIFFReadDirectory@LIBTIFF_4.0
ROS安装完后会安装一个opencv,但是自己也安装了一个opencv, 于是可能这两个opencv可能就产生了冲突。ROS默认调用的是自带的opencv。
解决方法:
查找libopencv_imgcodecs3.so.3.3.1依赖的库
$ ldd /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgcodecs3.so.3.3.1
输出得到下面的内容:
linux-vdso.so.1 => (0x00007ffd3bb9b000)
libopencv_imgproc3.so.3.3 => /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgproc3.so.3.3 (0x00007f81bcc53000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f81bca36000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f81bc7dd000)
libwebp.so.5 => /usr/lib/x86_64-linux-gnu/libwebp.so.5 (0x00007f81bc581000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f81bc35c000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f81bc0e7000) //**看这里**
libjasper.so.1 => /usr/lib/x86_64-linux-gnu/libjasper.so.1 (0x00007f81bbe92000)
libopencv_core3.so.3.3 => /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_core3.so.3.3 (0x00007f81baf58000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f81bad3e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f81ba9bc000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f81ba6b3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f81ba49d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f81ba0d3000)
/lib64/ld-linux-x86-64.so.2 (0x00007f81bfb78000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f81b9eb1000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f81b9ca3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f81b9a9f000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f81b9897000)
然后在你要编译的项目的那个出现这个错误的那个包中的Cmakelist
中手动指定tiff
的路径:
target_link_libraries(${PROJECT_NAME}_lib... # 这里的三点可去掉/usr/lib/x86_64-linux-gnu/libtiff.so.5 )
3. //usr/lib/x86_64-linux-gnu/libapr-1.so.0:对‘uuid_generate@UUID_1.0’未定义的引用
在ros中编译文件的时候出现如下的错误:
//usr/lib/x86_64-linux-gnu/libapr-1.so.0:对‘uuid_generate@UUID_1.0’未定义的引用
collect2: error: ld returned 1 exit status
解决方法:conda install -c conda-forge xorg-libsm
4. 安装ROS kinect时,初始化的问题 rosdep init
一、 ERROR: default sources list file already exists:/etc/ros/rosdep/sources.list.d/20-default.list
解决办法:
- 先删除
$ sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
- 测试:
$ sudo rosdep init
会显示:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
- 升级:
$ sudo apt-get update
- 然后
$ sudo rosdep init
会显示:
Wrote/etc/ros/rosdep/sources.list.d/20-default.list
Recommended:please run
rosdep update
- 最后
$ rosdep update
5. No module named rosmaster.master_api
当安装好 ROS
之后,运行roscore
时,出现报错:
运行 $ roscore
原因:
是因为roscore
程序没有找到rosmaster
模块中的master_api
,所以需要设置ros
能够找到这些模块的正确路径。
解决方法:
需要在变量环境.bashrc
中设置引用到这些库的路径。首先打开.bashrc
,然后加入引用路径,然后source
更新一下变量环境。
sudo gedit ~/.bashrc
添加内容:export PYTHONPATH=/opt/ros/kinetic/lib/python2.7/dist-packages${PYTHONPATH:+:${PYTHONPATH}}
source ~/.bashrc
OK,问题解决。
二、 sudo rosdep init
执行 sudo rosdep init
时出现如下内容:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
解决办法:
sudo c_rehash /etc/ssl/certs
sudo -E rosdep init
rosdep update