https://elinux.org/Jetson_TX1
拿到TX1开发板之后,系统预装了Ubuntu16.04的系统,一些基本的开发配置也不完整,而且系统的内核版本也比较低,随着NVIDIA的不断维护,现在可以使用JetPeck3.0/3.1来刷机(当前已经推出了3.2版本了,还在内测)
#查看
系统版本 cat /etc/nv_tegra_release
cuda版本 nvcc -V
opencv版本
$ python
import cv2 // 呼叫 library,如果出現 ERROR ,说明没成功
print cv2.version // Check 一下版本,OpenCV4Tegra
TX1 GPU的使用情况
sudo ~/tegrastats
EMC – memory controller
AVP – audio/video processor
VDE – video decoder engine
GR3D – GPU
tk1 tx1自定义刷机方式
#Download and Install JetPack L4T
刷机时的几点注意:
添加固态硬盘
因为TX1仅有4G内存和16G的存储空间,这对于后续的开发是远远不够的,所以需要拓展一个固态硬盘,刚好TX1有个STAT接口 ,因此拓展了一个120G的固态硬盘。
http://www.jetsonhacks.com/2017/01/28/install-samsung-ssd-on-nvidia-jetson-tx1/
http://makaidong.com/qq_35497808/1/1871_12433766.html
更新源,进行浏览器和输入法的配置
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/ubuntu-ports trusty main universe restricted multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports trusty-security main universe restricted multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports trusty-updates main universe restricted multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports trusty main universe restricted multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports trusty-security main universe restricted multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports trusty-updates main universe restricted multiverse
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install epiphany-browser
sudo apt-get install ibus-googlepinyin
启电脑之后,找到文本输入设置(Text Entry Settings): add google
到此,基本环境已经配置好,下面是在后续的学习过程中,开发环境的配置。
建议在刷机的时候,安装JetPack提供的开发工具
修改USB2.0 为USB3.0
sudo vi /boot/extlinux/extlinux.conf
usb_port_owner_info=0改成usb_port_owner_info=2
#开发环境的配置
//源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
//key
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-ros-base
sudo rosdep init
rosdep update
// rosdep init error
//ERROR: cannot download default sources list from: ... Website may be down.
//SOLUTION
// sudo -E rosdep init
// sudo c_rehash /etc/ssl/certs
creat_workspace
catkin_create_pkg package-name
catkin_make
安装 TX1版本的 ZED -SDK
安装ROS wrapper.
不过在 编译安装之前需要安装一些依赖,不然在ros_workspace下无法编译通过 wrapper
sudo apt-get install ros-kinetic-pcl-ros
sudo apt-get instal libglew-dev
sudo apt-get install libopencv-videostab2.4
sudo apt-get install ros-kinetic-image-transport
sudo apt-get install ros-kibnetic-cv-bridge
sudo apt-get install ros-kibnetic-camera-info-manager
sudo apt-get install ros-kibnetic-tf2-geometry-msgs
然后再catkin_make 编译 就可正常编译ROS- wrapper-master了,可以测试一下launch文件
roslaunch zed_wrapper zed.launch
rqt_image_view
rosrun rviz rviz
在Displays->Global Options->Fixed Frame选择zed_initial_frame
点击下面的按钮ADD,选择By Topic,再选point_cloud->cloud->PointCloud2
在ROS使用zed双目相机
zed get start
sudo apt-get install libpcl-dev pcl-tools
sudo apt-get install liboctomap-dev
sudo apt-get install libopenmpi-dev
sudo apt-get install liboeigen3-dev
sudo apt-get install ros-kinetic-mavros
sudo apt-get install ros-kinetic-octmap-ros ros-kinetic-octomap-msgs
sudo apt-get install ros-kinetic-pcl-ros
##ros-kinetic-mavlin ros-kinetic-mavros
源码在TX1上编译总报错
直接用apt-get 安装总是报错,
然后就直接下载deb包安装
需要注意 TK1 armhf架构 TX1是arm64架构
//先下载
http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-mavros/ros-kinetic-mavros_0.22.0-0xenial-20180105-182000-0800_arm64.deb
安装先mavlink 然后再mavros
中间的依赖
sudo apt-get install geographiclib-tools libgeographic-dev ros-kinetic-diagnostic-updater ros-kinetic-eigen-conversions ros-kinetic-geographic-msgs ros-kinetic-libmavconn ros-kinetic-mavros-msgs
sudo dpkg -i ros-kinetic-mavros_0.22.0-0xenial-20180105-182000-0800_arm64.deb
运行mavros源码下的 /mavros/mavros/scripts/install_geographiclib_datasets.sh 脚步 安装
Installing GeographicLib geoids egm96-5
Installing GeographicLib gravity egm96
Installing GeographicLib magnetic emm2015
Nvidia Jetpack会安装一个称为OpenCV4Tegra的特殊闭源版本的OpenCV,它针对Jetson进行了优化,并且比开源版本稍快。 虽然OpenCV4Tegra的运行速度比纯OpenCV 2更快,但OpenCV 2的所有版本都不支持从gstreamer中捕获视频,所以我们无法从中轻松获取视频。因此有些时候我们需要自己自定义安装 opencv
选项从源代码编译OpenCV 3,它支持从gstreamer捕获视频。所以我们将用一个自编的OpenCV 3替换OpenCV4Tegra
卸载 OpenCV4Tegra
sudo apt-get purge libopencv4tegra-dev libopencv4tegra
sudo apt-get purge libopencv4tegra-repo
sudo apt-get update
下载Jetson Hacks的Jetson TX2 OpenCV安装程序:
git clone https://github.com/jetsonhacks/buildOpenCVTX2.git
cd buildOpenCVTX2
打开buildOpenCV.sh
并将 -DWITH_GSTREAMER = OFF 更改为-DWITH_GSTREAMER = ON,
确保OpenCV编译时使用gstreamer支持。
#!/bin/bash
# License: MIT. See license file in root directory
# Copyright(c) JetsonHacks (2017)
cd $HOME
sudo apt-get install -y \
libglew-dev \
libtiff5-dev \
zlib1g-dev \
libjpeg-dev \
libpng12-dev \
libjasper-dev \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libpostproc-dev \
libswscale-dev \
libeigen3-dev \
libtbb-dev \
libgtk2.0-dev \
cmake \
pkg-config
# Python 2.7
sudo apt-get install -y python-dev python-numpy python-py python-pytest -y
# GStreamer support
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout -b v3.3.0 3.3.0
# This is for the test data
cd $HOME
git clone https://github.com/opencv/opencv_extra.git
cd opencv_extra
git checkout -b v3.3.0 3.3.0
cd $HOME/opencv
mkdir build
cd build
# Jetson TX2
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_PNG=OFF \
-DBUILD_TIFF=OFF \
-DBUILD_TBB=OFF \
-DBUILD_JPEG=OFF \
-DBUILD_JASPER=OFF \
-DBUILD_ZLIB=OFF \
-DBUILD_EXAMPLES=ON \
-DBUILD_opencv_java=OFF \
-DBUILD_opencv_python2=ON \
-DBUILD_opencv_python3=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DWITH_OPENCL=OFF \
-DWITH_OPENMP=OFF \
-DWITH_FFMPEG=ON \
-DWITH_GSTREAMER=ON \
-DWITH_GSTREAMER_0_10=OFF \
-DWITH_CUDA=ON \
-DWITH_GTK=ON \
-DWITH_VTK=OFF \
-DWITH_TBB=ON \
-DWITH_1394=OFF \
-DWITH_OPENEXR=OFF \
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 \
-DCUDA_ARCH_BIN=6.2 \
-DCUDA_ARCH_PTX="" \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_TESTS=ON \
-DOPENCV_TEST_DATA_PATH=../opencv_extra/testdata \
../
# Consider using all 6 cores; $ sudo nvpmodel -m 2 or $ sudo nvpmodel -m 0
make -j4
/buildOpenCV.sh
cd ~/opencv /build
sudo make install
在TX1/TX2上,不像PC版的linux,可以安装那么多丰富的IDE开发环境,vscode/ roboware 都装不了,所以我选择安装了轻量级的代码编辑编译工具codeblock ,方便代码的查看、编辑以及编译
sudo apt-get install libcodeblocks0 codeblocks codeblocks-contrib
sudo libwxsmithlib0 codeblocks-contrib libwxgtk**(具体版本)
TK1 TX1开发工具安装
IDE&codeblock
Code::Blocks IDE available for Jetson TK 1 ?
Recommended IDE for Jetson TX2?
IDE CUDA for Jetson TK1