PX4 Software-In-The-Loop(SITL) Simulation on Gazebo
2017-10-26 15:22
309 查看
原文链接:
[PX4 Software-In-The-Loop(SITL) Simulation on Gazebo](https://404warehouse.net/2016/07/11/px4-software-in-the-loopsitl-simulation-on-gazebo/)
Home
About
Articles
Projects
Drone Labs
Interactive Music
Slides
Contact Us
Jaeyoung Lim
The first is sometimes called MITL(Model-In-The-Loop) which only includes a mathematical model of the controller. The next is to verify the controller in a SITl(Software-In-The-Loop). Software in the loop simulations verify the actual software integration of the controller to see if there is any unforeseen problems within the system. The third process is the PITL(Processor-In-The-Loop) which verifies there are no problems within the processor calculations. The last procedure is to have a HITL(Hardware-In-The-Loop) which includes the major hardware components in the control system to verify the controller is working properly.
Rererence: https://github.com/PX4/Firmware/tree/master/posix-configs/SITL
The PX4 SITL can be interfaced using MAVLink (Similar to the real flight controller) through a UDP port.
Clone the PX4 source.
When the SITL is running properly, the log screen will appear as below.
– to connect to a specific IP: “udp://:14540@192.168.1.36:14557”
– to connect to a local host: “udp://:14540@127.0.0.1:14557”
If qgroundcontrol is installed properly, it will automatically connect to the UDP port while the simulation is running.
roslaunch mavros px4.launch fcu_url:=”udp://:14540@127.0.0.1:14557″
It is good to have arguments on fcu_url in the launch file to be able to change between SITL and the real board to speed up the process.
div.wpmrec2x div.u > div{float:left;margin-right:10px;}
div.wpmrec2x div.u > div:nth-child(3n){margin-right:0px;}
Advertisements
(function(g,$){if("undefined"!=typeof g.__ATA){
g.__ATA.initAd({collapseEmpty:'after', sectionId:26942, width:300, height:250});
g.__ATA.initAd({collapseEmpty:'after', sectionId:114160, width:300, height:250});
}})(window,jQuery);
var o = document.getElementById('crt-31909565');
if ("undefined"!=typeof Criteo) {
var p = o.parentNode;
p.style.setProperty('display', 'inline-block', 'important');
o.style.setProperty('display', 'block', 'important');
Criteo.DisplayAcceptableAdIfAdblocked({zoneid:388248,containerid:"crt-31909565",collapseContainerIfNotAdblocked:true,"callifnotadblocked": function () {var o = document.getElementById('crt-31909565'); o.style.setProperty('display','none','important');o.style.setProperty('visbility','hidden','important'); } });
} else {
o.style.setProperty('display', 'none', 'important');
o.style.setProperty('visibility', 'hidden', 'important');
}
var o = document.getElementById('crt-1719407369');
if ("undefined"!=typeof Criteo) {
var p = o.parentNode;
p.style.setProperty('display', 'inline-block', 'important');
o.style.setProperty('display', 'block', 'important');
Criteo.DisplayAcceptableAdIfAdblocked({zoneid:837497,containerid:"crt-1719407369",collapseContainerIfNotAdblocked:true,"callifnotadblocked": function () {var o = document.getElementById('crt-1719407369'); o.style.setProperty('display','none','important');o.style.setProperty('visbility','hidden','important'); } });
} else {
o.style.setProperty('display', 'none', 'important');
o.style.setProperty('visibility', 'hidden', 'important');
}
Facebook4
Google
July 11, 2016 in Articles.
[PX4 Software-In-The-Loop(SITL) Simulation on Gazebo](https://404warehouse.net/2016/07/11/px4-software-in-the-loopsitl-simulation-on-gazebo/)
404warehouse
Small Projects Big Ideas in Robotics, New Media and other Projects
Menu
Skip to contentHome
About
Articles
Projects
Drone Labs
Interactive Music
Slides
Contact Us
PX4 Software-In-The-Loop(SITL) Simulation on Gazebo
Jaeyoung Lim / July 11, 2016Jaeyoung Lim
Introduction
PX4 is a great platform to implement a UAV system based on a opensource autopilot. One of the great features of PX4 is that you can run a SITL simulation(Software in the loop simulation) to simulate your flight on simulation. This is useful as you can check new mission or control algorithms before actually flying the quadrotor and possibly damaging it. This article shows will show you how to run a SITL for PX4 and how to interact with it through gazebo and qgroundcontrol. The article has mainly the same contents as the tutorial but is reorganized and more specific for the purpose of offboard control.A brief introduction to Software in the loop simulation
Software in the Loop is a simulation of a system which is modeled and run under software without any hardware. To develop a control software, usually the system will have to pass three simulation verification before the software is implemented into a real system.The first is sometimes called MITL(Model-In-The-Loop) which only includes a mathematical model of the controller. The next is to verify the controller in a SITl(Software-In-The-Loop). Software in the loop simulations verify the actual software integration of the controller to see if there is any unforeseen problems within the system. The third process is the PITL(Processor-In-The-Loop) which verifies there are no problems within the processor calculations. The last procedure is to have a HITL(Hardware-In-The-Loop) which includes the major hardware components in the control system to verify the controller is working properly.
PX4 SITL
PX4 is a flight control platform and can be run on SITL mode. The diagram shows a simple example of a px4 in SITL mode.Rererence: https://github.com/PX4/Firmware/tree/master/posix-configs/SITL
The PX4 SITL can be interfaced using MAVLink (Similar to the real flight controller) through a UDP port.
Running the simulation
Installation
ROS
The current article is implemented based on ROS indigo. Other versions of ROS that has been after ROS indigo should work, but have not been verified. For installation instructions of ROS, try this tutorial.Gazebo
Gazebo6 should be used for the PX4 gazebo plugin. You can check which specific version to use with ROS here.PX4
PX4 and jMAVSim should be installed and compliled to run PX4 in SITL mode.Clone the PX4 source.
mkdir -p ~/src cd ~/src git clone https://github.com/PX4/Firmware.git cd Firmware git submodule update --init --recursive cd ..
Running the simulation
Different airframes can be selected to run the simulation. Supported airframes include Multirotors(with/without optical flow sensors), Planes, VTOL(tail sitters, quadplanes).Quadrotor
The default quadrotor model is IRIS from 3DRobotics.cd ~/src/Firmware make posix_sitl_default gazebo
Quadrotor with Optical Flow
cd ~/src/Firmware make posix gazebo_iris_opt_flow
Typhoon H 480
cd ~/src/Firmware make posix gazebo_typhoon_h480
Standard VTOL
cd ~/src/Firmware make posix_sitl_default gazebo_standard_vtol
Tailsitter VTOL
cd ~/src/Firmware make posix_sitl_default gazebo_tailsitter
When the SITL is running properly, the log screen will appear as below.
Interfacing SITL with qgroundcontrol
The default UDP address for the mavlink is as follows– to connect to a specific IP: “udp://:14540@192.168.1.36:14557”
– to connect to a local host: “udp://:14540@127.0.0.1:14557”
If qgroundcontrol is installed properly, it will automatically connect to the UDP port while the simulation is running.
Mission with Quadrotor
Mission with Standard VTOL
You can also change parameter files and do automatic missions just as if you are interacting with the real flight controller.Interfacing SITL with ROS
The biggest advantage of interfacing to SITL through ROS has the same interface with interfacing with a real flight controller. You only need to change the fcl_url on MAVROS.roslaunch mavros px4.launch fcu_url:=”udp://:14540@127.0.0.1:14557″
It is good to have arguments on fcu_url in the launch file to be able to change between SITL and the real board to speed up the process.
Examples
Sending position setpoints
Trajectory control using position setpoints
div.wpmrec2x{max-width:610px;}div.wpmrec2x div.u > div{float:left;margin-right:10px;}
div.wpmrec2x div.u > div:nth-child(3n){margin-right:0px;}
Advertisements
(function(g,$){if("undefined"!=typeof g.__ATA){
g.__ATA.initAd({collapseEmpty:'after', sectionId:26942, width:300, height:250});
g.__ATA.initAd({collapseEmpty:'after', sectionId:114160, width:300, height:250});
}})(window,jQuery);
var o = document.getElementById('crt-31909565');
if ("undefined"!=typeof Criteo) {
var p = o.parentNode;
p.style.setProperty('display', 'inline-block', 'important');
o.style.setProperty('display', 'block', 'important');
Criteo.DisplayAcceptableAdIfAdblocked({zoneid:388248,containerid:"crt-31909565",collapseContainerIfNotAdblocked:true,"callifnotadblocked": function () {var o = document.getElementById('crt-31909565'); o.style.setProperty('display','none','important');o.style.setProperty('visbility','hidden','important'); } });
} else {
o.style.setProperty('display', 'none', 'important');
o.style.setProperty('visibility', 'hidden', 'important');
}
var o = document.getElementById('crt-1719407369');
if ("undefined"!=typeof Criteo) {
var p = o.parentNode;
p.style.setProperty('display', 'inline-block', 'important');
o.style.setProperty('display', 'block', 'important');
Criteo.DisplayAcceptableAdIfAdblocked({zoneid:837497,containerid:"crt-1719407369",collapseContainerIfNotAdblocked:true,"callifnotadblocked": function () {var o = document.getElementById('crt-1719407369'); o.style.setProperty('display','none','important');o.style.setProperty('visbility','hidden','important'); } });
} else {
o.style.setProperty('display', 'none', 'important');
o.style.setProperty('visibility', 'hidden', 'important');
}
Share this:
TwitterFacebook4
Like this:
Like Loading…July 11, 2016 in Articles.
相关文章推荐
- 话说apm的sitl(simulation in the loop)开发环境的搭建
- 在Linux下设置SITL(Software In The Loop)
- On The Value Of Fundamentals In Software Development (基础知识在软件开发中的价值)
- Hardware-in-the-loop Simulation for CPU-GPU Heterogeneous Platforms
- Spending the Whole Day in Installing Software on My PC
- Spending the Whole Day in Installing Software on My PC
- The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
- date(): It is not safe to rely on the system's timezone settings in CodeIgniter
- Why is the "DEBUG: Error 2836" message generated in the DB2 V8, V9.1, or V9.5 installation log file on Windows system?
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- The Full Story on Developing for Media Center in Windows Vista
- the virtual machine is in use by an application on your host computer
- mysql 5.7 Warning: Using a password on the command line interface can be insecure. 解决方案
- in/on the morning
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Changing the default skins on a Button control in Flex
- How to set the DefaultButton in a Page Based on ASP.NET Master Page
- 部署程序问题, The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java
- 13 Free GIS Software Options: Map the World in Open Source
- Trigger a button click with JavaScript on the Enter key in a text box