# ardupilot_gazebo仿真

ardupilot_gazebo仿真

标签(空格分隔): 未分类



ardupilot_gazebo仿真 官网网址

代码更新地址

Ardupilot Gazebo Plugin & Models

Requirements :

Native Ubuntu Xenial(16.04 LTS) able to run full 3D graphics.

Note : Virtual Machine such as VMWare Player does not support full 3D graphics.

but, possible solution is here

Type follow in the terminal,

echo "export SVGA_VGPU10=0" >> ~/.bashrc
source ~/.bashrc

solution retreived from here http://answers.gazebosim.org/question/13214/virtual-machine-not-launching-gazebo/

ArduPilot setup for SITL launch

Gazebo version 7.x or 8.x

The gazebo9 branch will works on gazebo >= 9.x

Disclamer :

This is a playground until I get some time to push the correct patch to gazebo master (I got hard time to work with mercurial..)!

So you can expect things to not be up-to-date.

This assume that your are using Ubuntu 16.04

Usage :

I assume you already have Gazebo 7+ installed with ROS (or without).

If you don‘t have it yet, install ROS with sudo apt install ros-kinetic-desktop-full

(follow instruction here http://wiki.ros.org/kinetic/Installation/Ubuntu).

Or install directly gazebo8 from http://gazebosim.org/tutorials?tut=install_ubuntu

libgazebo7-dev or libgazebo8-dev must be installed.

For Gazebo 7

sudo apt-get install libgazebo7-dev

OR

For Gazebo 8

sudo apt-get install libgazebo8-dev
git clone https://github.com/SwiftGust/ardupilot_gazebo
cd ardupilot_gazebo
mkdir build
cd build
cmake ..
make -j4
sudo make install

Set Path of Gazebo Models / Worlds...

Open up .bashrc

sudo gedit ~/.bashrc

Copy & Paste Followings at the end of .bashrc file

source /usr/share/gazebo/setup.sh
export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models:${GAZEBO_MODEL_PATH}
export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models_gazebo:${GAZEBO_MODEL_PATH}
export GAZEBO_RESOURCE_PATH=~/ardupilot_gazebo/worlds:${GAZEBO_RESOURCE_PATH}

Install is done !!

Now launch a world file with a copter/rover/plane and ardupilot plugin, and it should work!

(I will try to add some world file and model later)

HELP

How to Launch :

Launch Ardupilot Software In the Loop Simulation for each vehicle.

On new terminal, Launch Gazebo with basic demo world.

ROVER

On 1st Terminal(Launch Ardupilot SITL)
sim_vehicle.py -v APMrover2 -f gazebo-rover  -m --mav10 --map --console -I1

On 2nd Termianal(Launch Gazebo with Rover, Retrieved from Husky Model)
gazebo --verbose rover_ardupilot.world

COPTER (3DR IRIS)

On 1st Terminal(Launch Ardupilot SITL)
sim_vehicle.py -v ArduCopter -f gazebo-iris  -m --mav10 --map --console -I0

On 2nd Terminal(Launch Gazebo with demo 3DR Iris model)
gazebo --verbose iris_ardupilot.world

PLANE

On 1st Terminal(Launch Ardupilot SITL)
sim_vehicle.py -v ArduPlane -f gazebo-zephyr  -m --mav10 --map --console -I0

On 2nd Terminal(Launch Gazebo with demo Zephyr flying wing model)
gazebo --verbose zephyr_ardupilot_demo.world

In addition, you can use any GCS that can connect to the Ardupilot locally or remotely(will require connection setup).

If MAVProxy Developer GCS is uncomfortable. Omit --map --console arguments out of SITL launch.

And use APMPlanner2 or QGroundControl instead.

(Possibly MissionPlanner but require Windows PC)

Local connection with APMPlanner2/QGroundControl is automatic, and easier to use.

For APMPlanner2

Download it from here http://firmware.eu.ardupilot.org/Tools/APMPlanner/

and launch it in terminal or run executable

apmplanner2

For QGroundControl

Download it from here and follow the installation guide.

https://donlakeflyer.gitbooks.io/qgroundcontrol-user-guide/en/download_and_install.html

Multi-Vehicle simulation

This section explains how to connect any combination of multi-vehicles of ArduPilot

For the multi-vehicle connection, port number is increased by 10

In SITL launch argument (sim_vehicle.py)

-I 0 has FDM in/out ports of 9002/9003 / GCS connection UDP:14550

-I 1 has FDM in/out ports of 9012/9013 / GCS connection UDP:14560

-I 2 has FDM in/out ports of 9022/9023 / GCS connection UDP:14570

and so on...

You will need to edit your world for any combination of Rover, Plane, Copter, etc...

Additional Note for GCS Connection

You will also need to edit ArduPilot Parameter SYSID_THISMAV to be unique from one another for the GCS connection

Example

Look simulation of 3 IRIS quadcopter at once from Jonathan Lopes Florêncio

https://www.youtube.com/watch?v=3c7EhVMaqKY&feature=youtu.be

Troubleshooting

Missing libArduPilotPlugin.so... etc

In case you see this message when you launch gazebo with demo worlds, check you have no error after sudo make install.

If no error use "ls" on the install path given to see if the plugin is really here.

If this is correct, check with "cat /usr/share/gazebo/setup.sh" the variable GAZEBO_PLUGIN_PATH. It should be the same as the install path. If not use "cp" to copy the lib to right path.

For Example

sudo cp -a /usr/lib/x86_64-linux-gnu/gazebo-7.0/plugins/ /usr/lib/x86_64-linux-gnu/gazebo-7/

path mismatch is confirmed as ROS‘s glitch. It‘ll be fixed.

原文地址:https://www.cnblogs.com/spa147/p/10088003.html

时间: 2024-10-14 20:24:17

# ardupilot_gazebo仿真的相关文章

ardupilot_gazebo仿真(二)

ardupilot_gazebo仿真(二) 标签(空格分隔): 未分类 在模型中添加sensor gezebo官网-sensor部分教程 gezebo官网-基础部分教程 以camera为例 <sensor name="camera" type="camera"> <pose>0 0 0 0 -1.57 0</pose> <camera> <horizontal_fov>2.0</horizontal_

物理仿真

1.捕捉 @interfaceViewController () //声明仿真器属性  保命啊 @property(nonatomic,strong)UIDynamicAnimator *animator; @property (weak, nonatomic) IBOutlet UIImageView *imageView; @end @implementation ViewController //物理仿真器懒加载 -(UIDynamicAnimator *)animator{    if

什么是 开发环境、测试环境、生产环境、UAT环境、仿真环境

开发环境:开发环境是程序猿们专门用于开发的服务器,配置可以比较随意, 为了开发调试方便,一般打开全部错误报告. 测试环境:一般是克隆一份生产环境的配置,一个程序在测试环境工作不正常,那么肯定不能把它发布到生产机上. 生产环境:是指正式提供对外服务的,一般会关掉错误报告,打开错误日志.可以理解为包含所有的功能的环境,任何项目所使用的环境都以这个为基础,然后根据客户的个性化需求来做调整或者修改. 三个环境也可以说是系统开发的三个阶段:开发->测试->上线,其中生产环境也就是通常说的真实环境. UA

CCSDS标准的LDPC编译码仿真

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,ca

工业锻造过程仿真分析软件 Simufact.Forming v13.3.1

MSC.SIMUFACT.FORMING.V13.3-MAGNiTUDE\ Simufact.Forming v13.3.1 1DVD Simufact 是一套工业锻造过程仿真分析软件,由功能极强的有限体积求解器和WINDOWS风格的图形接口的所集成友好仿真分析运用软件.利用Simufact的锻造模拟技术,能够作出更快.更经济的仿真试验,加快产品导入市场的时间. 锻造是高度非线性工艺过程,需要材料和模具与工件之间复杂的相互作用.在多数情形下,锻造的毛坯形状相当简单,但最终产品的几何形状非常复杂,

基于HTML5的燃气3D培训仿真系统

最近上线了的基于HTML5的燃气3D培训仿真系统,以前的老系统是采用基于C++和OpenGL的OpenSceneGraph引擎设计的,OSG引擎性能和渲染效果各方面还是不错的,但因为这次新产品需求要求能运行多移动终端,多年前基于MFC封装OSG的老系统架构也实在该退休了,这年头找能维护MFC这种古董级GUI的靠谱人也非易事. 系统最终采用HT for Web的3D框架实现,项目中的程序员也很高兴有这样的机会终于摆脱维护MFC老系统的宿命,虽然大家都只有C++的开发经验,对HTML/CSS/JS并

非均匀阵线阵前后向平滑仿真

1.天线阵形 应用在一维阵列的空间平滑算法,要求在天线阵所在的一维空间内,存在两个以上完全相同的子阵,子阵的数量决定阵列能够解决的相参(干)信号源的数目,阵列共能对子阵阵元数-1个信号进行测向. 相对于均匀阵列,非均匀阵具有较大的测向范围,较优的最大基线,且能够降低阵元间隔大于信号最小半波长所引起的谱峰模糊,因此本方案拟采取非均匀线阵作为目标子阵,并对三种低阵元数,包含两个对称子阵的阵列进行了仿真分析. 按空间平滑算法的排布要求,非均匀阵列仅可共用一个阵元,同时两子阵的距离远远大于信号的半波长,

Chipscope 仿真VmodCAM IIC程序

Chipscope 仿真VmodCAM IIC程序: 目的:熟悉EDK中建立chipscope 注意:zedboard使用digilent USB下载时,chipscope不能和SDK同一时候使用.否则芯片会死机. 要用仿真器烧敲代码. 1:搭建硬件平台 硬件平台例如以下所看到的:详细的EDK设计流程參见XILINX大学workshop http://china.xilinx.com/support/university/professors.html 搭建后的平台见下图,当中除了IIC和axi

第十一周plecs仿真

1.比例控制仿真 比例系数为2,仿真结果如下图,速度由123rad/s变为121rad/s 2.比例积分控制仿真 调节参数 仿真结果,可以看出转速无静差