背景:使用淘宝上吉浦迅店铺送的tf卡,已经预装了一些东西。
本文使用Jetson nano搭载在Turtlebot2平台上,主要是按照创客智造的教程来配置环境的,总结了中间出的一些bug,虽然最后运行的时候会报错,但是功能上建图和自主导航都测试了没问题。
Nano入门教程软件篇-安装ROS melodic 版本
https://www.ncnynl.com/archives/201904/2923.html
Xavier入门教程软件篇-源码安装带GPU支持的opencv3.2.0版本
https://www.ncnynl.com/archives/201903/2900.html
Nano入门教程软件篇-安装Turtlebot(melodic版本)
https://www.ncnynl.com/archives/201904/2924.html
Nano入门教程硬件篇-安装kinect v1
https://www.ncnynl.com/archives/201905/3115.html
通用部分
解决方法:重启一下ssh服务之后,又能连上了。即输入service sshd restart
2、使用pwm散热风扇:https://blog.csdn.net/liam_dapaitou/article/details/90812748
创建/etc/rc.local(18.04没有rc.local)部分使用命令行:
sudo nano /etc/rc.local
3、换源:https://blog.csdn.net/dvd_sun/article/details/88975005
参照网址中的步骤进行换源并升级
4、关于Ubuntu中Could not get lock /var/lib/dpkg/lock解决方案
在终端中敲入以下两句sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
5、Linux查看已安装软件及软件的版本号
1.查看安装的所有软件
dpkg -l
例如:dpkg -l | grep ftp
2.查看软件安装的路径
dpkg -L | grep ftp
也可以用 whereis ftp
3.查看软件版本
aptitude show
例如:aptitude show ftp
6、安装报错Cannot write: No space left on device。
解决方法:看看是不是trash文件夹太满了,清理一下就可以了
7、make太慢,加速办法:
用make -j带一个参数,可以把项目在进行并行编译,比如在一台双核的机器上,完全可以用make -j4,让make最多允许4个编译命令同时执行,这样可以更有效的利用CPU资源。
ROS部分:
吉浦迅这个店铺送的装好系统的卡里面设置了proxy,就是代理,可以在图形化界面里面点进设置,网络设置,然后关掉
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220 #此处6AF0E1940624A220需要是错误提示的key
https://blog.csdn.net/qq_35237993/article/details/79814064
多sudo apt-get update几次,突然就好了,不清楚具体原因
Opencv部分
原因:18.04的Ubuntu缺少一些依赖,而这些依赖的文件只能在低版本的系统中找到,所以要添加低版本的源。网上搜到的这个问题的解决办法,其平台都不是Nano,架构不一样的话直接照做会出404,所以第一个命令的源一定要是我下面这个,这个在官网上搜索包的时候发现的,首先nano是arm64架构的,对应的是ports,而security对应的是amd64或者i386架构的,会不匹配,把security换成port即可。
sudo add-apt-repository "deb http://ports.ubuntu.com/ubuntu-ports/ xenial main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
ps:可以在这里搜索缺少的包:
https://packages.ubuntu.com/search?keywords=libjasper-dev
https://packages.ubuntu.com/search?keywords=libjasper1&searchon=names&suite=all§ion=all
cmake -D WITH_CUDA=ON -D CUDA_ARCH_BIN="7.2" -D ENABLE_PRECOMPILED_HEADERS=OFF -D CUDA_ARCH_PTX="" -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/tools/opencv_contrib/modules ..
报错
查看出错日志:Build output check failed: Regex: 'command line option .* is valid for .* but not for C\+\+' Output line: 'cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++'Compilation failed: source file: '/home/nano/tools/opencv-3.2.0/release/CMakeFiles/CMakeTmp/src.cxx' check option: ' -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes'
解决办法:http://www.dataguru.cn/archiver/?tid-856817.html
主要原因是因为把opencv_contrib目录放到了opencv-3.3.0目录下。将其从opencv-3.3.0放到与opencv-3.3.0的平行目录后,问题解决,Cmake通过
报错:vgg_generated相关、boostdesc相关
解决办法:https://blog.csdn.net/random_repick/article/details/72296299
Vgg_generated相关文件下载地址:https://pan.baidu.com/s/1-id0uzjP35ChRQgmuBVUxA
提取码:slg2
Boostdesc相关文件下载地址:https://pan.baidu.com/s/1zfsVsnJ2zjHjHxPybHUy3g
提取码:9sit
报错:“undefined reference to `cblas_sgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, float, float const, int, float const, int, float, float*, int)'”
解决办法(试过还是不行):需要重新编译BLAS,CBLAS,LPACK。
编译部分请看:https://www.jianshu.com/p/33c4aea6117b
或者这篇:https://blog.csdn.net/shentu7/article/details/88028854
然后再重新安装:
sudo apt-get install libatlas-base-dev gfortran
再编译就行。
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5
解决方法:https://askubuntu.com/questions/760746/how-to-fix-error-w-target-packages-main-binary-amd64-packages-is-configured-m
原因:
anaconda的 linux 版本只出了x86 32位和64位架构的包,并没有arm64的包
https://devtalk.nvidia.com/default/topic/1051415/jetson-nano/anaconda-for-jetson-nano/
详细原因以及解决方法:https://zhuanlan.zhihu.com/p/64868319
解决问题
Turtlebot部分:
更新方法sudo apt-get -y update
2、 运行rosdep install --from-paths src --ignore-src -r -y 报错
E: Unable to locate package ros-melodic-gmapping
解决方法:https://blog.csdn.net/wsc820508/article/details/81561304
按文章中弄好后再跑一次rosdep install --from-paths src --ignore-src -r -y即可
3、 https://www.ncnynl.com/archives/201904/2924.html
安装turtlebot 时编译报错-- No package 'orocos-bfl' found
解决方法:
sudo apt-get install ros-melodic-bfl
然后再次编译即可
https://www.itread01.com/content/1543914799.html
编译报错:
Linux提示 /usr/bin/ld:cannot find-lxxx 系列解决方法:
https://blog.csdn.net/qq_39584315/article/details/79724038
cd /usr/lib/aarch64-linux-gnu
sudo ln -s libvtkRenderingOpenGL-6.3.so.6.3.0 libvtkRenderingOpenGL.so
sudo ln -s libvtkImagingHybrid-6.3.so.6.3.0 libvtkImagingHybrid.so
sudo ln -s libvtkIOImage-6.3.so.6.3.0 libvtkIOImage.so
sudo ln -s libvtkCommonDataModel-6.3.so.6.3.0 libvtkCommonDataModel.so
sudo ln -s libvtkCommonMath-6.3.so.6.3.0 libvtkCommonMath.so
sudo ln -s libvtkCommonCore-6.3.so.6.3.0 libvtkCommonCore.so
sudo ln -s libvtksys-6.3.so.6.3.0 libvtksys.so
sudo ln -s libvtkCommonMisc-6.3.so.6.3.0 libvtkCommonMisc.so
sudo ln -s libvtkCommonSystem-6.3.so.6.3.0 libvtkCommonSystem.so
sudo ln -s libvtkCommonTransforms-6.3.so.6.3.0 libvtkCommonTransforms.so
sudo ln -s libvtkCommonExecutionModel-6.3.so.6.3.0 libvtkCommonExecutionModel.so
sudo ln -s libvtkDICOMParser-6.3.so.6.3.0 libvtkDICOMParser.so
sudo ln -s libvtkIOCore-6.3.so.6.3.0 libvtkIOCore.so
sudo ln -s libvtkmetaio-6.3.so.6.3.0 libvtkmetaio.so
sudo ln -s libvtkImagingCore-6.3.so.6.3.0 libvtkImagingCore.so
sudo ln -s libvtkRenderingCore-6.3.so.6.3.0 libvtkRenderingCore.so
sudo ln -s libvtkCommonColor-6.3.so.6.3.0 libvtkCommonColor.so
sudo ln -s libvtkFiltersExtraction-6.3.so.6.3.0 libvtkFiltersExtraction.so
sudo ln -s libvtkFiltersCore-6.3.so.6.3.0 libvtkFiltersCore.so
sudo ln -s libvtkFiltersGeneral-6.3.so.6.3.0 libvtkFiltersGeneral.so
sudo ln -s libvtkCommonComputationalGeometry-6.3.so.6.3.0 libvtkCommonComputationalGeometry.so
sudo ln -s libvtkFiltersStatistics-6.3.so.6.3.0 libvtkFiltersStatistics.so
sudo ln -s libvtkImagingFourier-6.3.so.6.3.0 libvtkImagingFourier.so
sudo ln -s libvtkalglib-6.3.so.6.3.0 libvtkalglib.so
sudo ln -s libvtkFiltersGeometry-6.3.so.6.3.0 libvtkFiltersGeometry.so
sudo ln -s libvtkFiltersSources-6.3.so.6.3.0 libvtkFiltersSources.so
sudo ln -s libvtkInteractionStyle-6.3.so.6.3.0 libvtkInteractionStyle.so
sudo ln -s libvtkRenderingLOD-6.3.so.6.3.0 libvtkRenderingLOD.so
sudo ln -s libvtkFiltersModeling-6.3.so.6.3.0 libvtkFiltersModeling.so
sudo ln -s libvtkIOPLY-6.3.so.6.3.0 libvtkIOPLY.so
sudo ln -s libvtkIOGeometry-6.3.so.6.3.0 libvtkIOGeometry.so
sudo ln -s libvtkFiltersTexture-6.3.so.6.3.0 libvtkFiltersTexture.so
sudo ln -s libvtkRenderingFreeType-6.3.so.6.3.0 libvtkRenderingFreeType.so
sudo ln -s libvtkftgl-6.3.so.6.3.0 libvtkftgl.so
sudo ln -s libvtkIOExport-6.3.so.6.3.0 libvtkIOExport.so
sudo ln -s libvtkRenderingAnnotation-6.3.so.6.3.0 libvtkRenderingAnnotation.so
sudo ln -s libvtkImagingColor-6.3.so.6.3.0 libvtkImagingColor.so
sudo ln -s libvtkRenderingContext2D-6.3.so.6.3.0 libvtkRenderingContext2D.so
sudo ln -s libvtkRenderingGL2PS-6.3.so.6.3.0 libvtkRenderingGL2PS.so
sudo ln -s libvtkRenderingContextOpenGL-6.3.so.6.3.0 libvtkRenderingContextOpenGL.so
sudo ln -s libvtkRenderingLabel-6.3.so.6.3.0 libvtkRenderingLabel.so
再次编译
编译报错
/usr/bin/ld: cannot find -lQt5::Core
/usr/bin/ld: cannot find -lQt5::Gui
/usr/bin/ld: cannot find -lQt5::Widgets
/usr/bin/ld: cannot find -lQt5::Test
/usr/bin/ld: cannot find -lQt5::Concurrent
/usr/bin/ld: cannot find -lQt5::OpenGL
解决办法:
https://blog.csdn.net/qq_36501182/article/details/79490410
需要重装opencv
报错:
ERROR: cannot launch node of type [laptop_battery_monitor/laptop_battery.py]: laptop_battery_monitor
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/nano/turtlebot_ws/src
ROS path [2]=/opt/ros/melodic/share
[ERROR] [1563709158.079890774]: Kobuki : malformed sub-payload detected. [180][170][B4 AA 55 4D 01 0F ]
官方的解答:The kobuki platform on finn and jake is known to emit this error. It does not affect the performance (Gunther and bmo do not have this issue):
Kobuki : malformed sub-payload detected. [140][170][8C AA 55 4D 01 0F 48 F4 ]
Kinect:
https://www.cnblogs.com/darklights/p/10543422.html
解决方法:配置了路由器,虚拟机一定要用桥接模式,再重新按教程配置一下就好。
roslaunch turtlebot_navigation amcl_demo.launch map_file:=/tmp/my_map.yaml
然后发现打开不了
解决办法,使用绝对路径