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.

在执行2nd之前需要在终端中source

source /usr/share/gazebo/setup.sh

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.

如果只用源码进行仿真,可能会出现旋翼飞行不稳定的情况。需要对参数进行调节,而这里貌似不能用AUTOTUNE自动调参的功能进行调整参数。用AUTOTUNE出现问题的原因可能是模型内部的限幅导致,飞机无法响应对应的PID参数,所以我们直接对飞行pid参数进行修改。

PSC_ Parameters

ATC_ Parameters

根据飞行状态对这两个参数修改

ATC_RAT_RLL_D 0.001000

ATC_RAT_RLL_P 0.155000

飞行稳定 可以进行后续仿真。

参数设置和查询

param show ATC_*
param set ATC_RAT_RLL_P 0.155
ATC_ACCEL_R_MAX  110000.000000
ATC_ACCEL_Y_MAX 27000.000000
ATC_ANGLE_BOOST 1.000000
ATC_ANG_LIM_TC 1.000000
ATC_ANG_PIT_P 4.500000
ATC_ANG_RLL_P 4.500000
ATC_ANG_YAW_P 4.500000
ATC_INPUT_TC 0.150000
ATC_RATE_FF_ENAB 1.000000
ATC_RATE_P_MAX 0.000000
ATC_RATE_R_MAX 0.000000
ATC_RATE_Y_MAX 0.000000
ATC_RAT_PIT_D 0.003600
ATC_RAT_PIT_FF 0.000000
ATC_RAT_PIT_FILT 20.000000
ATC_RAT_PIT_I 0.090000
ATC_RAT_PIT_IMAX 0.500000
ATC_RAT_PIT_P 0.150000
ATC_RAT_RLL_D 0.001000
ATC_RAT_RLL_FF 0.000000
ATC_RAT_RLL_FILT 20.000000
ATC_RAT_RLL_I 0.090000
ATC_RAT_RLL_IMAX 0.500000
ATC_RAT_RLL_P 0.155000
ATC_RAT_YAW_D 0.000000
ATC_RAT_YAW_FF 0.000000
ATC_RAT_YAW_FILT 2.500000
ATC_RAT_YAW_I 0.018000
ATC_RAT_YAW_IMAX 0.500000
ATC_RAT_YAW_P 0.180000
ATC_SLEW_YAW 6000.000000
ATC_THR_MIX_MAN 0.500000
ATC_THR_MIX_MAX 0.500000
ATC_THR_MIX_MIN 0.100000

ardupilot_gazebo仿真(一)的更多相关文章

  1. ardupilot_gazebo仿真(四)

    ardupilot_gazebo仿真(四) 标签(空格分隔): 未分类 Multi-MAV simulation 参考官网给出的multi-vehicle-simulation的方法 在每次打开sim ...

  2. ardupilot_gazebo仿真(三)

    ardupilot_gazebo仿真(三) 标签(空格分隔): 未分类 创建ROS node 实现对无人机的控制(软件在环) MAVROS MAVROS是ROS中的一个能够连接支持MAVLink地面站 ...

  3. ardupilot_gazebo仿真(二)

    ardupilot_gazebo仿真(二) 标签(空格分隔): 未分类 在模型中添加sensor gezebo官网-sensor部分教程 gezebo官网-基础部分教程 Gazebo plugins ...

  4. 基于modelsim-SE的专业进阶仿真流程

    基于modelsim-SE的专业进阶仿真流程 通过<基于modelsim-SE的简单仿真流程>和<调用altera IP核的仿真流程>是否感受到仿真流程中的繁琐步骤,特别是在m ...

  5. 调用altera IP核的仿真流程—下

    调用altera IP核的仿真流程—下 编译 在 WorkSpace 窗口的 counter_tst.v上点击右键,如果选择Compile selected 则编译选中的文件,Compile All是 ...

  6. 调用altera IP核的仿真流程—上

    调用altera IP核的仿真流程—上 在学习本节内容之后,请详细阅读<基于modelsim-SE的简单仿真流程>,因为本节是基于<基于modelsim-SE的简单仿真流程>的 ...

  7. 基于modelsim-SE的简单仿真流程—下

    基于modelsim-SE的简单仿真流程—下 编译 在 WorkSpace 窗口的 counter_tst.v上点击右键,如果选择Compile selected 则编译选中的文件,Compile A ...

  8. 基于modelsim-SE的简单仿真流程—上

    基于modelsim-SE的简单仿真流程 编写RTL功能代码 要进行功能仿真,首先得用需要仿真的模块,也就是RTL功能代码,简称待测试的模块,该模块也就是在设计下载到FPGA的电路.一个电路模块想要有 ...

  9. 室内定位系列(二)——仿真获取RSS数据

    很多情况下大家都采用实际测量的数据进行定位算法的性能分析和验证,但是实际测量的工作量太大.数据不全面.灵活性较小,采用仿真的方法获取RSS数据是另一种可供选择的方式.本文介绍射线跟踪技术的基本原理,以 ...

随机推荐

  1. js函数在frame中的相互的调用

    框架编程概述一个HTML页面可以有一个或多个子框架,这些子框架以<iframe>来标记,用来显示一个独立的HTML页面.这里所讲的框架编程包括框架的自我控制以及框架之间的互相访问,例如从一 ...

  2. IP地址获取当前地理位置(省份)的接口

    腾讯的接口是 ,返回数组 http://fw.qq.com/ipaddress 返回值 var IPData = new Array("61.135.152.194"," ...

  3. 简析--Java中常见的一些关键字的解析

    在Java开发中我们经常会用到一些关键字,关键字的定义很有意思"Java事先定义好的,具有特殊含义的单词",那么我们怎么来用好关键字呢?下面我们对一些常见的关键字进行分析和比较; ...

  4. C#中rpt的数据类型和Oracle中数据类型的匹配

    Oracle中number数据类型对应C#中decimal数据类型,结果是整数 Oracle中number数据类型对应C#中int32数据类型,结果是小数,保留两位小数 Oracle中中date类型数 ...

  5. 还在占用存储的进程lsof grep deleted;

    查看僵尸进程 lsof grep deleted; 用于查看已经停止但还在占用存储的进程

  6. mysql 中的存储过程

    创建一个简单的存储过程 存储过程proc_adder功能很简单,两个整型输入参数a和b,一个整型输出参数sum,功能就是计算输入参数a和b的结果,赋值给输出参数sum: 几点说明: DELIMITER ...

  7. Keepalived搭建主从架构、主主架构实例

    实例拓扑图: DR1和DR2部署Keepalived和lvs作主从架构或主主架构,RS1和RS2部署nginx搭建web站点. 注意:各节点的时间需要同步(ntpdate ntp1.aliyun.co ...

  8. java常见面试问题.你一定会预见到。

    1判断一个char字符是不是数字:Character.isDigit(char).是数字返回true,反之返回false. 2字符串的toCharArray() 把字符串转换为字符数组.返回char[ ...

  9. python网络编程,通过服务名称和会话类型(tcp,udp)获取端口号,简单的异常处理

    作为一个php程序员,同时有对网络方面感兴趣,php就比较蛋疼了,所以就抽了些时间看python 之前学python基础因为工作原因,断断续续的看了个基础,差不多是可以写代码了 最近在看<pyt ...

  10. ELK 分布式日志实战

    一.  ELK 分布式日志实战介绍 此实战方案以 Elk 5.5.2 版本为准,分布式日志将以下图分布进行安装部署以及配置. 当Elk需监控应用日志时,需在应用部署所在的服务器中,安装Filebeat ...