飞控学习随记

2023-05-16

常见指令

编译Arduplane程序

cd ardupilot/
./waf plane	

进入 Tools/autotest 文件夹中,启动3D flightgear

./fg_quad_view.sh 

进入ArduPLane文件夹中,启动仿真

sim_vehicle.py --map --console -L KSFO

(-L 选择起飞位置)
解锁arm throttle
起飞takeoff 50

下载航点

wp load ../Tools/autotest/Generic_Missions/CMAC-circuit.txt
wp list

多机仿真

sim_vehicle.py --map --console -I 0 has FDM in/out ports of 9002/9003 / GCS connection UDP:14550 --sysid=1 
sim_vehicle.py --map --console -I 1 has FDM in/out ports of 9012/9013 / GCS connection UDP:14560 --sysid=2
sim_vehicle.py --map --console -I 2 has FDM in/out ports of 9022/9023 / GCS connection UDP:14570 --sysid=3
sim_vehicle.py --map --console -I 3 has FDM in/out ports of 9024/9025 / GCS connection UDP:14580 --sysid=4

或者
(注意无人机设定序号从0开始,实际序号从1开始)

sim_vehicle.py -v ArduPlane -n 3 --auto-sysid --mcast --console --map
sim_vehicle.py -v ArduPlane -n 4 --auto-sysid -i "0 1 2 3" --mcast --console --map

分别对无人机进行设置
更多参数设置可以参考Tools/autotest/sim_vehicle.py代码,或者启动仿真后,输入help查看命令帮助
所有命令如下:

accelcal        : do 3D accelerometer calibration
accelcalsimple  : do simple accelerometer calibration
adsb            : adsb control
ahrstrim        : do AHRS trim
alias           : command aliases
alllinks        : send command on all links
alt             : show altitude information
arm             : arm motors #解锁油门
attitude        : attitude
auxopt          : select option for aux switches on CH7 and CH8 (ArduCopter only)
bat             : show battery information
batreset        : reset battery remaining
calpress        : calibrate pressure sensors
camctrlmsg      : camctrlmsg
cammsg          : cammsg
cammsg_old      : cammsg_old
canforward      : enable CAN forwarding
capabilities    : fetch autopilot capabilities
changealt       : change target altitude
changealt_abs   : change target absolute altitude
click           : set click location
command_int     : execute mavlink command_int
compassmot      : do compass/motor interference calibration
console         : console module
corrupt_params  : corrupt param storage
devid           : show device names from parameter IDs
dfu_boot        : boot into DFU mode
disarm          : disarm motors
engine          : engine
fence           : geo-fence management
flashbootloader : flash bootloader (dangerous)
forcecal        : force calibration save
formatsdcard    : format SD card
ftp             : file transfer
gethome         : get HOME_POSITION
ground          : do a ground start
guided          : fly to a clicked location on map
gyrocal         : do gyro calibration
hardfault_autopilot : hardfault autopilot
internalerror_autopilot : cause internal error in autopilot
land            : auto land
layout          : window layout management
led             : control board LED
level           : set level on a multicopter
link            : link control
lockup_autopilot : lockup autopilot
log             : log file handling
long            : execute mavlink long command
longloop_autopilot : cause long loop in autopilot
magcal          : magcal
magresetofs     : reset offsets for all compasses
magsetfield     : set expected mag field by field
map             : map control
mode            : mode change
module          : module commands
motortest       : motortest commands
namedvaluefloat : send a NAMED_VALUE_FLOAT
oreoled         : control OreoLEDs
output          : output control
panic_autopilot : panic autopilot
parachute       : parachute
param           : parameter handling
pause           : pause AUTO/GUIDED modes
playtune        : play tune remotely
position        : position
posvel          : posvel
rally           : rally point control
rc              : RC input control
rcbind          : bind RC receiver
reboot          : reboot autopilot
relay           : relay commands
repeat          : repeat a command at regular intervals
reset           : reopen the connection to the MAVLink master
resume          : resume AUTO/GUIDED modes
script          : run a script of MAVProxy commands
scripting       : control onboard scripting
servo           : servo commands
set             : mavproxy settings
setorigin       : set global origin
setspeed        : do_change_speed
setup           : go into setup mode
setyaw          : condition_yaw
shell           : run shell command
signing         : signing control
status          : show status
switch          : flight mode switch control
takeoff         : takeoff
terrain         : terrain control
time            : show autopilot time
tuneopt         : Select option for Tune Pot on Channel 6 (quadcopter only)
up              : adjust pitch trim by up to 5 degrees
vehicle         : vehicle control
velocity        : velocity
version         : fetch autopilot version
watch           : watch a MAVLink pattern
wipe_parameters : wipe autopilot parameters
wp              : waypoint management
vehicle 1

增加自定义模式

增加replan模式,并在执行完auto模式后自动切换到此模式

  • mode.h
    增加模式编号
    在这里插入图片描述
    定义类,内容先仿照guided模式,后续进行修改
    在这里插入图片描述

  • Plane.h中添加ModeReplan replan;
    在这里插入图片描述

  • Control_modes.cpp中添加
    在这里插入图片描述

  • events.cpp
    在这里插入图片描述
    在这里插入图片描述

  • GCS_Mavlink.cpp
    [外链图片转存失败,源站可能有防盗在这里插入!链机制,建描述]议将图片上https://传(imblog.csdnimg.cn-4f8uV32c43faa14dd9af0faa6ba9ab.png132)(https://imug-blog.csdnimg.cn/cd4f8343faa14dd9af0faa6efba1a94b.png)]

  • GCS_Plane.cpp
    在这里插入图片描述

发送总航点数和已完成航点数到Mavproxy

参考代码

const float wp_dist = current_loc.get_distance(flex_next_WP_loc);
    if (wp_dist <= acceptance_distance_m) {
        gcs().send_text(MAV_SEVERITY_INFO, "Reached waypoint #%i dist %um",
                          (unsigned)mission.get_current_nav_cmd().index,
                          (unsigned)current_loc.get_distance(flex_next_WP_loc));
        return true;
	}

仿真wp load 解决无法飞行问题

在这里插入图片描述第四列,22表示起飞点takeoff,一定要有

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

飞控学习随记 的相关文章

  • STM8S程序烧录失败?调试?ST-Link方式新手向教程IAR

    首先我们要接线 xff0c 以上为某块STM8S的原理图 xff0c 我们要SWIM接SWIM xff0c NSET接RESET xff0c GND接GND xff0c 3 3接3 3 接线完成后就是软件部分了 软件部分首先要下载ST li
  • 机器学习算法——K-近邻算法(代码实现手写数字识别)

    0 引言 xff0c K 近邻算法是一种非常有效的分类算法 xff0c 它非常有效且易于掌握 原理 xff1a K 近邻算法通过计算不同样本之间的距离来分类物品 使用前 xff0c 我们需要有一个训练样本集 xff0c 并且样本集中每个数据
  • 为Navigation 2创建自定义behavior tree plugin

    系列文章目录 思岚激光雷达rplidar从ROS 1到ROS 2的移植 ROS 2下navigation 2 stack的构建 订阅rviz2的导航目标位置消息 goal pose 打断behavior tree的异步动作节点 xff0c
  • ubuntu20:/usr/bin/env: ‘python’: No such file or directory

    参考 xff1a https stackoverflow com questions 3655306 ubuntu usr bin env python no such file or directory 第一种可能 xff1a 如果没装p
  • 四轴无人飞行器 之 上位机

  • c/c++编程学习:空指针是什么?

    什么是空指针 xff1f 对于每一种指针类型 xff0c 都有一个特殊的值 空指针 xff0c 空指针与其他所有指针值区分开来 xff0c 保证其不会指向任何函数或者对象等有意义的数据 因此 xff0c 取地址运算符 amp 永远不会产生空
  • 基于ESP32的智能车WiFi图传模块实现

    基于 ESP32 C3 的多协议 WiFi 透传模块 xff08 可用作智能车图传 xff09 本项目为基于乐鑫公司的 ESP32 C3 芯片制作的无线透传模块 xff0c 具有多个通信协议接口 xff1a UART SPI 设计初衷是为了
  • 云服务器下载的镜像文件raw格式转vmdk

    使用软件qemu img https qemu weilnetz de w64 2021 下载之后安装 xff0c 然后进入安装的文件夹 xff0c 打开命令行工具然后执行下面命令 qemu img exe convert p f raw
  • keil5使用Arm Compiler 6编译出错

    Using Compiler 39 V6 15 39 folder 39 D Keil v5 ARM ARMCLANG Bin 39 main c 16 warning In file included from USER stm32f4x
  • 浏览器的相关知识

    今天在网上找到了一些需要大致了解的有关浏览器的相关知识分享 xff0c 原文链接在下方 1 浏览器的主要组成部分是什么 xff1f 用户界面 包括地址栏 前进 后退按钮 书签菜单等 除了浏览器主窗口显示的您请求的页面外 xff0c 其他显示
  • MySQL--用Navicat连接MySQL8.0报错1251问题解决

    文章目录 一 安装后直接用Navicat连接1251报错二 仍报错为 39 mysql 39 不是内部或外部命令 1 环境变量配置 三 找不到MySQL Server 8 0 bin路径四 解决上述全部问题 一 安装后直接用Navicat连
  • 10 分钟让你明白 MySQL 是如何利用索引的

    一 前言 在MySQL中进行SQL优化的时候 xff0c 经常会在一些情况下 xff0c 对 MySQL 能否利用索引有一些迷惑 譬如 MySQL 在遇到范围查询条件的时候就停止匹配了 xff0c 那么到底是哪些范围条件 xff1f MyS
  • 吊炸天的 Docker 图形化工具 —— Portainer

    一 Docker图形化工具二 DockerUI三 船坞四 搬运工1 查看portainer平均值2 选择喜欢的portainer风格整合 xff0c 下载3 启动dockerui容器4 xff0c 网页管理 一 Docker图形化工具 Do
  • 为提高面试通过率,技术岗可以提前做好哪些面试准备?

    Hi xff0c 大家好 xff0c 我是小庄 目前2023届秋招提前批已经陆续开始了 xff0c 考虑到一些校招的同学可能是第一次接触面试 xff08 该文章适用于校招 社招 xff09 xff0c 所以这篇文章就是为了记录一些面试技巧
  • GNU Radio自定义模块:Embedded Python Block的使用

    GNU Radio 学习使用 OOT 系列教程 xff1a GNU Radio3 8创建OOT的详细过程 基础 C 43 43 GNU Radio3 8创建OOT的详细过程 进阶 C 43 43 GNU Radio3 8创建OOT的详细过程
  • 中文分词

    本文首先介绍下中文分词的基本原理 xff0c 然后介绍下国内比较流行的中文分词工具 xff0c 如jieba SnowNLP THULAC NLPIR xff0c 上述分词工具都已经在github上开源 xff0c 后续也会附上github
  • (1)GNSS驱动nmea_navsat_driver 功能包的使用

    总览 该软件包为输出兼容NMEA语句的GPS设备提供了ROS接口 有关原始格式的详细信息 xff0c 请参见NMEA句子的GPSD文档 在成千上万的NMEA兼容GPS设备中 xff0c 我们正在汇编已知支持的设备列表 这个包是与兼容geog
  • (2)ROS传感器之GPS实践

    一 GPS接口类型 GPS接口大体可以分为两类 xff0c 一是单独的GPS接收器 xff0c 通常为USB接口 xff1b 二是与其他传感器集成 xff0c 例如激光雷达或者imu xff0c 大多是USB或者网络接口 xff0c 本文主
  • (6)GPS坐标与UTM坐标的转换

    1 简介 1 1 消息 gps common定义了两个通用消息 xff0c 供GPS驱动程序输出 xff1a gps common GPSFix和gps common GPSStatus 在大多数情况下 xff0c 这些消息应同时发布 xf

随机推荐

  • scanf("%c",&m)中%c前面加空格的作用

    c前面加空格不是必须的 xff0c 但有了空格就可以忽略你输入的空格 例如 xff1a scanf 34 c 34 amp m xff0c 你输入了 a a前面有个空格 xff0c a就能被c接受 但控制符前如果没空格 xff0c 那c就接
  • 聊一聊cropper.js

    最近的项目中有一个纯前端实现的功能困扰了我好久 xff0c 就是用户上传图片以后需要用户进入图片裁剪页并完成上传的功能 xff0c 一开始我是打算自己去用canvas去写这样一个页面的 xff0c 但是项目开发周期短 xff0c 任务紧 x
  • CAS服务(5.3)使用mysql验证

    CAS服务使用mysql验证 一 添加相关依赖 在pom文件里添加下面的依赖 这里cas的版本是5 3 14 lt dependency gt lt groupId gt org apereo cas lt groupId gt lt ar
  • Realsense L515 例程详解 Tutorial 1

    最近在用Realsense L515做一个机器人的视觉部分 看到网上相关资料较少 xff0c 和大家分享一下最近一周所学 第一个例程比较简单 xff0c 实现的功能也比较朴实 实现了什么功能呢 xff1f 就是把从相机得到的深度信息通过控制
  • #AI边缘计算单元-想搞开发,买树莓派还是Nano?

    作者 xff1a Blue Hole 个人网站 xff1a https www wcfde xyz xff0c 欢迎交流 近几年边缘计算快速发展 xff0c 已经渗透到各个行业 边缘计算单元也像雨后春笋涌现出来 xff0c 面对如此多的开发
  • 算法要怎么学习

    学习算法 xff0c 切记不要一上来就开始啃 算法导论 xff0c 毕竟这本书并不适合新手学习 xff0c 如果你之前的算法基础比较薄弱 xff0c 只会一直陷在 拿起来又放下 的循环里 可以怎么入门呢 xff1f 建议还是看书 43 实战
  • EGO-Swarm代码解读-地图部分

    文章目录 1 参数解读2 主要函数解读 1 参数解读 一 MappingData md 中的参数含义 xff1a local bound min span class token punctuation span local bound m
  • GNURadio中的PMTs(Polymorphic Types)数据类型

    目录 1 整体概述 2 使用方法的举例说明 3 对于PMT类型的补充说明 1 整体概述 PMTs在GNURadio中代表多态类型 xff08 Polymorphic Types xff09 xff0c 这种类型不像float int一样是严
  • STM32F103C8T6初学笔记

    STM32F103C8T6初学笔记 ST官网链接 xff1a http www stmicroelectronics com cn ST MCU网站链接 xff1a http www stmcu com cn 初识STM32 STM32是3
  • STM32F103 72MHz时钟设置

    将系统时钟初始化到72MHz的函数 根据数据手册和库函数 xff0c 设置STM32时钟为72MHz 这是 c文件 span class token macro property span class token directive key
  • C++ 类和对象学习 —— 继承

    1 6 继承 利用继承技术 xff0c 可以减少重复代码 1 6 1 继承的基本语法 普通实现 span class token macro property span class token directive keyword inclu
  • 解决 VS 无法打开包括文件: “XXX.h”: No such file or directory问题

    每次封装管理 xff0c 当 Visual Studio 包含多个 h 文件和 c 文件 xff0c 运行时总会发生如下错误 错误 C1083 无法打开包括文件 XXX h No such file or directory test1 0
  • C++ 多态深入学习总结笔记

    多态和虚函数 1 通过案例理解多态 案例 xff1a 父类Animal xff0c 2个子类Dog和Cat xff0c 实现speak方法 未使用虚函数 virtual 声明 main h 文件 span class token keywo
  • LaTeX 报错! Missing $ inserted. <inserted text>$ l.44 问题解决

    学习LaTeX编辑器编辑数学公式时 xff0c 输入如下 xff1a 编译报错如下 xff1a 搜索方法 xff0c 并未得到有效解决 xff0c 机缘巧合把空行删除 xff0c 如下图所示 xff1a 再次编译未报错 xff0c 成功运行
  • 在 Microsoft Word 插入代码块(无需下载任何软件)

    Step 1 打开 CSDN Markdown 编辑器 xff0c 点击菜单栏上方代码块 xff0c 选择自己的代码语言 Step 2 插入代码如下图所示 xff0c 之后将代码复制 Step 3 打开 Microsoft Word xff
  • MATLAB 利用YALMIP+Gurobi 求解线性规划 -多无人机扫描覆盖

    使用要点 创建决策变量设置目标函数添加约束条件参数配置求解问题 问题描述 假设M个无人机的任务是尽快覆盖一组由 P 顶点表示的多边形凸区域 xff0c 假设每架无人机的最大飞行时间是有限的 xff0c 并且是预先知道的 每架无人机的都配备了
  • 毕业论文格式系列1 Word 图片交叉引用其题注

    图表论文自动编号 自动编号可以通过 Word 的 题注 功能实现 按论文格式要求 xff0c 第一章的图编号格式为 图1 X xff0c 具体做法如下 xff1a 将图插入文档中后 xff0c 选中新插入的图 xff0c 在 引用 菜单选
  • Visual Studio 2022 编译新版 Mission Planner 地面站

    下载安装VS 2022 安装时 xff0c 注意勾选 安装成功后 xff0c 从Visual Studio官方SDKs下载net461开发包 xff0c 网址 xff1a https dotnet microsoft com en us d
  • GNU Radio中的流标签(Stream Tags)

    目录 0 GR 中常用术语的官方解释 1 定义概述 2 在数据流中添加标签 3 添加标签的demo举例 4 从数据流中的获取标签 5 提取标签的demo举例 0 GR 中常用术语的官方解释 直接吧官方的解释抄过来 xff0c 直接看英文更容
  • 飞控学习随记

    常见指令 编译Arduplane程序 span class token builtin class name cd span ardupilot waf plane 进入 Tools autotest 文件夹中 xff0c 启动3D fli