当前位置:网站首页>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
谢谢大家!!!!!!!
边栏推荐
- 5 IPOs, Internet home improvement is not as simple as Tubatu thinks
- PG's huge page
- nyoj714 Card Trick(第六届河南省程序设计大赛)
- 在Unity URP中实现Forward+
- 分布式文件系统fastDFS
- 疫情期间闲来无事,我自制了一个按钮展示框特效来展示我的博客
- [BJDCTF2020]Easy MD5
- laravel 在工作日(节假日除外)运行调度程序命令
- MogDB study notes - starting from 0
- Learn about layered architecture & SOA architecture together
猜你喜欢
uniapp parent component uses prop to pass asynchronous data to child components
How to add F4 Value Help to the input parameters of the report in the ABAP report
[ZJCTF 2019]NiZhuanSiWei
ABAP 报表中如何给报表的输入参数增添 F4 Value Help
Lecture 4: Database Definition Language of DDL Type of SQL Statements
什么是Shell?从小白到入门你只差一个它
[极客大挑战 2019]BuyFlag&&[HCTF 2018]admin
大学生图书馆网页设计模板代码 DIV布局书店网页作业成品 学校书籍网页制作模板 学生简单书籍阅读网站设计成品
干货技巧|如何用3DsMax制作笔记本电脑
Redis之SDS数据结构
随机推荐
USB CY68013设备描述符识别失败
What is the main purpose of software testing?
企业进行知识共享的好处有哪些?
十六、一起学习Lua 文件 I/O
MogDB study notes - starting from 0
ADB安装方法:
Flutter Chart
golang for循环详解
3D角色建模师和3D角色动画师哪个更有前景?哪个更适合小白入门?
Learn about layered architecture & SOA architecture together
BP neural network
Geometric g6 will carry harmonyos system, a comprehensive upgrade competitiveness of products
Rethinking HTAP database caused by rereading GPDB and TiDB papers
5 IPOs, Internet home improvement is not as simple as Tubatu thinks
view, index
PX4-做飞控二次开发需要知道的事情-Cxm
性能优化|从ping延时看CPU电源管理
3D游戏建模教程:游戏角色制作——赏金猎人,超逼真
用工具实现 Mock API 的整个流程
Goose Factory Robot Dog Fancy Crossing 10m Plum Blossom Pile: Front Flip, Single Pile Jump, Get Up and Bow... No stumble in the whole process