当前位置:网站首页>APM flight mode switching -- source code explanation
APM flight mode switching -- source code explanation
2022-06-22 11:37:00 【Childe_ plume】
APM There are many ways to change the flight mode in flight control . The most common methods are remote control switching and ground station switching .

Take the remote control switching as an example to explain the flight mode switching logic .

APM The source code for the remote control to switch the flight mode is in RC_Channel.cpp In the document RC_Channel_Copter::do_aux_function_change_mode() Function .

const bool success = copter.set_mode() call Copter::set_mode() function , stay set_mode() Call in function mode_from_mode_num() Function to pre switch .new_flightmode Will not immediately switch to the new mode , Instead, it will judge whether to switch to the past according to the equipment status required by the new mode .

If the above items pass the inspection , Then exit the old mode . Set new mode , The switch is successful .

take flightmode The parent class pointer points to the new child class , stay Copter::fast_loop() Function with 400Hz Frequency call of flightmode->run().
therefore , The operating frequency of each flight mode is 400Hz.
边栏推荐
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用summary函数获取模型汇总统计信息
- 社恐?自我介绍时大脑一片空白?
- Install pyGame
- [user case - intelligent manufacturing] Digital generous "cloud" collaboration, leap over Qianshan "guarantee" production!
- 牛客练习赛94D题解
- 奋斗吧,程序员——第四十二章 会挽雕弓如满月,西北望,射天狼
- Redis常用命令
- JG_ fx_ twenty million two hundred and twenty thousand six hundred and twenty
- canvas简单的粒子效果的实现
- TCP 3次握手的通俗理解
猜你喜欢

Security risks exist in open source code: an average of 49 vulnerabilities exist in a project

Getting to know elastricearch

Interpretation of MAML (model agnostic meta learning)

Web Configuration of Visual Studio Code

Wechat applet project example - image processing gadget (self-made low configuration version of Meitu XiuXiu)

Rtklib postpos carding (taking single point positioning as an example)

Today, how does sysak implement business jitter monitoring and diagnosis Take you through Anolis OS 25-26

MAML (Model-Agnostic Meta-Learning) 解读

攻防演练 | 基于ATT&CK的威胁狩猎实践案例
![[Software Engineering] Introduction & process and life cycle modeling](/img/92/433e2fae846406252ee0d4c47bd54b.png)
[Software Engineering] Introduction & process and life cycle modeling
随机推荐
R语言epiDisplay包的idr.display函数获取泊松回归poisson模型的汇总统计信息(初始事件密度比IDR值、调整事件密度比IDR值及其置信区间、Wald检验的p值和似然比检验的p值)
How much memory does a TCP connection occupy?
Instanceinforeplicator class of Eureka (service registration assistant)
xlrd. biffh. XLRDError: Excel xlsx file; Not supported solution
arc128 C 凸包优化后缀和?
CVPR 2022 oral | a new motion oriented point cloud single target tracking paradigm
奋斗吧,程序员——第三十七章.雄关漫道真如铁,而今迈步从头越
Solve the problem that the chrome icon of Google browser in win7 taskbar is missing and abnormally blank
Basic principles of the Internet
Data skew analysis of redis slice cluster
Convert the colored liquid image into transparent liquid, and CMU teaches the robot to accurately control how much water is poured into the cup
【云图说】 第244期 三分钟了解容器镜像服务
牛客挑战赛53C
TCP 3次握手的通俗理解
安装pygame
From prototype chain to inheritance, illustrate the context and recommend collection
R语言dplyr包mutate函数将dataframe中的两个数值变量相除创建新的数据列(Create a new variable)
CF751D Difficult Mountain
【软工】 概论 & 过程和生命周期建模
云端极简部署Svelte3聊天室