1.启动仿真:
cd到Firmware文件夹,执行以下代码
roslaunch px4 mavros_posix_sitl.launch
如果启动过程卡住或者很慢,下载该链接的压缩包https://bitbucket.org/osrf/gazebo_models/downloads/
解压到.gazebo/models文件夹下,该文件夹为隐藏文件夹,按ctrl+h使其显示。如果没有models文件夹,则自己新建一个
启动后输入
commander takeoff
测试其是否正常起飞
2.添加单目摄像头
在{path_to_firmware}/launch文件夹中找到mavros_posix_sitl.launch
文件,打开
<?xml version="1.0"?>
<launch>
<!-- MAVROS posix SITL environment launch script -->
<!-- launches MAVROS, PX4 SITL, Gazebo environment, and spawns vehicle -->
<!-- vehicle pose -->
<arg name="x" default="0"/>
<arg name="y" default="0"/>
<arg name="z" defaul