硬件在环仿真可以接遥控器进行调试。
串口设置
下载minicom
sudo apt-get install minicom
配置飞控的设备号(/dev/ttyACM0)以及波特率(921600 8N1)
sudo minicom -s
Serial port setup -> Save setup as dfl -> Exit
配置完以后
save as dfl
然后exit
编译jmavsim
cd src/Firmware/Tools/jMAVSim
# Build and run:
ant
硬件在环仿真 (HITL)
根据PX4官网教程
Here is an example for quadrotor X.
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(推荐使用)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
The console will display mavlink text messages from the autopilot
To connect QGroundControl to this system: Select the default UDP link from the “connect” button in the top right corner and connect it.
Ready to fly!
飞控连上Linux后先启动仿真GUI,再打开地面站。
By Fantasy