File Exchange

image thumbnail

AR Drone Simulink Development-Kit V1.1

version 1.13 (307 KB) by

Blockset for the simulation and Wi-Fi control of the Parrot ARDrone 2.0. Simulate, connect, and fly!

4.5625
16 Ratings

90 Downloads

Updated

View License

The development kit consists of blocks and examples for the simulation and real-time Wi-Fi control of the Parrot AR Drone 2.0. 
The simulation blocks are based on models of the vehicle derived via system identification. The Wi-Fi control blocks are capable of sending commands to and reading the states of the drone in real-time.

The examples provide a framework for the control and guidance of the vehicle. These examples enable velocity and position control, waypoint tracking, and mission execution for the AR.Drone in both simulation and Wi-Fi control.

This development kit was produced in the context of the 2013 MathWorks Summer Research Internship project. For more information about the overall project to develop an automated autonomous emergency response system see:

http://www.youtube.com/watch?v=MxrySx1m8VQ

Comments and Ratings (57)

Jawad Shah

I was able to successfully run the code but the ar drone 2.0 will not communicate with MATLAB even though i have established the wifi connection to my laptop. I even tried connecting my drone to other softwares used for controlling from the pc such QGroundcontrol but it is unable to detect the connection. Does anyone have an idea what the problem might be?

Kidus Guye

@Shaima Al Hebsi where you able to integrate the motioncap (vico) with the kit???

Kidus Guye

The file doesn't work on Matlab 2016b. It is working perfectly for me now after I upgraded my matlab to 2017a.

Kidus Guye

Hi, my PC kept restarting whenever I tried to run the simulink model. Can anyone tell me why this happens?

hello. does anyone know how to solve
Error in port widths or dimensions. Output port 1 of 'ARDroneHoverSim/Position estimation Important:This block provides an inaccurate extimation of position based on velocity information. /Position estimation/Velocity from vehicle body frame to inertial NED frame' is a [2x2] matrix.

Kidus Guye

Hi, I am working on how to upload my control system I developed on Simulink to the Quadcopter (Drone). Could you please guide me through on how to interface or connect the Quadcopter with that of Simulink? Is this kit would help me to achieve that? I would appreciate your help. Thanks!!!

chuxin chen

Is it possible that I use only one computer to control 2 drones? or I have 2 computers with 2 drones, but 1 drone will follow another drone's movement.

Dozie

Dozie (view profile)

The drone takes off successfully, but it becomes very unstable after I enable reference commands in Simulink.
Is there a solution for this?

Rúben Mendes

I need to track a moving object with the below camera, how can I acess the camera with this implementation?
The tracking will be based on colours

When trying to operate through wifi control and running the simulink model I get the error:
At least one "Simulink target" support package must be installed
Which simulink target support package should I install?

Luiz Santana

nizar vv

Hi Amine i find the solution for your problem, all you have to do is to :
1) open the ''Velocity from vehicle body frame
to inertial NED frame'' block
2) copy and paste the following code :

function Vel_xy = fcn(Vel_b1,Vel_b2,psi)
%#codegen
T = [cos(psi) -sin(psi) ; sin(psi) cos(psi)] ;
Vel_xy = T*[Vel_b1;Vel_b2];

3) save the file
4) make the change in the simulink environment
i sent you a print screen.

The idea is to divide the signal (vector) into two signal (two scalar)

abadi amine

hello i have this problem

Error in port widths or dimensions. Output port 1 of 'ARDroneHoverSim/Position estimation Important:This block provides an inaccurate extimation of position based on velocity information. /Position estimation/Velocity from vehicle body frame to inertial NED frame' is a [2x2] matrix.

taoge

taoge (view profile)

Yonggun

I have tested recently through 2013b, but it doesn't contain Real-Time library. it should be higher than 2014b i guess..

icaro viana

is it possible run this toolkit in matlab 2013b?

Yonggun

Hello, for the ARDroneWPTracking file, when I build the simulink, it gives me error with

"File I/O error on file 'rtwin.tlc'
Operation that caused an error: open"

What should I do to fix this problem?

zheng wen

KAAN CAN

Hi, when I try to use this kit for wifi control on real time, it gives me rtwintgt built error and then I can not connect to the drone again. Is there anyone else who can tell me why this happenning?

Hi, does the kit works with parrot 1? Or it works only with parrot 2.0?

Sarah Duval

Hi,
I can't run this add : Error using cd
Cannot CD to simulation.
Does somebody have an idea how to solve it ?
Is it because I have MATLAB 2015a ?

Jinang

Jinang (view profile)

The model gets disconnected (unloaded) from the target after random minutes (2/5/8min) by itself even though my laptop is connected to the drone's network.I am not able to run is reliably for long time without it getting disconnected.
any ideas as to why it happens?

melika mehran

I cant video stream. what I do?
plz help me

melika mehran

For OJIJ
Hi
I need this library for windows

Thanks ;)

I am trying to integrate vicon cameras block (Quarc) with the ARDrone kit but I am getting error without being specified. Has anyone tried integrating both? Do you have any suggestion to solve this issue?

Thanks

André

André (view profile)

How can I change the parameters of PID controller?

OJIJ

OJIJ (view profile)

for melika mehran
You can use other Matlab library for the video streaming of ArDone like this
https://github.com/eschnou/ardrone-webflight
There is other library like this
Good Luck

melika mehran

I want line follow simulation with drone with below camera
so I want to get video streaming with below camera.
how can I active below camera?
or how can I do it?
pleas help me

melika mehran

how can I active the below camera?
I want to get video streaming with below camera.
pleas Help me

muhd syahir

Hello, I have tried this and it work successfully thank you.

Currently I am doing project to control multiple ar drone using matlab simulink and this work seems nice to make modification for that purpose. Could you give me some guideline on how to multiple control?

OJIJ

OJIJ (view profile)

Is it possible to Test the Drone in open loop?

How is it possible to modify the blockset to send PWM commands instead,
for a regular m file I use the following
ARc = udp('192.168.1.1', 5556, 'LocalPort', 5556);
fopen(ARc)
PWM = sprintf('AT*PWM=1,0,0,0,0\r')
fprintf(ARc, PWM)
fclose(ARc)
however i couldnt figure out how to modify the blockset

André

André (view profile)

Hi,

Is it possible to add a PID controller and fuzzy in this toolkit?

Thank you

Pascal

Pascal (view profile)

Hi,

I've problems to start, when I use start_here for wifi control and Hover, the function rtwbuild('ARDroneHover')...I've got a configuration windows asking for :
Set the 'Target hardware' parameter to match your target hardware.

But I don't have any target for the AR Drone....

What could be wrong ?

Antonio

Hi,

I try to run the start_here file and I chose the Wi-Fi Control and Hover.

The problem is:

Warning: Block "Packet Output" references board "Standard Device UDP Protocol [15B4H]" wich is not on the installed boards list for this computer.

I don't understand how to connect with SIMULINK my DRONE. I connected the pc's wifi with drone.

James, check the updated version (1.1) that does not require the system identification toolbox to load the drone transfer functions for simulation.

Omair Tariq

One also needs "Embedded Coder" to be able to control the drone using Simulink.

This is missing in the "Required Products" list.

James

James (view profile)

Hi ,

I started by running the "start_here.m" file.

I entered 1 to start a hover simulation. It then opens a Simulink Model.Specifically it opens the "ARDrone Simulation Block" . Once I run this simulation Block, I get the following errors :

Error in port widths or dimensions. Output port 1 of 'ARDroneHoverSim/ARDrone Simulation Block/State-Space1' has 6 elements. This port does not accept the dimensions (or orientation) specified by the output signal.

Error in port widths or dimensions. Invalid dimension has been specified for input port 1 of 'ARDroneHoverSim/ARDrone Simulation Block/State-Space3'.

David,

PLEASE HELP ME!
PLEASE HELP ME!

a

a (view profile)

Help me. How to use this file? I have Matlab2013b version. I connected drone's wifi by computer. And I click run button on matlab. But there are errors. How can I use this file to control AR Drone 2.0?

a

a (view profile)

Help me. How to use this file? I have Matlap2013b version. I connected drone's wifi by computer. And I click run button on matlab. But there are errors. How can I use this file to control AR Drone 2.0?

That packet output block requests data from the drone. Another packet output block is used to send commands every sampling time.

why ? the sammplingtime*10 in the Packet Output

Ryan

Ryan (view profile)

Can someone with a more recent version of Simulink please post the files saved in MDL format. Thank you in advance!

http://www.mathworks.com/help/simulink/ug/saving-a-model.html#btbr7kx-1

Ryan

Ryan (view profile)

Would it be possible to save a copy of the Simulink files in mdl format rather than slx? I need this to run on r2011b.

Jeremy Wurbs

Thanks you guys for this toolkit, very well done.

I was wondering how you guys were able to get the video stream directly into Matlab. Currently I'm using ffmpeg to decode the stream but there is a ~3-5 second latency that is making controlling the drone difficult. Have you guys (or has anyone) been able to get the AR Drone video stream into Matlab with low latency? Any help is greatly appreciated!

help please,i started to hover my drone ( i hit run button ) my problem is, it wont stop and dont want to land. It remain flying on the air. The stop button/icon was unable to be press(its blurred)

Michael

Will this submission work with Matlab R2013a student version if i have all the toolboxes and blocksets required?

Jordan

Jordan (view profile)

For some reason when I follow all of the steps to run the wifi control. The wifiControl/ARDroneWPTracking.xls file loads and then I connect and then run. But the compiler gets stuck at T =0 and then a warning message stating "a disconnect message was sent to the target 10..20...60 seconds ago and then it disconnects. and the model is unloaded. Any help on getting the program to run reliably/continuously. I've gotten it to run only 2 times.

Hi Jose,

Check the following link:

http://www.mathworks.com/matlabcentral/fileexchange/44177-kinect-controlled-travel-in-google-earth-3d

I think you could use information from the kinect to control the drone. You should check if the blocks that talk with the kinect can be executed in external mode together with Real-Time-Windows-Target (RTWT). If this is possible, you can combine the Simulink blocks for the vehicle control and blocks that receive information from the Kinect.

If you are unable to do that, I would suggest you to open a MATLAB/Simulink session that reads the Kinect information and use UDP blocks to exchange data between the Simulink model that reads the kinect data and the Simulink/RTWT model that controls the drone.

Chao

---
David

jose

jose (view profile)

Hi. I was wondering if, for example i could use a Kinect for control this quadrotor using this same program. It's possible??? I excuse for my English, I'm from Ecuador and I barely write in English. Thanks!

daher

daher (view profile)

hi.. i am having a problem with simulation :((( can you assist please!

Error using Stateflow.SLINSF.SubchartMan.clearMaskParams (line 2952)
Attempt to modify library or subsystem

Florian

Paul Kassebaum

Paul Kassebaum (view profile)

This development kit was produced in the context of the 2013 MathWorks Summer Research Internship project. For more information about the overall project to develop an automated autonomous emergency response system see:

http://www.youtube.com/watch?v=MxrySx1m8VQ

Updates

1.13

This version (1.1) removes the need of the System Identification Toolbox to load the drone transfer functions for simulation.

1.12

Updating description 2.

1.10

Updating description.

1.8

Adding logo.

1.6

Modifying description of the blockset

MATLAB Release
MATLAB 8.2 (R2013b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today

ARDroneSimulinkDevKit_V1.1/lib/

ARDroneSimulinkDevKit_V1.1/simulation/

ARDroneSimulinkDevKit_V1.1/

ARDroneSimulinkDevKit_V1.1/wifiControl/

ARDroneSimulinkDevKit_V1.1/lib/

ARDroneSimulinkDevKit_V1.1/simulation/

ARDroneSimulinkDevKit_V1.1/wifiControl/