Pixhawk原生固件PX4之HIL硬件在环仿真

欢迎交流~ 个人 Gitter 交流平台,点击直达:


硬件在环仿真可以接遥控器进行调试。

串口设置

下载minicom

sudo apt-get install minicom

配置飞控的设备号(/dev/ttyACM0)以及波特率(921600 8N1)

sudo minicom -s

Pixhawk原生固件PX4之HIL硬件在环仿真_第1张图片

Serial port setup -> Save setup as dfl -> Exit

Pixhawk原生固件PX4之HIL硬件在环仿真_第2张图片

配置完以后save as dfl然后exit

编译jmavsim

cd src/Firmware/Tools/jMAVSim
# Build and run:
ant

硬件在环仿真 (HITL)

根据PX4官网教程

Here is an example for quadrotor X.

  1. Configure PX4 autopilot for HIL setup using either of these methods:

    a. Using QGroundControl: Connect to board, click Setup, click Airframe, check the box in the Simulation selection (last one in list) and pick the type of HIL setup you want from the drop-down. Apply and Restart, Reconnect

    b. By hand: Set parameter SYS_AUTOSTART = 1001, save parameters and reboot(推荐使用)

  2. Run jMAVSim in HITL mode. Change the serial port to the port of Pixhawk and make sure to have QGroundControl NOT connected to serial.

java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -serial /dev/ttyACM0 921600 -qgc
  1. The console will display mavlink text messages from the autopilot

  2. To connect QGroundControl to this system: Select the default UDP link from the “connect” button in the top right corner and connect it.

  3. Ready to fly!

飞控连上Linux后先启动仿真GUI,再打开地面站。


                                          By Fantasy

你可能感兴趣的:(Pix学习笔记)