ArduPilot-sitl仿真-Mission Planner聯合顯示

ArduPilot-sitl仿真-Mission Planner聯合顯示

To start the simulator first change directory to the vehicle directory. For example, for the multicopter code change to ardupilot/ArduCopter:

cd ardupilot/ArduCopter

Then start the simulator using sim_vehicle.py. The first time you run it you should use the -w option to wipe the virtual EEPROM and load the right default parameters for your vehicle.

sim_vehicle.py -w

After the default parameters are loaded you can start the simulator normally. First kill the sim_vehicle.py you are running using Ctrl-C. Then:

sim_vehicle.py --console --map

如果要採用flightgear 額外需要

Install FlightGear from the terminal:

sudo apt-get install flightgear

Open a new command prompt and run the appropriate shell file for your
vehicle in /ardupilot/Tools/autotest/: fg_plane_view.sh (Plane) and
fg_quad_view.sh (Copter).

This will start FlightGear.

Start SITL in the terminal in the normal way. In this case we’re
specifying the start location as San Francisco airport (KSFO) as this
is an interesting airport with lots to see:

sim_vehicle.py -L KSFO

SITL with MAVProxy (UDP)
SITL can connect to multiple ground stations by using MAVProxy to forward UDP packets to the GCSs network address (for example, forwarding to another Windows box or Android tablet on your local network). The simulated vehicle can then be controlled and viewed through any attached GCS.

First find the IP address of the machine running the GCS. How you get the address is platform dependent (on Windows you can use the ‘ipconfig’ command to find the computer’s address).

Assuming the IP address of the GCS is 192.168.14.82, you would add this address/port as a MAVProxy output using:

output add 192.168.14.82:14550

在電腦中打開Mission Planner , 選擇UDP連接,並設置對應的端口號。如下圖所示。
在這裏插入圖片描述

此時,就可以完成代碼sitl仿真與電腦的通信。

本人採用的是Vmware 虛擬機和主機進行鏈接,在ubuntu 中,
Enter the following commands in the MAVProxy Command Prompt.

mode guided
arm throttle
takeoff 40

Copter should take off to an altitude of 40 metres and then hover (while it waits for the next command).解鎖,起飛後。
可以在地面站中採用mavlink形式讀取日誌信息,也可以通過地面站實時顯示飛行數據。並通過MP中的轉換成matlab文件完成在Matlab中的數據顯示(日誌文件有兩種格式,都表示同樣的信息)。 親測有效!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章