.. _tutorial_sitl_zh:
虚拟仿真空间
=============================================
虚拟仿真环境作为一个独立的专有软件包提供给我们的客户,用于帮助用户在实际测试之前验证自身的代码,并通过在仿真引擎中添加新的场景来探索新的飞行驾驶功能。
.. hint::
此软件包需额外付费,请咨询我们的销售人员了解如何购买。
环境要求
-------------------------------------------
由于环境依赖关系,虚拟仿真只能运行在装有 Ubuntu 18.04 的 Intel-64位电脑上,不支持机载计算机。最低硬件要求为:Intel i7 处理器和 4GB RAM 内存,复杂环境建议选用更高的硬件配置。
所需软件环境为装有 ROS melodic 和 Gazebo 9 引擎的 Ubuntu 18.04。我们已经预装全部软件组件,因此用户可以轻松启动软件包。
.. image:: ../img/tutorials/flyingrover_scorpion_sitl.png
:height: 400 px
:width: 750 px
:scale: 60 %
:align: center
.. raw:: html
(a) Simulation for Scorpion model
.. image:: ../img/tutorials/snap_falcon_sitl.png
:height: 400 px
:width: 750 px
:scale: 60 %
:align: center
.. raw:: html
(a) Simulation for Falcon model
如何使用
------------------------------
#. px4 参数自动配置:
用户可以使用以下命令清理默认参数:
::
bash clean.sh
#. 我们支持以下几种模拟案例。
- 案例 1:使用 GPS 导航的空旷环境
::
# launch simulation for kerloud flying rover scorpion
bash sitl_run.sh $PWD/bin/px4 none gazebo kerloud_fr_scorpion
# launch simulation for kerloud flying rover falcon
bash sitl_run.sh $PWD/bin/px4 none gazebo kerloud_fr_falcon
然后用户可以在 QGroundcontrol 软件中操作飞车。
.. raw:: html
- 案例 2:使用 GPS 导航进行 Offboard 控制
::
source setup_flyingrover.bash
# launch for scorpion model
roslaunch launch/mavros_posix_sitl_kerloud_scorpion.launch
# launch for falcon model
roslaunch launch/mavros_posix_sitl_kerloud_falcon.launch
该操作将使用位于catkinws_offboard工作区中的自定义mavros节点进行SITL仿真。
.. raw:: html
.. hint::
虚拟仿真软件原生支持前文所述的offboard控制教程