硬件方面:开关,自稳按钮,方向控制遥感,油门遥感,一键降落按钮,
1.根据开源源码找到引脚对应功能,以及实际各模块,按钮等,进行原理图的绘制,出个初板
2.后续按需修改
软件方面:
1.编译出firmware固件,开发环境的搭建
编译环境是win10自带的ubuntu18.04,软件运行环境的搭建步骤如下:
编译环境是Ubuntu18.04,遥控器是x9E 记录一下过程。 在安装之前请apt-get update 与 apt-get upgrade 安装库: apt-get install cmake gcc gcc-avr avr-libc build-essential \ libfox-1.6-dev libsdl1.2-dev python-pyqt5 \ qt5-default qttools5-dev-tools qtmultimedia5-dev qttools5-dev libqt5svg5-dev \ gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib 缺少qt5svg:apt-get install python3-pyqt5.qtsvg 缺少libstdc++-arm-none-eabi-newlib :vi /etc/apt/sources.list 添加源 deb http://ftp.de.debian.org/debian sid main apt-get update apt-get install libstdc++-arm-none-eabi-newlib
在Ubuntu18.04 还要装 sudo apt-get install qt5-default qttools5-dev-tools qtmultimedia5-dev qttools5-dev sudo apt-get install python3-pyside.qtwebkit上面一切顺利的话, 下载源码git clone --recursive -b 2.2 https://github.com.cnpmjs.org/opentx/opentx.git cd opentx mkdir build-taranis-debug cd build-taranis-debug cmake -DPCB=X9D+ -DGVARS=YES -DLUA=YES -DDEBUG=YES -DCMAKE_BUILD_TYPE=Debug ../ 然后会看到 -- The C compiler identification is GNU 4.8.5 -- The CXX compiler identification is GNU 4.8.5 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- OpenTX 2.2.0 -- Looking for SDL -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE SDL Include Path: /usr/include/SDL -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc USING -std=gnu++11 WARNING: can't find gtests source, gtest target will not be available! -- Looking for QT lupdate -- /usr/bin/lupdate QT lupdate: /usr/bin/lupdate -- Configuring done -- Generating done -- Build files have been written to: opentx/build-taranis-debug
说明配置成功了。
接下来编译固件 make firmware |
其中github源码链接替换为https://github.com.cnpmjs.org/opentx/opentx.git
其中opentx版本2.2可以改为最新的2.3
其中x9d遥控器型号替换(自己用的型号)即可,
具体可参考源码hal.h里面的芯片型号引脚定义,编译时需要和自己实际原理图一致,最后按步骤顺利得到firmware.bin固件文件.上述过程指令如下:
cd opentx
rm -rf build-taranis-debug
mkdir build-taranis-debug
cd build-taranis-debug
cmake -DPCB=X9D+ -DGVARS=YES -DLUA=YES -DDEBUG=YES -DCMAKE_BUILD_TYPE=Debug ../
make firmware
2.查看源码大致结构和内容,等待硬件出版完成后,烧录固件测试,进行测试
官方说明文档:https://doc.open-tx.org/manual-for-opentx-2-2/
网上找的文档:https://www.taholab.com/19464
3.预计完整代码测试无误后,会删去不必要的代码,增加和ardupilot通讯的需求
4.后续按需修改
参考链接:http://bbs.5imx.com/forum.php?mod=viewthread&tid=1293621