PS.简单总结4月初踩的坑,记下来,备忘。
什么是Cartographer?
官网:https://google-cartographer.readthedocs.io/en/latest/
google的论文:https://static.googleusercontent.com/media/research.google.com/zh-CN//pubs/archive/45466.pdf
参考博客:
1、Jetson TX2环境配置
https://blog.csdn.net/q_quanting/article/details/81017717
2、Cartographer安装
https://blog.csdn.net/rjasd1128hf/article/details/79888305
https://www.cnblogs.com/hitcm/p/5939507.html
坑1:请使用HDMI接口的显示器或者HDMI转DVI,HDMI转VGA无法通过开机自检,开机后可以更换HDMI转VGA接头显示成功。
Jetson TX2 自带ubuntu 16.04 LTS 系统,首次开机时,进入的是以nvidia用户登录的Ubuntu命令行界面。如果要使用图形化界面,需要安装Nvidia Linux驱动。先切换root权限用户,输入“sudo su” 输入密码:nvidia。然后进行以下操作:
cd /home/nvidia/NVIDIA-INSTALLER
./installer.sh
reboot
Emmm…不知为何,就喜欢折腾。刷机吧。
坑2:JetPack3的系统是Ubuntu 16.04 LTS,新版Nvidia SDK 管理工具安装的是Ubuntu 18.04 LTS。
坑3:刷机需要一台Ubuntu14.04或者16.04的主机(虚拟机亦可),JetPack3刷机需要TX2与主机连接同一个路由器且TX2进入刷机模式才能刷机成功;新版SDK管理工具只需要TX2进入刷机模式即可。
开始刷机:
这里需要准备一台pc机(之后都称呼为“主机”),这里给出我成功的配置:
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
更新之:
sudo apt-get update
安装JetPack管理工具 (这里需要注册一个Nvidia账户)
JetPack4.2下载地址:https://developer.nvidia.com/embedded/jetpack
JetPack3.3下载地址:https://developer.nvidia.com/embedded/jetpack-3_3
注:可以选择安装JetPack4.2,不给TX2刷系统,仅更新SDK(取消安装Linux内核前边的勾即可)。
下载的JetPack-L4T-3.3-linux-x64.run。可以将在/目录下创建一个JetPack文件夹用来存放JetPack-L4T-3.3-linux-x64.run。
完成后,打开所在文件夹执行以下命令:
更改权限:
chmod +x ./JetPack-L4T-3.3-linux-x64.run
安装JetPack:
sudo ./JetPack-L4T-3.3-linux-x64.run
坑4:使用有线家用路由器链接,不要使用WiFi或者校园局域网。
如何进入刷机模式:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #为防止误操作后无法恢复,先备份原文件sources.list
sudo gedit /etc/apt/sources.list #打开sources.list,将原来的内容使用”#”符号全部注释掉,然后在文件结尾出添加中国科学技术大学或清华的源
清华源(建议):
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main universe restricted
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main universe restricted
中科大源:
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main universe restricted
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main universe restricted
更新之:
sudo apt-get update
注:换源更新期间踩坑无数,需要具体问题具体分析。
安装fcitx框架
sudo apt-get install fcitx fcitx-pinyin
sudo reboot
重启之:
sudo reboot
至此,TX2的基本环境配置完成了。
在Ubuntu16.04下配置开发环境,如ROS等。
参考:http://wiki.ros.org/cn/ROS/Tutorials
1. 添加sources.list
清华源:(建议)
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
2. 添加秘钥
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
3. 安装
更新
sudo apt-get update
桌面完整版:
sudo apt-get install ros-kinetic-desktop-full
4. 初始化rosdep
sudo rosdep init
rosdep update
5. 配置source
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
6. 安装依赖
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo apt-get install python-rosdep ninja-build
7. 查看环境变量
export | grep ROS
创建一个catkin 工作空间:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
编译之:
cd ~/catkin_ws/
wstool init src
catkin_make
接下来首先source一下新生成的setup.*sh文件:
echo "source /home/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
查看是否配置成功:
echo $ROS_PACKAGE_PATH
至此,ROS配置完成。
参考:https://blog.csdn.net/p942005405/article/details/75715288
简单的几步实现ROS 开发,比eclipse 简单多了。记下来,备忘。
1.安装
sudo apt-get install kdevelop
2.安装Cmake等
sudo apt-get install automake autoconf g++ libtool cmake
3.添加catkin工程
rm -rf build
-DCATKIN_DEVEL_PREFIX=../devel -DCMAKE_INSTALL_PREFIX=../install
4.build 编译调试
编译通过即可。
总结:折腾一周,终于在Nivia Jetson TX2上跑起来了Cartographer_ros和LeGO-LOAM的DEMO,速腾聚创16线雷达与VLP-16返回的数据有差别,正在填坑。
下期更新:踩坑Cartographer(RSLiDAR-16+SC-100S)、踩坑LeGO-LOAM(RSLiDAR-16)