当前位置:网站首页>PX4-Things you need to know for secondary development of flight control-Cxm
PX4-Things you need to know for secondary development of flight control-Cxm
2022-08-08 19:20:00 【CHENxiaomingming】
前言:
废话:
来了,之前一直在做APMDevelopment of flight control,found in addition to corporate useAPM,still in the gamePX4a little more,In addition, there is also a need for this recently, so I picked it up again.PX4.The biggest difference between the two flight controllers should be the system.,PX4学习起来还是比较简单的,Compare systems and modularity.recoveringPX4之前,And try to transplantNUTTXThe system finds that if it wants to doPX4这种,It is very troublesome to write a lot of compile chains and scripts,I will directly use altogetherPX4了,That's why I regainedPX4的原因.
Questions about setting up the environment
阿木实验室、科学上网、Many resources such as Baidu are mostly network problems,If you have done all these and still can't compile successfully!!!!!评论留言!!!!!!
学习路线
Find that many of the study of the flight control and I are both students,If you just want to add functionality at the application layer, you only need to start from digital point+51+STM32+LINUXbasically can doPX4的开发了,If want to optimization of flight control or want to control in addition to the previous level deep ****+NUTTX+mavlink+各种协议+线代+控制论等,If I am fortunate enough to deeply cultivate the sharing process without reservation.
学习资源
In addition to the learning route, there are many resources that students ask where to find.,Did you pay for classes?,我有21I bought Amu'sPX4Development of intermediate courses but not much content is basically talking about some basics, so I haven't bought any courses in the future.,The basic source of learning resources are and I love you+官方+百度+群里+CSDN.The best and latest resources are of course from the official ones. Post the official link and the link to the Amu document. They are all very good resources..
https://github.com/PX4/PX4-Autopilot
5-进阶功能-outdoor pointing flight — P系列无人机-wiki 1.0 文档
PX4的作用
简单的介绍一下PX4,It is a foreign open source flight control project,Its hardware platform usesPIXHAWK,PX4Not just multi-rotor drones or even fixed-wing,无人车等,其实个人觉得PX4What's really powerful is the potential of his entire project,Due to the system architecture of the entire project,It supports a variety of protocols, so learnPX4More than just flight control,可以说PX4Meet the needs of me most in the embedded development,If you want to look goodUI就另说了.
记录方式
I will continue to update my learning experience and journey in the blog,通过APMI found that everyone is not very fond of watching that kind of source code analysis.,Add more like some practical function,Moved directly can use that one,所以之后的PX4文章,I will use a project-based way to record and hope it can help everyone,This article is mainly to briefly introduce the protocols and knowledge we need to use,I won't talk about it later.
目录
PX4system and compilation
PX4采用的系统是NUTTX,系统官方链接,简单来说就是8位到64an embedded system,The advantage is that it supports more content(hardware and various protocols).Understand this becausepx4没用使用muttxThe way the native functionality is added is placed inapps里面,As for the careful students in the compilation process, they must have discoveredMakefile这个文件,This is the compile script this islinuxCompile scripts in the environment,The role is to compile,Can control who compiles first and who compiles later,compile with what,to compile those etc..
除了Makefile还有CMakeLists.txt
可以吧CMAKEUnderstand it as a configuration file for auxiliary compilation,We can configure what we want to compile and the size etc.,看案例,You can see only two files
DMODULE 下的名字,MAIN main function command,SRCS 源码


PX4的通信协议
PX4The communication protocol with the ground station ismavlinkAnd the internal communication protocol isuorb协议 malinkIt's the flight control,而uorbIt is a protocol for data communication between systems,There are many of these things on the same platform. I won't go into details. I will post them directly in future projects. This is also very understandable.
uorbThe protocol is roughly used in:
1.创建 .msg 结构体文件
2.添加进CMakeLists.txt 注册
看图可知msgCommunication is really a data message forwarding,uarb分为注册,发布,订阅,在msgAfter adding contentPX4It will automatically compile the header file of the same name for you and store it inuORB/topics/中 For example I put a wasd.msgfile will automatically generate awasd.hheader file and We can call our source code like#include <uORB/topics/wasd.h>So we can let themsgLook at a header file where we save data forwarding data.
The second step is to add into our overallCMakefile registered outsidemsg文件夹中和.msgHide the files together, see Figure 2 and add it in the same format as Figure 3.



PX4的进程
Call the task scheduling library,然后分配资源
See the official case
1module是进程名
2is the default schedule
3是优先级
4是栈大小
5是入口函数


总结
Build good compilation environment,will compile the process and communication protocol,And the addition of the process can start our initial development,In this article, I did not explain these contents in detail. If you are interested, you can search on the same platform.,The next step is for us to master the functionality as we developpx4architecture and native code functionality
谢谢大家!!!!!!!
边栏推荐
- 数据库学习之库的操作
- 为啥程序员下班后只关显示器从不关电脑?看看各大网站的答案~
- Learn about layered architecture & SOA architecture together
- Is there any function in MAXCOMPUTE SQL to judge whether the string is a number?
- 几何g6将搭载harmonyos系统,产品竞争力全面升级
- nyoj714 Card Trick(第六届河南省程序设计大赛)
- 疫情期间闲来无事,我自制了一个按钮展示框特效来展示我的博客
- 启牛商学院开户是安全的吗?开户靠谱吗?
- USB CY68013设备描述符识别失败
- Advanced CAD practice (2)
猜你喜欢

即将开幕!阿里云飞天技术峰会邀您一同探秘云原生最佳实践

【kali-权限提升】(4.2.6)社会工程学工具包(上):中间人攻击原理

Style Design Principles in Open Office XML Format

Smobiler的复杂控件的由来与创造

Advanced CAD practice (2)

shell的各种三角形

golang流程控制:if分支、switch分支和fallthrough switch穿透

Rethinking HTAP database caused by rereading GPDB and TiDB papers

第4讲:SQL语句之DDL类型的数据库定义语言

ABAP 报表中如何给报表的输入参数增添 F4 Value Help 试读版
随机推荐
Style Design Principles in Open Office XML Format
启牛商学院开户是安全的吗?开户靠谱吗?
8月报考季,软考选科目避坑指南来啦
Performance optimization | CPU power management from the perspective of ping delay
el-tree设置单选,点击完成后收起
Flush can buy stock?Is it safe to buy stocks?
最长子串(长沙理工大学第十一届程序设计竞赛 离线 做了n天.....崩溃了)
使用 lua 运行 fscript
为啥程序员下班后只关显示器从不关电脑?看看各大网站的答案~
数字化工厂建设的内容主要有哪三个方面
El - tree set radio, click finish after assemble
n个数取出r个数排列
Monaco-Editor 多人协作 编辑器
什么是Shell?从小白到入门你只差一个它
C语言初阶-结构体
Leetcode 23.合并K个升序链表 链表归并合并
2022年美术生就业前景解析
Build DG will increase the amount of lead to archive log problem
CAD进阶练习(二)
Oracle--表