ROS各种报错解决
- rosdep update失败报错
- 报错内容
- 终极解决解决方法
- 缺少 tf2_geometry_msgs 包
- 报错内容
- 解决方法
- 缺少 orocos-bfl 包
- 报错内容
- 解决方法
- jetson nano缺少 Qt5 包
- 解决方法
- python代码报错:from: can't read /var/mail/__future__
- 解决方法:
- 在.bashrc或者.zshrc里面source ~/catkin_ws/setup.sh之后,仍然找不到功能包
- 解决:
- 报错不断,持续更新.....
开始入门ROS,最大的阻碍就是各种报错,在这里记录下来
rosdep update失败报错
报错内容
终极解决解决方法
这里是参考了某大神的解决方法,实测可行,非常感谢
目前网上各种处理方法,大多都是改host,增加time out的等待时间等,效果并不理想。 如果你直接打开他在那访问的网址(https://raw.githubusercontent.com 开头的),是可以直接打开的。中间为什么会出现网络问题不得而知。因此,方法就是把文件下载到本地之后,让ROS从本地去“下载”,就万无一失,保证成功了。
1.把相关文件下载到本地:
git clone https://github.com/ros/rosdistro.git
git clone到本地的地址自定(上面命令后加空格再加地址就行)
2.改ROS去获取文件的地址:
(1)查找文件/usr/lib/python2/dist-packages/rosdep2/rep3.py 中的raw.githubusercontent.com,将 https://raw.githubusercontent.com/ros/rosdistro/master 替换成 file://+第1步中的路径
(2)查找文件/usr/lib/python2/dist-packages/rosdistro/init.py中的raw.githubusercontent.com,将 https://raw.githubusercontent.com/ros/rosdistro/master 替换成 file://+第1步中的路径
总之就是把这些地址全部改成下载到本地的包中对应文件的绝对地址
3. 修改/etc/ros/rosdep/sources.list.d/20-default.list
继续改地址,将该文件中的所有 https://raw.githubusercontent.com/ros/rosdistro/master 替换成 file://+第1步中的路径
例如:#os-specific listings first yaml file:///home/adv/rosdistro/rosdep/osx-homebrew.yaml osx
4.上述步骤结束后继续执行
rosdep update
没有报错,完美解决
缺少 tf2_geometry_msgs 包
报错内容
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Could NOT find tf2_geometry_msgs (missing: tf2_geometry_msgs_DIR)
-- Could not find the required component 'tf2_geometry_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "tf2_geometry_msgs"
with any of the following names:
tf2_geometry_msgsConfig.cmake
tf2_geometry_msgs-config.cmake
Add the installation prefix of "tf2_geometry_msgs" to CMAKE_PREFIX_PATH or
set "tf2_geometry_msgs_DIR" to a directory containing one of the above
files. If "tf2_geometry_msgs" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
解决方法
sudo apt install ros-melodic-tf2-geometry-msgs -y
缺少 orocos-bfl 包
报错内容
-- Checking for module 'orocos-bfl'
-- No package 'orocos-bfl' found
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
解决方法
(1)
我这里的ros版本是melodic
sudo apt-get install ros-melodic-bfl
jetson nano缺少 Qt5 包
解决方法
在jetson nano上安装Qt5
sudo apt-get install qt5-default qtcreator -y
reboot
python代码报错:from: can’t read /var/mail/future
解决方法:
在python文件开头加入这句
#!/usr/bin/env python
在.bashrc或者.zshrc里面source ~/catkin_ws/setup.sh之后,仍然找不到功能包
解决:
注意在.bashrc或者.zshrc里面,source 这样的语句要放在其他语句前面,不然就会出现这样的问题,这里记录这个大坑!!!!!
报错不断,持续更新…