大疆经纬M100+Manifold无人机开发总结

 

第一部分    妙算的安装

大疆对于开发者支持这一块做得不是很好。妙算开发手册上有些步骤有错误。

经费多的话还是建议买M210等机型功能比较全面。

1. 连接妙算与云台,有两根线一根是连接云台一根连接飞控。

2. 如果连反在运行Demo是或出现Unobtain等错误

3. 检测是否正确安装运行以下命令

4. cd  /home/ubuntu/manifold_cam

5. make

6. make clean

7. sudo ./test -dt  //显示在屏幕上并在连接djiGo的设备上显示

8. 注意:运行此demo是一定要打开遥控,不然出不了画面

第二部分    安装OnBoardSDK

9. 连接完妙算后接上显示屏首先不要急着安装OSDK要做的是先安装CMake不然可能会在cmake 时cmake不了。

10. 下载完OnBoardSDK 解压 安装

11. 

mkdir build
cd build
cmake ..
make

 

 

 接下来就是运行自带的一些Demo以及激活OSDK

cp ../sample/linux/common/UserConfig.txt bin/

在UserConfig.txt中输入要求的信息

特别注意/dev/tty那一项

 

下载Assailant2 进入到界面后勾选启用API控制

 

 

 

 

cd bin
./djiosdk-flightcontrol-sample UserConfig.txt

 

 

 

 

 

第二部分    安装CUDA OpenCV ROS

  

安装cuda 同手册

sudo dpkg -i cuda-repo-l4t-r21.3-6-5-prod_6.5-42_armhf.deb

sudo apt-get update

sudo apt-get install cuda-toolkit-6-5

 

 

安装OpeCV

1.http://blog.csdn.net/FRD2009041510/article/details/42930113   //图文教程挺详细的

2.http://elinux.org/Jetson/Installing_OpenCV)

1.安装 OpenCV4tegra
访问以下链接以下载安装包“ libopencv4tegra-repo_l4t-r21_2.4.10.1_armhf.
deb ”
http://developer.download.nvidia.com/embedded/OpenCV/L4T_21.2/libopencv4tegra-repo_
l4t-r21_2.4.10.1_armhf.deb   //最新的库版本是2.4.12了
执行以下命令进行安装

00001. 

sudo dpkg -i libopencv4tegra-repo_l4t-r21_2.4.10.1_armhf.deb

00002. 

00003. 

sudo apt-get update

00004. 

00005. 

sudo apt-get install libopencv4tegra libopencv4tegra-dev

00006. 

2.安装函数库

00001. 

sudo add-apt-repository universe

00002. 

00003. 

sudo apt-get update

00004. 

00005. 

# Some general development libraries

00006. 

00007. 

sudo apt-get install build-essential make cmake cmake-curses-gui g++

00008. 

00009. 

# libav video input/output development libraries

00010. 

00011. 

sudo apt-get install libavformat-dev libavutil-dev libswscale-dev

00012. 

00013. 

# Video4Linux camera development libraries

00014. 

00015. 

sudo apt-get install libv4l-dev

00016. 

00017. 

# Eigen3 math development libraries

00018. 

00019. 

sudo apt-get install libeigen3-dev

00020. 

00021. 

# OpenGL development libraries (to allow creating graphical windows)

00022. 

00023. 

sudo apt-get install libglew1.6-dev

00024. 

00025. 

# GTK development libraries (to allow creating graphical windows)

00026. 

00027. 

sudo apt-get install libgtk2.0-dev

00028. 

00029. 

 

00030. 

3.安装opencv源码

①.下载源码(推荐2.4.10)

 

https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.10/

 

②.解压

00001. 

cd Downloads

00002. 

00003. 

unzip opencv-2.4.10.zip

00004. 

00005. 

mv opencv-2.4.10 ~

00006. 

③.Make

00001. 

cd ~/opencv-2.4.10

00002. 

00003. 

mkdir build

00004. 

00005. 

cd build

00006. 

00007. 

cmake -DWITH_CUDA=ON -DCUDA_ARCH_BIN="3.2" -DCUDA_ARCH_PTX="" -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF ..

00008. 

00009. 

sudo make -j4 install

00010. 

④.配置环境变量

echo "# Use OpenCV and other custom-built libraries." >> ~/.bashrc

echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/" >> ~/.bashrc

source ~/.bashrc

.测试

第一个例子:边缘提取

# Test a simple OpenCV program. Creates a graphical window, hence you should plug a HDMI monitor in or use a remote viewer such as X Tunneling or VNC or TeamViewer on your desktop.

cd ~/opencv-2.4.10/samples/cpp

g++ edge.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -o edge

(Or for OpenCV 3.0: g++ edge.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -o edge)

./edge

第二个例子:摄像头图像的拉普拉斯变换

# If you have a USB webcam plugged in to your board, then test one of the live camera programs and linking to every OpenCV module.

g++ laplace.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -o laplace

(Or for OpenCV 3.0: g++ laplace.cpp -lopencv_adas -lopencv_bgsegm -lopencv_bioinspired -lopencv_calib3d -lopencv_ccalib -lopencv_core -lopencv_datasets -lopencv_face -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_latentsvm -lopencv_line_descriptor -lopencv_ml -lopencv_objdetect -lopencv_optflow -lopencv_photo -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_surface_matching -lopencv_text -lopencv_tracking -lopencv_videoio -lopencv_video -lopencv_videostab -lopencv_xfeatures2d -lopencv_ximgproc -lopencv_xobjdetect -lopencv_xphoto -o laplace)

./laplace

第三个例子:CPU和GPU进行图像的霍夫变换

# Test a GPU accelerated OpenCV sample.

cd ../gpu

g++ houghlines.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videostab -o houghlines

./houghlines ../cpp/logo_in_clutter.png

 

第三部分 安装ROS

抱歉我只有一次装成功了,其他几次装完你之后重启的时候系统就崩了。

 

 

第四部分

刷机可以按照手册杀过来。但有两个坑

第一个   有个路径写错了

第二   解压完后直接恢复系统镜像,不要制作系统镜像不会成功的(等一天都不会动)

第三恢复系统后 会出现闪屏 这个是时候

apt-get update

apt-get upgrade

一下就可以了

 

 

你可能感兴趣的:(学习笔记)