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

相关文章

SpringBoot中使用Flux实现流式返回的方法小结

《SpringBoot中使用Flux实现流式返回的方法小结》文章介绍流式返回(StreamingResponse)在SpringBoot中通过Flux实现,优势包括提升用户体验、降低内存消耗、支持长连... 目录背景流式返回的核心概念与优势1. 提升用户体验2. 降低内存消耗3. 支持长连接与实时通信在Sp

基于Python开发Windows屏幕控制工具

《基于Python开发Windows屏幕控制工具》在数字化办公时代,屏幕管理已成为提升工作效率和保护眼睛健康的重要环节,本文将分享一个基于Python和PySide6开发的Windows屏幕控制工具,... 目录概述功能亮点界面展示实现步骤详解1. 环境准备2. 亮度控制模块3. 息屏功能实现4. 息屏时间

python使用库爬取m3u8文件的示例

《python使用库爬取m3u8文件的示例》本文主要介绍了python使用库爬取m3u8文件的示例,可以使用requests、m3u8、ffmpeg等库,实现获取、解析、下载视频片段并合并等步骤,具有... 目录一、准备工作二、获取m3u8文件内容三、解析m3u8文件四、下载视频片段五、合并视频片段六、错误

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

SpringBoot3应用中集成和使用Spring Retry的实践记录

《SpringBoot3应用中集成和使用SpringRetry的实践记录》SpringRetry为SpringBoot3提供重试机制,支持注解和编程式两种方式,可配置重试策略与监听器,适用于临时性故... 目录1. 简介2. 环境准备3. 使用方式3.1 注解方式 基础使用自定义重试策略失败恢复机制注意事项

nginx启动命令和默认配置文件的使用

《nginx启动命令和默认配置文件的使用》:本文主要介绍nginx启动命令和默认配置文件的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录常见命令nginx.conf配置文件location匹配规则图片服务器总结常见命令# 默认配置文件启动./nginx

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

使用Python和OpenCV库实现实时颜色识别系统

《使用Python和OpenCV库实现实时颜色识别系统》:本文主要介绍使用Python和OpenCV库实现的实时颜色识别系统,这个系统能够通过摄像头捕捉视频流,并在视频中指定区域内识别主要颜色(红... 目录一、引言二、系统概述三、代码解析1. 导入库2. 颜色识别函数3. 主程序循环四、HSV色彩空间详解

Windows下C++使用SQLitede的操作过程

《Windows下C++使用SQLitede的操作过程》本文介绍了Windows下C++使用SQLite的安装配置、CppSQLite库封装优势、核心功能(如数据库连接、事务管理)、跨平台支持及性能优... 目录Windows下C++使用SQLite1、安装2、代码示例CppSQLite:C++轻松操作SQ

Python常用命令提示符使用方法详解

《Python常用命令提示符使用方法详解》在学习python的过程中,我们需要用到命令提示符(CMD)进行环境的配置,:本文主要介绍Python常用命令提示符使用方法的相关资料,文中通过代码介绍的... 目录一、python环境基础命令【Windows】1、检查Python是否安装2、 查看Python的安