Connection and control for Jumping Sumo or Bebop via MATLAB

Hello,

I am studying on autonomous indoor navigation, and have been tried some applications under Linux C/C++ environment. However, still I am more familiar with MATLAB, so I want to try something under MATLAB environment, too.

I found some previous works done by developers for Parrot AR Drone 1.0 and 2.0 using MATLAB, but I cannot find the one for Parrot AR Drone 3.0 generation such as Jumping Sumo or Bebop Drone.

Is there anybody who can give some tips to use MATLAB for communication with Jumping Sumo or Bebop Drone?

Basically, as I know, for both Jumping Sumo and Bebop Drone, the TCP/IP connection must be established between PC and drones for discovery using port 44444, and then real-time communication such as receiving data and sending commands can work via UDP connection.using port 54321 for device to controller and port 43210 for controller to device.

The basic communication commands and scripts that I suppose for this is following lines, for example, but it does not work well for some reason.

% Jumping Sumo Communication Test

% Creating TCP/IP Discovery Connection
JSd = tcpip(‘192.168.2.1’, 44444, ‘NetworkRole’, ‘server’);
% Opening TCP/IP ports
fopen(JSc);
% Creating UDP Real-Time Connection
% Command Port
JSc = udp(‘192.168.2.1’, 54321);
% Navdata Port
JSn = udp(‘192.168.2.1’, 43210);
% Opening UDP ports
fopen(JSc)
fopen(JSn)

% Sending a packet of some bytes on Navdata Port
fwrite(JSn, 1);

For reference, I attach following link, and please note that it is for Parrot ARDrone 1.0.

Seems like I have to send following command in JSON format
{“controller_type”:“computer”, “controller_name”:“JScontroller”, “d2c_port”:“43210”}
before try udp connection, but how can I send command in JSON format in MATLAB?

Does it work at the end?

You can use the jsonencode MATLAB function to convert a structure in MATLAB to JSON.

Also, you can use the MATLAB Support Package for Parrot drones to control the latest family of Parrot Drones

1 Like

Thank you, Vijay! But is the MATLAB Package only works for Parrot Minidrone Rolling Spider and Mambo? Will it work with Jumping Sumo?

Updates; I have tried the latest MATLAB support error, but I ran into some errors:

>> AOLJRT
Error using asyncio.MessageHandler/onError (line 31)
More data is available

Error in parrot/setupDrone (line 1337)

  •                pause(0.01);*
    

Error in parrot (line 197)

  •            setupDrone(obj);*
    

Error in AOLJRT (line 1)
AOL = parrot();

Warning: Error occurred while executing the listener callback for event Executing defined for class
internal.IntervalTimer:
Error using parrot>@(~,~)obj.readAsync (line 1321)
Unable to connect to a Parrot drone. Ensure that the drone is powered on and the computer is connected to the drone’s
WiFi network.

Error in internal.IntervalTimer/onCustomEvent (line 154)

  •    notify(obj, 'Executing', internal.TimerInfo(eventData.ExecutionCount));*
    

Error in internal.IntervalTimer>@(source,data)obj.onCustomEvent(data.Type,data.Data) (line 115)

  •                                             @(source,data) obj.onCustomEvent(data.Type,data.Data));*
    

Error in asyncio.Channel/onCustomEvent (line 473)

  •        notify(obj, 'Custom', asyncio.CustomEventInfo(type,data));*
    

Error in asyncio.Channel>@(source,data)obj.onCustomEvent(data.Type,data.Data) (line 405)

  •                                 @(source, data) obj.onCustomEvent(data.Type, data.Data));*
    

Error in parrot/setupDrone (line 1337)

  •                pause(0.01);*
    

Error in parrot (line 197)

  •            setupDrone(obj);*
    

Error in AOLJRT (line 1)
*AOL = parrot(); *
> In internal.IntervalTimer/onCustomEvent (line 154)

  • In internal.IntervalTimer>@(source,data)obj.onCustomEvent(data.Type,data.Data) (line 115)*
  • In asyncio.Channel/onCustomEvent (line 473)*
  • In asyncio.Channel>@(source,data)obj.onCustomEvent(data.Type,data.Data) (line 405)*
  • In parrot/setupDrone (line 1337)*
  • In parrot (line 197)*
  • In AOLJRT (line 1) *
    Operation terminated by user during parrotio.internal.Telnet/open

In parrotio.internal.Utility.validateFirmware

In parrot/setupDrone (line 1341)

  •            parrotio.internal.Utility.validateFirmware(obj.FirmwareVersion, obj.MamboLatestFirmware, obj.IPAddress);*
    

In parrot (line 197)

  •            setupDrone(obj);*
    

In AOLJRT (line 1)
AOL = parrot();

I think it is the I/O issues because Jumping Sumo and Mambo have different defined I/O pins because I have change the IPAddress and Port Numbers in the parrot.m

Hi,

You are right. The Jumping Sumo and the Mambo have two different interfaces and an IPaddress/port change in the source code may not work directly.

-Srijith

1 Like