Windows下使用Airsim+QGC进行PX4硬件在环HITL(二)

2024-06-05 08:28

本文主要是介绍Windows下使用Airsim+QGC进行PX4硬件在环HITL(二),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Windows下使用Airsim+QGC进行PX4硬件在环HITL

This tutorial will guide you through the installation of Airsim and QGC on Windows, so that the hardware-in-the-loop experiment can be conducted.

Hardware-in-the-Loop (HITL or HIL) is a simulation mode in which normal PX4 firmware is run on real flight controller hardware. This approach has the benefit of testing most of the actual flight code on the real hardware.

In 2017 Microsoft Research created AirSim (Aerial Informatics and Robotics Simulation) – an open-source robotics simulation platform. From ground vehicles, wheeled robotics, aerial drones, and even static IoT devices, AirSim enabled data capture data for models without costly field operations.​

文章目录

  • Windows下使用Airsim+QGC进行PX4硬件在环HITL
    • (一)Required softwares
    • (二)Preperation for HITL
      • 1, Bootloader preperation
      • 2, Firmware download
      • 3, Hardware in the loop(HITL) Configuration
      • 4, Configure AirSim
    • (三)HITL Testing
    • (四)Virtual flight in HITL

(一)Required softwares

Windows下使用Airsim+QGC进行PX4硬件在环HITL(一)

(二)Preperation for HITL

1, Bootloader preperation

If you have programmed the pixhawk board using self-written code, then it cannot work as flight controller any more. To restore the flight controller function, the firmware should be programmed into the board. This is usually done by QGroundControl. However, before downloading firmware, a bootloader program should first be downloaded using STLink Utility into the board for the purpose of initialization.

The prebuilt bootloader hex files(one for co-mcu, the other for main-mcu) are provided. You can also refer to the following links to do it on your own.

Official Github Repository: PX4/PX4-Bootloader: PX4 Bootloader for PX4FMU, PX4IO and PX4FLOW (github.com)

Blogs: pixhawk FMU/IO板bootloader烧写_pixhawk4 bootload烧写-CSDN博客

关于PX4-Bootloader编译的几个小问题 - 知乎 (zhihu.com)

2, Firmware download

Connect the board using micro-usb to your computer.
Open QGC, and click the upper-right icon.
请添加图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
Reboot your device(unplug and plug the USB), you will see interface like this. There may be some error windows popping up, just ignore them.
在这里插入图片描述
在这里插入图片描述

3, Hardware in the loop(HITL) Configuration

Follow the user guide(all the content before section Simulator-Specific Setup): Hardware in the Loop Simulation (HITL) | PX4 User Guide (v1.13)

4, Configure AirSim

You can find the configuration file for AirSim in path like this:

"C:\Users\YourUserName\Documents\AirSim\settings.json"

Copy the code to your own file. Note you should look up your own serial port number for Pixhawk after connecting it to your computer and modify this line: "SerialPort": "COM5",.

{"SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/main/docs/settings.md","SettingsVersion": 1.2,"SimMode": "Multirotor","ClockType": "SteppableClock","Vehicles": {"PX4": {"SerialBaudRate": 921600, "SerialPort": "COM5","VehicleType": "PX4Multirotor","ControlIp": "127.0.0.1","ControlPort": 14580,"LogViewerHostIp": "127.0.0.1","LogViewerPort": 14388,"QgcHostIp": "127.0.0.1","QgcPort": 14550,"UseSerial": true,"LockStep": true,"UdpIp": "127.0.0.1","UdpPort": 14560,"TcpPort": 14560,"UseTcp": true,"Model": "Generic","LocalHostIp":"127.0.0.1","Sensors":{"Barometer":{"SensorType": 1,"Enabled": true,"PressureFactorSigma": 0.0001825}},"Parameters": {"NAV_RCL_ACT": 0,"NAV_DLL_ACT": 0,"COM_OBL_ACT": 1,"LPE_LAT": 47.641468,"LPE_LON": -122.140165}}}}

(三)HITL Testing

Windows下使用Airsim+QGC进行PX4硬件在环HITL(三)

(四)Virtual flight in HITL

Windows下使用Airsim+QGC进行PX4硬件在环HITL(四)

这篇关于Windows下使用Airsim+QGC进行PX4硬件在环HITL(二)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1032569

相关文章

如何使用 Python 读取 Excel 数据

《如何使用Python读取Excel数据》:本文主要介绍使用Python读取Excel数据的详细教程,通过pandas和openpyxl,你可以轻松读取Excel文件,并进行各种数据处理操... 目录使用 python 读取 Excel 数据的详细教程1. 安装必要的依赖2. 读取 Excel 文件3. 读

解决Maven项目idea找不到本地仓库jar包问题以及使用mvn install:install-file

《解决Maven项目idea找不到本地仓库jar包问题以及使用mvninstall:install-file》:本文主要介绍解决Maven项目idea找不到本地仓库jar包问题以及使用mvnin... 目录Maven项目idea找不到本地仓库jar包以及使用mvn install:install-file基

Windows 上如果忘记了 MySQL 密码 重置密码的两种方法

《Windows上如果忘记了MySQL密码重置密码的两种方法》:本文主要介绍Windows上如果忘记了MySQL密码重置密码的两种方法,本文通过两种方法结合实例代码给大家介绍的非常详细,感... 目录方法 1:以跳过权限验证模式启动 mysql 并重置密码方法 2:使用 my.ini 文件的临时配置在 Wi

Python使用getopt处理命令行参数示例解析(最佳实践)

《Python使用getopt处理命令行参数示例解析(最佳实践)》getopt模块是Python标准库中一个简单但强大的命令行参数处理工具,它特别适合那些需要快速实现基本命令行参数解析的场景,或者需要... 目录为什么需要处理命令行参数?getopt模块基础实际应用示例与其他参数处理方式的比较常见问http

C 语言中enum枚举的定义和使用小结

《C语言中enum枚举的定义和使用小结》在C语言里,enum(枚举)是一种用户自定义的数据类型,它能够让你创建一组具名的整数常量,下面我会从定义、使用、特性等方面详细介绍enum,感兴趣的朋友一起看... 目录1、引言2、基本定义3、定义枚举变量4、自定义枚举常量的值5、枚举与switch语句结合使用6、枚

使用Python从PPT文档中提取图片和图片信息(如坐标、宽度和高度等)

《使用Python从PPT文档中提取图片和图片信息(如坐标、宽度和高度等)》PPT是一种高效的信息展示工具,广泛应用于教育、商务和设计等多个领域,PPT文档中常常包含丰富的图片内容,这些图片不仅提升了... 目录一、引言二、环境与工具三、python 提取PPT背景图片3.1 提取幻灯片背景图片3.2 提取

使用Python实现图像LBP特征提取的操作方法

《使用Python实现图像LBP特征提取的操作方法》LBP特征叫做局部二值模式,常用于纹理特征提取,并在纹理分类中具有较强的区分能力,本文给大家介绍了如何使用Python实现图像LBP特征提取的操作方... 目录一、LBP特征介绍二、LBP特征描述三、一些改进版本的LBP1.圆形LBP算子2.旋转不变的LB

Maven的使用和配置国内源的保姆级教程

《Maven的使用和配置国内源的保姆级教程》Maven是⼀个项目管理工具,基于POM(ProjectObjectModel,项目对象模型)的概念,Maven可以通过一小段描述信息来管理项目的构建,报告... 目录1. 什么是Maven?2.创建⼀个Maven项目3.Maven 核心功能4.使用Maven H

Python中__init__方法使用的深度解析

《Python中__init__方法使用的深度解析》在Python的面向对象编程(OOP)体系中,__init__方法如同建造房屋时的奠基仪式——它定义了对象诞生时的初始状态,下面我们就来深入了解下_... 目录一、__init__的基因图谱二、初始化过程的魔法时刻继承链中的初始化顺序self参数的奥秘默认

SpringBoot使用GZIP压缩反回数据问题

《SpringBoot使用GZIP压缩反回数据问题》:本文主要介绍SpringBoot使用GZIP压缩反回数据问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录SpringBoot使用GZIP压缩反回数据1、初识gzip2、gzip是什么,可以干什么?3、Spr