Setting up SITL on Linux

36 篇文章 1 订阅
2 篇文章 0 订阅

SITL Simulator (Software in the Loop)

SITL(环路软件)模拟器允许你跑 Plane, Copter or Rover 不用任何硬件。它使用一个普通的c++编译器构建autopilot代码,提供了一个本机可执行文件,允许您在不使用硬件的情况下测试代码的行为。

本文概述了SITL的优点和体系结构:

SITL允许您在PC上直接运行ArduPilot,无需任何特殊硬件。ArduPilot是一款便携式自动驾驶仪,可以在各种平台上运行。您的PC只是ArduPilot可以构建和运行的另一个平台。

在SITL中运行时,传感器数据来自飞行模拟器中的飞行动力学模型。ArduPilot有一个广泛的车辆模拟器内置,并可以接口到几个外部模拟器。这使得ArduPilot可以在非常广泛的车辆类型上进行测试。例如,SITL可以进行模拟。

  • multi-rotor aircraft
  • fixed wing aircraft
  • ground vehicles
  • underwater vehicles
  • camera gimbals
  • antenna trackers
  • a wide variety of optional sensors, such as Lidars and optical flow sensors

Setting up SITL on Linux

Install steps

Cloning with the command line

  • open a terminal and navigate to the directory where you would like the clone to be stored

  • clone your fork:

    git clone https://github.com/your-github-userid/ardupilot
    cd ardupilot
    git submodule update --init --recursive
    

    or the main project repo:

    git clone https://github.com/ArduPilot/ardupilot
    cd ardupilot
    git submodule update --init --recursive
    

Install some required packages

If you are on a debian based system (such as Ubuntu or Mint), we provide a script that will do it for you. From ardupilot directory :

Tools/scripts/install-prereqs-ubuntu.sh -y

Reload the path (log-out and log-in to make permanent):

. ~/.profile

Now you should be able to build with waf as described in BUILD.md.

Add some directories to your search path (Facultative)

Add the following lines to the end of your ”.bashrc” in your home directory (notice the . on the start of that filename. Also, this is a hidden file, so if you’re using a file manager, make sure to turn on “show hidden files”).

export PATH=$PATH:$HOME/ardupilot/Tools/autotest
export PATH=/usr/lib/ccache:$PATH

Then reload your PATH by using the “dot” command in a terminal

. ~/.bashrc

Start SITL simulator

Start SITL simulator

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

 

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Gkbytes

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值