当前位置:网站首页>Px4 simulation basis
Px4 simulation basis
2022-06-25 23:41:00 【Blue sky】
This article describes jmavsim and gazebo The use of two simulators
The simulator can make PX4 The flight control program is in the simulation “ The world ” To control a computer simulated aircraft . You can use QGroundControl Ground station procedures 、API Or the remote control interacts with the aircraft , It's like interacting with a real aircraft .
Software simulation means PX4 The flight control program runs in the host computer , The host computer we use here is one with ubuntu server Of thinkpad Laptop computer ,PX4 The flight control program is installed in the host computer .
Hardware emulation means PX4 The flight control program runs in a real flight control computer , What we use here is an installation PX4 Of flight control procedures pixhawk Flight control computer .
Operating environment Version Description :
Hardware : Hexing company pixhawk 2.1 cube black
Software :QGroundControl Ground station : 2021-02-23 daily version
PX4 The firmware :1.11.3
operating system :ubuntu server 20.0.04.2 LTS
1. jmavsim Emulator
Reference documents :https://docs.px4.io/master/en/simulation/jmavsim.html
1.1 jmavsim Software emulation (SITL)
step :
1.1.1. from px4 Web site to download PX4_Autopilot Source code
1.1.2. Get into PX4-Autopilot Catalog
1.1.3. Carry out orders
make px4_sitl_default jmavsim
px4 Source code and jmavsim plugin The corresponding source code is compiled , Then the interface of aircraft and flight environment appears
1.1.4. stay pxh Command line interface input command :commander takeoff, You can see the plane take off
1.1.5. start-up QGroundcontrol Ground station procedures , With this program, you can observe the flight path , You can also use the virtual remote control to operate the aircraft , You can also plan a flight mission and let the aircraft perform a flight mission .
1.2. jmavsim Hardware simulation (HITL)
step
1. 2.1 start-up QGroundControl Ground station software
1.2.2 stay Vechicle Setup Of safty In function Hardware in the loop Simulation Choose from HITL enabled
1.2.3 stay Vechicle Setup Of Aireframe Select among “HIL QuadCopter X” frame , Click on apply Button .
Be careful : After the flight control is restarted , Prompt appears Parameters are missing from firmware. You may be running a version of firmware which is not fully supported or your firmware has a bug in it. Missing params: 1:BAT_V_CHARGED, 1:BAT_N_CELLS, 1:BAT_V_EMPTY
This prompt means that several parameters of the system are missing , Mainly refers to the battery part , in fact ,uavcan The parameters of are also missing . You need to use missionplanner recovery . This is a pixhawk 2.1 Unique defects .
1.2.4 stay Application Settings Medium General Medium AutoConnect to the following devices, uncheck All checkboxes , leave “udp”.
1.2.5 close QGroundControl
1.2.6 Unplug the flight control usb Line
1.2.7 Plug in the flight control usb Line , Wait for the flight control to start .
1.2.8 Get into PX4-Autopilot Catalog , Run the command
./Tools/jmavsim_run.sh -q -s -d /dev/ttyACM0 -b 921600 -r 250
Simulation GUI The interface starts .
1.2.9 start-up QGroundControl
jmavsim The simulator will work with QGroundControl and px4 Auto connect .
1.2.10. Unlock the plane with the remote control , Push the oil valve to take off .
Be careful : When it is set to HITL after ,QGroundControl Tips , Loss of power parameters ( Three parameters ), It is necessary to verify the sensor and other information . Don't care , To recover these missing parameters , May refer to pixhawk 2.1 The instructions for ( Hexing company ).
2. gazebo Emulator
Reference documents :https://docs.px4.io/master/en/simulation/gazebo.html
gazebo 9, This is a px4 Specified on the official website gazebo edition , Because the current PX4 Only... Is packaged in the firmware source code gazebo 9 Corresponding code of ,gazebo 9 Self installation required .
gazebo9 Installation steps of :
install gazebo9 And development libraries , It's all binary .
First installation gazebo9-common
sudo apt-get install gazebo9-common
then
sudo apt-get install gazebo9
then
sudo apt-get install libgazebo9-dev
2.1 gazebo Software emulation (SITL)
step :
2.1.1 from px4 Web site to download PX4_Autopilot Source code
2.1.2 Get into PX4-Autopilot Catalog
2.1.3 Carry out orders
make px4_sitl gazebo
px4 Source code and corresponding gazebo plugin The source code is compiled , Then the interface of aircraft and flight environment will appear
2.1.4 stay pxh Command line interface input command :commander takeoff
You can see the plane take off
2.1.5 start-up QGroundcontrol Ground station procedures , With this program, you can observe the flight path , You can also use the virtual remote control to operate the aircraft , You can also plan a flight mission and let the aircraft perform a flight mission .
2.1.6 The flight background of the aircraft can be changed
such as :make px4_sitl gazebo_iris__warehouse
Be careful :iris And warehouse Between 2 Underscores , among iris stay gazebo Middle represents four axis aircraft ,warehouse Representative background .
2.2. gazebo Hardware simulation (HITL)
step :
2.2.1 start-up QGroundControl Ground station software
2.2.2 stay Vechicle Setup Of safety In function Hardware in the loop Simulation Choose from HITL enabled
2.2.3 stay Vechicle Setup Of Aireframe Select among “HIL QuadCopter X” frame , Click on apply Button .
Be careful : After the flight control is restarted , Prompt appears Parameters are missing from firmware. You may be running a version of firmware which is not fully supported or your firmware has a bug in it. Missing params: 1:BAT_V_CHARGED, 1:BAT_N_CELLS, 1:BAT_V_EMPTY
This prompt means that several parameters of the system are missing , Mainly refers to the battery part , in fact ,uavcan The parameters of are also missing . After completing the hardware simulation, you need to use missionplanner recovery . This is a uavcan The missing parameter is pixhawk 2.1 Unique defects .
2.2.4 stay Application Settings Medium General Medium AutoConnect to the following devices, uncheck All checkboxes , leave “udp”.
2.2.5 close QGroundControl
2.2.6 Unplug the flight control usb Line
2.2.7 Plug in the flight control usb Line , Wait for the flight control to start .
2.2.8 compile gazebo plugin
Get into PX4-Autopilot Catalog , Carry out orders
DONT_RUN=1 make px4_sitl_default gazebo
2.2.9 Modify according to the official website gazebo plugin Of xml The configuration file
Open the four axis plane sdf file Tools/sitl_gazebo/models/iris_hitl/iris_hitl.sdf. if necessary , take serialDevice Replace with /dev/ttyACM0
2.2.10 Set the environment variable , Carry out orders
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
2.2.11 function gazebo
gazebo Tools/sitl_gazebo/worlds/hitl_iris.world
2.2.12 start-up QGroundControl
gazebo The simulator will work with QGroundControl and px4 Auto connect .
2.2.13 Unlock the plane with the remote control , Push the oil valve to take off .
Be careful : When it is set to HITL after , start-up QGroundControl Post prompt , Loss of power parameters ( Three parameters ), It is necessary to verify the sensor and other information , Don't care . Recover the lost uavcan Parameters can refer to pixhawk 2.1 The instructions for ( Hexing company ).
边栏推荐
- QT custom implemented calendar control
- 谷歌浏览器(Chrome)最新v80版本下载
- CSDN force value
- Rk3568+ Hongmeng industrial control board industrial gateway video gateway solution
- C2. k-LCM (hard version)-Codeforces Round #708 (Div. 2)
- Leetcode (605) -- flower planting
- Share a downloaded osgeo4w64 Library Based on qgis3.10
- How to use drawing comparison function in CAD
- php性能优化
- C. Planar Reflections-CodeCraft-21 and Codeforces Round #711 (Div. 2)
猜你喜欢

Pointer strengthening and improvement

Use of xinchida ble 5.0 Low Power Bluetooth module (at command serial port transparent transmission) rsbrs02abr
![[Axi] interpretation of Axi protocol atomic access](/img/40/c742b861d92dfa2a1b27ae9ccc7a5d.png)
[Axi] interpretation of Axi protocol atomic access

C# IO Stream 流(二)扩展类_封装器

23class introduction

Hibernate core api/ configuration file / L1 cache details

提取系统apk

Uniapp -- the use of document collation and push of unipush

Once beego failed to find bee after passing the go get command Exe's pit

Database - mongodb
随机推荐
[Axi] interpretation of Axi protocol disorder mechanism
音频基础知识以及PCM转WAV
Uni app -- listen for the exit of the return key
OBS-Studio-27.2.4-Full-Installer-x64. Exe Download
php性能优化
实例:用C#.NET手把手教你做微信公众号开发(21)--使用微信支付线上收款:H5方式
关于go协程超时退出控制条件与方式分析
CSDN force value
先序线索二叉树
UE4 学习记录二 给角色添加骨架,皮肤,及运动动画
Hibernate core api/ configuration file / L1 cache details
Informatics Orsay all in one 1353: expression bracket matching | Luogu p1739 expression bracket matching
B. Box Fitting-CodeCraft-21 and Codeforces Round #711 (Div. 2)
YUV444、YUV422、YUV420、YUV420P、YUV420SP、YV12、YU12、NV12、NV21
经典图像分割网络:Unet 支持libtorch部署推理【附代码】
24class static member
character string
qtcreator 格式化代码
Solving typeerror: Unicode objects must be encoded before hashing
C. Yet Another Card Deck-Educational Codeforces Round 107 (Rated for Div. 2)