File Exchange

image thumbnail

Simulink Support Package for PARROT Minidrones

Design, simulate and deploy algorithms to fly PARROT Minidrones

47 Downloads

Updated

Editor's Note:

This support package is currently unable to download third-party software for MATLAB R2017a and earlier versions. For details and workaround, see this Bug Report.

MATLAB R2017b and later versions are unaffected.

Simulink® Support Package for PARROT® Minidrones lets you build and deploy flight control algorithms on PARROT minidrones. You can deploy algorithms wirelessly over Bluetooth®. The algorithms can access onboard sensors—such as the ultrasonic, accelerometer, gyroscope, and air pressure sensors—as well as the downward facing camera.
Simulink add-on tools provide additional capabilities. Aerospace Blockset™ includes an example that makes use of PARROT minidrones. The example lets you model 6-DOF equations of motion and simulate aircraft behavior under various flight and environmental conditions. Simulink Coder™ lets you record flight data on the minidrone and access the C code generated from Simulink models.

Supported minidrone models are Rolling Spider and Mambo.

Note for Windows 7/10 users on Bluetooth connectivity:

There is a limitation in the supported Bluetooth adapters that can be used. The user may need an extra Bluetooth adapter even if there is a built-in Bluetooth connection on the host computer. The best adapter available is the CSR 4.0, which supports the PAN GN connection required. For this Bluetooth dongle, the user needs to install the CSR-specific driver and not the Windows driver that would be picked by default.

For more information visit: https://www.mathworks.com/hardware-support/parrot-minidrones.html

Comments and Ratings (58)

@Jeremie Pilon: Please create a technical support case to investigate your question: https://www.mathworks.com/support/contact_us.html

I am wondering if the saturations for the motors are present for safety reasons or if they are the real motor limits? My emails are pilon.jeremie@gmail.com and jeremie.pilon@polymtl.ca . If someone can contact me concerning this issue, it would be great!

Jeremie Pilon

There seems to be an issue with connectivity over bluetooth. After about 20 seconds, the minidrone drops the connection with the host computer and it takes 3 to 4 seconds before the connection is re-established. My emails are pilon.jeremie@gmail.com and jeremie.pilon@polymtl.ca . If someone can contact me concerning this issue, it would be great!

woong-ji choi

Hi Ankur,

my email address is ryanwj7@gmail.com
looking forward to hear from you
thanks

Ankur Bose

Hi woong-ji choi ,
Can you please share your email id through which I can contact you to resolve the issue you are facing?

woong-ji choi

Hi i'm using Mac OS and i've installed the update 6 as mentioned in the comment.
But I'm still not able to install the support package.
Can anyone help me resolving the issue?

Ankur Bose

HI Maxime,
Can you post your email id so that I contact you to resolve the issue you are facing

I had the same error!!!

BASHAR JAMAL

Hello Ankur
I have a MATLAB R2017b and I am trying to install the simulink support package for parrot minidrone however i keep recieving this error:
Failed to install the third-party software:
Bluetooth Utility
This is required by:
Simulink Support Package for PARROT Minidrones
To resolve this issue, see this MATLAB Answer.
I did not fine any solution when following the suggested link
i am using mac osx and here is my email basharj2234@me.com

Ankur Bose

Hi All,
Installation of the support package might fail for MAC OS and Linux platforms in R2018a . Please see this Bug Report for detail:
https://in.mathworks.com/support/bugreports/1743528

Workaround for the issue:
Execute a userpath('reset') command in MATLAB and then try installing again

Hello Ankur here is my email

wilfrid.perruquetti@centralelille.fr
Thanks best regards

Ankur Bose

Hello Wilfrid Perruquetti ,
I will assist you in resolving the issue that you are facing. Can you please share with me with an email id through which I can reach you and help you out ?

Thanks,
Ankur

Hello Ankur,

I updated Matlab to the latest version 2018a and try to install "Simulink Support Package for PARROT Minidrones"
but I got the following error (I did it at least 15 times):
Install Error
Failed to install the third-party software:
Bluetooth Utility
This is required by:
Simulink Support Package for PARROT Minidrones

To resolve this issue, see this MATLAB Answer.
I did not fine any solution when following the suggested link.

I am professor at Ecole Centrale in France and I need this package for my control & robotics course for my students. Thank you for your help. Best regards

Tomo

Tomo (view profile)

Hello Ankur.
According to your instructions
When I updated MATLAB R2017b, I was able to fly manbo as model. Thank you very much.

Ankur Bose

Hi Tomo,
In MATLAB R2017b, in order to use the 'asbQuadcopter' model that supports Parrot Mambo minidrone, you need to update the MATLAB. Please visit this the below link to download the R2017b update and install it.
https://in.mathworks.com/downloads/web_downloads/download_update?release=R2017b&s_tid=ebrg1709643

After you have successfully installed this update, you can see the 'set Mambo Model' option in the project.

Regarding drone forcibly quitting when placed on the floor, ensure that the room where you are flying has sufficient illumination. If the surface is too reflective, it can also cause optical flow issue thus stopping the motors. Try putting the drone over a surface that is not too much reflective for ex- a carpet or a mat.

Tomo

Tomo (view profile)

Sorry for the late reply. MATLAB version '9.3.0.713579 (R2017b)'. Support package version is '17 .2.3'. I am using windows 10.

Hi Everyone,
The R2018a version of MATLAB is live now. You can now use TCP/IP Receive, TCP/IP Send, UDP Receive, and UDP Send Blocks in the Simulink® Support Package for PARROT® Minidrones to communicate between your minidrone (rolling spider or mambo) and host machine.

Sergio Tamayo

Hi Tomo,

Which version of MATLAB/Support Package are you using?

Tomo

Tomo (view profile)

Hello. I started studying Matlab on occasion that Parrot was supported. I am using Manbo, but I am facing a problem. The tutorial 'Parrot Getting Started', 'External Model' and 'asbQuadcopterStart Model' do not work properly. If you let Manbo run it with the ground on the floor, it forcibly ends within 1 second. It seems that the camera at the bottom of Manbo reacts to the floor and is forced to quit.
Please tell me the solution.
Also, after executing 'asbQuadcopterStart' with matlab, 'set manbo model' is not displayed in project shortcut. Is this normal?

Ankur Bose

Hi Jakub Popielarz,
The current MATLAB directory where you are trying to download the flight log, does it have sufficient space on it ?
Also since you are trying the support package version 17.2.3 in R2017b, try to download the flight log using the Flight Control UI after code deployment.
More information on how to deploy code and then use the Flight Control UI can be found in the documentation.

https://in.mathworks.com/help/supportpkg/parrot/ug/use-flightcontrol-ui-on-parrot-minidrone.html

https://in.mathworks.com/help/supportpkg/parrot/run-on-target-hardware-main.html

Ankur

Dear Ankur,
I using 17.2.3 support package, R2017b MATLAB version and WINDOWS 10. I can deploy code from Simulink on the drone, but can not read logs. I have also tried to disable firewall and clear memory cache on drone.

Thank you very much Ankur Bose,
your link helped me solving the issue. Contrary to your mentioned IP adresses, I had to use 192.168.3.1.

Christian

Ankur Bose

Hi Christian Tolks,
The issue most likely you are facing is that the Firewall of your system is blocking the FTP transfer over IP 192.168.3.2. To verify if this is really the case and if yes, then in order to resolve the issue, please look into the below MATLAB answer.

https://in.mathworks.com/matlabcentral/answers/381182-how-do-i-resolve-this-error-regarding-java-and-ftp-connection-when-trying-to-deploy-models-to-my-par

The ftp and mput command as explained in the answer if fails, will confirm that FTP transfer is being blocked by Windows Firewall. In that case add the IP 192.168.2.2 to firewall exception as mentioned in the above answer.

Ankur

Hello,
after successfully installation of support package, bluetooth PAN connection and compilation of the example parrot_gettingstarted.slx, I get following error:
Downloading shared object to PARROT Mambo....
Terminating the currently executing shared object (if any) ....
Connecting to FTP Server 192.168.3.1 ....
Connected to FTP Server at 192.168.3.1 successfully.
### Build procedure for model: 'parrot_gettingstarted' aborted due to an error.

The following error occurred during deployment to your hardware board:
Java exception occurred:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at java.net.SocketInputStream.read(SocketInputStream.java:171) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:161) at java.io.BufferedReader.readLine(BufferedReader.java:324) at java.io.BufferedReader.readLine(BufferedReader.java:389) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:490) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534) at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:476) at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:374) at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1379)

This seems similar to Jakub's problem. I tried all solutions mentioned in the comments below, but without success. A FTP connection to the drone via external ftp client works and it is possible to write data on it. I can also see a file named parrot_gettingstarted.so with size 0kb in the root of the ftp folder structure.

I'm using Matlab 2017b, support package v17.2.3 with a Parrot Mambo under Win7.

Many thanks for inputs.

Ankur Bose

Hi Liling Ren,
On which platform (Windows, MAC OS or Linux) are you trying to install the support package ? You can also share your email-id so that I can contact you to resolve the issue you are facing.

Ankur

Leigh

Leigh (view profile)

Hello,

The installation of the support package always fails because the third party Sourcery G++ Lite is no longer available. What is the workaround for this issue? For what architecture the C++ compiler should be?

Many thanks.

Ankur Bose

Hi Jakub Popielarz,
Can you let us know the version of the support package and the corresponding MATLAB version (R2017a or R2017b) you are using? The FTP error that you are seeing can be caused by multiple reasons such as firewall, memory issues on drone etc.
Can you check if you are able to deploy the code from Simulink on the drone or not?

I would like to ask if anyone have problems with reading flight logs/mat file. I have following error when pop flight log:
Error using codertarget.parrot.internal.parrotminidrone/getFlightLog (line 124)
Java exception occurred:
org.apache.commons.net.io.CopyStreamException: IOException caught while copying.
at org.apache.commons.net.io.Util.copyStream(Util.java:129)
at org.apache.commons.net.ftp.FTPClient.retrieveFile(FTPClient.java:1286)

Everything worked fine for me after reinstalling my BLE driver from my Bluetooth Dongle's CD. I have installed the driver from the zip file given by Mathworks in the setup steps. Hence, I'm able to deploy the generated code from Simulink to the mini-drone.
Otherwise, I observe something wrong with the mini-drone when the battery is under 50% of it's capacity, the mini-drone turns off and I have to put out and then put in the battery to be able to turn it on again, but after a moment, it turns off again and so on. Not sure what is causing this issue, if I get more information about, I'll leave a comment here. The solution is to fully charge the Battery to avoid this problem.

Dear Ankur,
Okay so here will be update on my progress with Package so far.
Throughout testing I am still using Windows 7 and package version 17.2.3.0
Firstly I have tried https://ch.mathworks.com/matlabcentral/answers/377285-hardware-failure-firmware-update-of-parrot-rolling-spider solution.
I know that technically if I am using newest version of the package it should be ok, but I wanted to give it a shot anyways. No success here.
Afterwards I tried https://ch.mathworks.com/matlabcentral/answers/361011-parrot-minidrone-firmware-update-java-error solution.
Matlab ftp command threw no errors, so I went with reason 2 of that solution.
I have followed it through, but when I try mput(f,'SpiderFlight.sh') command I still get an error. Error I get : https://ibb.co/jANbZR .
As suggested I have tried resetting drone to factory settings by holding power button and I have also tried manual removing data from /tmp folder with no success either.
The error I am getting when installing firmware is the same as last time.
So since I cannot get it to work using Windows I have tried Linux. And it worked well, the whole process.
But unfortunately I can't use Matlab with Linux for a prolonged time, because it is very unstable there - it crashes all the time ( but that is a bit unrelated problem).
So with firmware installed I have tested it on Windows again. This time I can't go through Bluetooth capability. I have adapter with Bluetooth Low Energy 4.0 capability. I have installed the drivers from the location given, however I still get message that Bluetooth support could not be detected.
At the same time I managed to connect to the drones Personal Arena Networking as outlined in the Documentation. But as far as I am aware I still need to complete Hardware setup, which I can't due to the fact that Bluetooth support could not be detected.
Sorry for such long post. Thank you in advance for any help. As I said it works perfectly on Linux so if there is nothing that can be done to fix it, I might try doing that and fixing stability issue of Matlab in Linux instead.
When it comes to contact my matlab ID is jakub530 or my email is jj420@cam.ac.uk.

Jeremie Pilon

The issue still happened once in a while. However, bu performing a hard reset (hold power button down for 20-30 seconds) I was finally able to install the firmware correctly on my remaining drones. Thank you for the quick update!

Note to others: you will perhaps need to perform several hard resets before the installation works. But it worked for me with all my drones.

Jeremie Pilon

Ankur Bose

Hi Yanis Bouhraoua,
Can you please let us know the exact error that you are getting while connecting to Bluetooth? It would be good if you can share the snapshot. You can also share your email-id so that I can contact you to resolve the issue you are facing.

Ankur

Ankur Bose

Hi All,
For those users who have been unable to successfully update the firmware on their Parrot Rolling Spider, we reached out to Parrot Inc and they gave us a workaround.
The workaround has already been published in R2017b in the support package version 17.2.3.
Please upgrade your support package version to 17.2.3 in R2017b and perform the hardware setup for Parrot Rolling Spider once more.

Alternatively, you can also follow the steps mentioned in this MATLAB answer by Ankur Bose on 29 January 2018.

https://in.mathworks.com/matlabcentral/answers/377285-hardware-failure-firmware-update-of-parrot-rolling-spider

Thanks,
Ankur

Ankur Bose

Hi Jakub Jaroszewski,
Can you please share your email-id through which I can contact you so that I can help you out with the problem you are facing?
Also can you take a look at the below MATLAB answer to see if your issue is resolved?
https://in.mathworks.com/matlabcentral/answers/361011-parrot-minidrone-firmware-update-java-error

Thanks,
Ankur

Update: After reinstalling the package I managed to get to the later point of installation with "Hardware Setup Error" - Java exepction occured.
Screenshot with full error report https://ibb.co/haQX1w

I am having the same problems as Yanis Bouhraoua and Jeremie Pilon. I have managed to install firmware in the past on one of the drones I own, but now when I am trying to install firmware on different drone I get "Hardware Setup Error" every single time. Firmware on the old drone still works and whenever I run setup with old drone firmware is being recognized.

Can you tell me, when can we expect an update, since I am doing a project with specified deadline, which relies on firmware working.
I am using Windows 7, Matlab 2017b and newest version of support package 17.2.3.0. I have also tried it on Linux with no success either.

I'm encountering the exact same problem as Jeremie Pilon. I tried several time to connect my PARROT Rolling Spider by bluetooth and it fails each time whith a unexpected error. I did my attempts after installing the firmware from the new version of this support package (17.2.3.0).

Ankur Bose

Hi Jeremie,
We have contacted Parrot Inc. for the firmware update failure in case of Rolling Spider and they have provided us a workaround for the issue. We will have an update soon for the support package in R2017b with the resolution.
If you do not wish to wait for the update, please let me know the platform (Windows, MAC or Linux ?) on which you are working with the support package and the MATLAB version and I will help you with the steps to update the firmware of the drone successfully.

Thanks,
Ankur

Jeremie Pilon

Is it possible to have access to older version of the file? There is a problem with the installation of the firmware with the newest version on the parrot rolling spider. Please provide all previous version to help in the debugging. With a previous version, I was able to successfully install the firmware, but not connect via bluetooth. With the newest version, I can't install the firmware, but the bluetooth functions properly.

Hi Everyone,

The support for Parrot Mambo Minidrone is available with 17b version of support package. You can download and Please try and let us know your feedback.

Aditya

Aditya (view profile)

I want to use this in the future for the Mambo (which I know is coming soon). It would be great if the example model was included as part of the hardware support package as well so that an aerospace blockset license is not required. The purpose of this package is to encourage experimentation by hobbyists and so providing the example project as part of that would be great.

Hi All,
You can have a look at the Post by Guy Rouleau on the topic "Programming a PARROT Minidrone using Simulink".
Here is the link to the post : https://blogs.mathworks.com/simulink/2017/11/17/programming-a-parrot-minidrone-using-simulink/

Hi All,
Now, You can download the latest version of the support package (17.2.1) for the 17b release of MATLAB.
Here are the updates:
- External mode over BLE.
- Updated Getting started example.
- Flight Control UI to be used once after downloading the Simulink generated code to drone
(Useful to Start,Stop the drone and also you can see options to set Power gain, Simulation time and buttons to retrieve the flight log and MAT file). (MATLAB Command to launch Flight Interface : Parrot_FlightInterface)

We are working on adding support for Parrot Mambo minidrone to the support package which will be available in January.

Tori Wuthrich

Hi Luís Mesquita,

The Simulink Support Package for Parrot Minidrones is supported from MATLAB 2017a release on wards only. You can work with Rolling spider Minidrone only for 2017a version of support package. If you can upgrade the MATLAB, I recommend you to update to MATLAB R2017b release instead of 2017a. We are working on adding support for Parrot Mambo Minidrones in 2017b version of support package. Please stay tuned to this page if you are interested in the usage of Parrot Mambo. If you would like to work with rolling spider, the minimum version of MATLAB release is 2017a. Please let me know if you need any more information.

It doesn't work in my MATLAB 2016b. Any help? I am not able to install the Simulink Support Package for PARROT Minidrones.

17.2.0 version of support package (compatible with R2017b) is out with Getting started Example.
Here is the link for the example to get started with support package in 17b.
https://in.mathworks.com/help/supportpkg/parrot/examples/getting-started-with-simulink-support-package-for-parrot-minidrones.html

I have the exact same problem and I cannot set up the hardware.
Are there any updates on this issue?

OS, MATLAB: Windows 10 Education, MATLAB R2017a

Hi Ankur!

Thank you for response. The results of actions you suggested:
1. I connect drone to PC, one LED is RED, the other is GREEN
2. I see a drive "Parrot_RS (E:)" in "My computer"
3. I run commands:
o = matlab.hwmgr.internal.hwconnection.USBDeviceEnumerator
o.getMountPoints
and "ans" variable is "0×0 empty cell array"
4. I type the command "wmic" in command prompt, then the "logicaldisk" command (without any error occure)
5. I see a list of my drives and one of them is my Rolling Spider:
Access : 0
Caption : E:
Compressed : FALSE
CreationClassName : Win32_LogicalDisk
Description : Removable Disk
DeviceID : E:
DriveType : 2
FileSystem : FAT32
FreeSpace : 33444864
MaximumComponentLength : 255
Name : E:
Size : 34063360
SupportsDiskQuotas : FALSE
SupportsFileBasedCompression : FALSE
SystemCreationClassName : Win32_ComputerSystem
SystemName : LAPTOP-6M4RG4CC
VolumeDirty : FALSE
VolumeName : Parrot_RS
VolumeSerialNumber : 10
6. I execute
o = matlab.hwmgr.internal.hwconnection.USBDeviceEnumerator
o.getMountPoints
and "ans" variable is still "0×0 empty cell array"
7. I run "NET.isNETSupported" on MATLAB command window and the result is "logical 1"

What else can I do?

Ankur Bose

Hi Pavel,
When the Rolling Spider minidrone is connected to the PC over USB, there is a timeout period after which the drone automatically disconnects from PC. It disappears from the drive list also and you cannot see the drone mount point anymore. A simple way to know if your Rolling Spider is connected to PC is to check the LEDs. When the minidrone is connected to PC over USB, the LEDs blink for a moment and after that one LED stabilizes to GREEN and other to RED. When the timeout happens and the minidrone disconnects, the GREEN LED (or both the LEDs in some case) turns off. You cannot see the minidrone mount point in the Windows anymore . If that happens, reconnect the minidrone over USB, wait for the LEDs to stabilize to one GREEN and one RED and then search for drone in the setup application. The timeout period is typically observed to be around 60 seconds.
If you find that the minidrone is connected to PC but the setup application is still failing to detect the minidrone, please check the following things
1. Check if it is being shown in the Windows drive list and has a drive associated with it in "My Computer". Also run the below command in MATLAB and see if drone is listed in output.
o = matlab.hwmgr.internal.hwconnection.USBDeviceEnumerator
o.getMountPoints

If drive is present in my computer and not in the result of o.getMountPoints, then the problem is with API.

1) First check is .NET is installed properly. Execute "NET.isNETSupported" on MATLAB command window.
2) Second check if WMI is enabled for the Windows machine. Type the command "wmic" in command prompt . This should not through any error. Once you are in wmic , try "logicaldisk" command.
Let us know your observations

Thank you, Jagadeesh.
By the way, how was you able to leverage with Support Package setup on Windowns machine?
Setup application don't see my Rolling Spider at all.
I realize that problem in a disability of MATLAB to find my drone as a mount point. When I run this commands with the drone connected:
usbDevices = matlab.hwmgr.internal.hwconnection.USBDeviceEnumerator;
usbDevices.getMountPoints('vendorid','19cf')
the last one returns an empty cell array. BUT on Linux machine all is well. And even command "usbDevices.getAttachedDevices" in Windows show me my drone connected, "usbDevices.getMountPoints" returns empty result.
I even have tried to make mount point for drone myself in Windows (i.e. C:\MountPoints\RS) but with no success.
Have you been facing problems like that?

Hi Pavel,

We are working on supporting Mambo in the future release of this support package. We will let you know once we add support for the Mambo minidrone.
We used Cirolink® Bluetooth 4.0 USB Adapter (and CSR Harmony Wireless Software Stack v.2.1.63.0 drivers) to test it on Windows7 and Windows 10. We have seen that all the bluetooth adapters are not having the PAN GN functionality. We will let you know once we find any solution for the adapters which are not having PAN GN functionality.

Thanks Ankur! It's quite confusing that submission has a Minidrone Mambo on cover image.

BTW did you test it in Windows 10?
I try but in Win 10 I'm not able to make GN connection via bluetooth and Hardware setup tool can't detect my Rolling Spider (even with the appropriate RNDIS driver for USB connection).

Ankur Bose

Hi Pavel,
In 17.1.0 version , only PARROT Rolling Spider is supported.

This is for Minidrone Mamboo only or RollingSpider is suitable too?

MATLAB Release Compatibility
Created with R2017a
Compatible with R2017a to R2018a
Platform Compatibility
Windows macOS Linux

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

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

» Watch video