Freeflight and Skycontroller cannot connect to a simulated Bebop2

I managed to get Sphinx running under Ubuntu 16.4 simulating a Bebop2 drone.
The drone appears in the simulation space, still on the ground.
An AP is properly activated - milos_pc_d3ce6f ; router IP 192.168.42.1, unsecured network.
My iPhone (6S iOS 11.2) can connect to the AP receiving the IP address 192.168.42.67.
Yet, if I start Freeflight Pro 5.1.0, the simulated Bebop2 is not visible at all.
When I connect a Skycontroller2 (sw. 1.0.7 hw 7) to my iPhone then suddenly a simulated drone milos_pc_xxxx appears in the drone list but I cannot connect to it - a rotor icon keeps on rolling forever.
Any idea on what I am doing wrong or things that I should correct to get connected to the simulated drone?
(at the bottom of the message you can see the output of the simulator while running)

By the way I also tried to start the simulation of a disco drone, exactly with the same outcome (the AP has a different name…)

Looking forward to getting some hints.
Thanks!

Sphinx simulator version 0.23.1

Gazebo multi-robot simulator, version 7.0.1
Copyright (C) 2012-2015 Open Source Robotics Foundation.
Released under the Apache 2 License.
http_//gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http_ //127.0.0.1:11345
[Msg] Publicized address: 127.0.0.1
Gazebo multi-robot simulator, version 7.0.1
Copyright (C) 2012-2015 Open Source Robotics Foundation.
Released under the Apache 2 License.
http_//gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http_//127.0.0.1:11345
[Msg] Publicized address: 127.0.0.1
[Msg] created parameter server on http:8383
[Msg] connected to firmwared
[Msg] PrepareFirmwares
[Msg] Preparation of firmware http_//plf.parrot.com/sphinx/firmwares/ardrone3/milos_pc/latest/images/ardrone3-milos_pc.ext2.zip
[Msg] firmware /usr/share/firmwared/firmwares//ardrone3-milos_pc.ext2.zip.ef8783c8-93c1-3439-a73b-fed81c699154.firmware supported hardwares:
[Msg] milosboard
[Msg] start listen on socket /tmp/fd_mount_points/instances/d069516ca10915613b042e54b897d416818896d0/union/simulator/iio_simulator.sock
[Msg] Selected params to build .sdf file for bebop2:
param flir_pos = tilted
param kalamos_clip_far = 35
param kalamos_clip_near = 1.5
param low_gpu = 0
param with_flir = 0
param with_front_cam = 1
param with_hd_battery = 0
param with_kalamos = false
[Msg] start listen on socket /tmp/fd_mount_points/instances/d069516ca10915613b042e54b897d416818896d0/union/simulator/iio_time.sock
[Msg] All plugins for drone bebop2[d069516ca10915613b042e54b897d416818896d0] loaded
I libshdata: New user header matches the one already present in shared memory
I libshdata: New metadata header matches the one already present in shared memory
I libshdata: Memory section “omniscient_bebop2” successfully reopen for writing with revision number : 6
I libshdata: New user header matches the one already present in shared memory
I libshdata: New metadata header matches the one already present in shared memory
I libshdata: Memory section “time_bebop2” successfully reopen for writing with revision number : 6
I libshdata: New user header matches the one already present in shared memory
I libshdata: New metadata header matches the one already present in shared memory
I libshdata: Memory section “battery_bebop2” successfully reopen for writing with revision number : 6
I libshdata: New user header matches the one already present in shared memory
I libshdata: New metadata header matches the one already present in shared memory
I libshdata: Memory section “gps_bebop2” successfully reopen for writing with revision number : 6
[Msg] Drone bebop2[d069516ca10915613b042e54b897d416818896d0] loaded
[Msg] Started websocket server on localhost:9002
[Msg] Instance petulant_rebekka[d069516ca10915613b042e54b897d416818896d0] started
[Msg] All drones instantiated
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/user_camera/pose, deleting message. This warning is printed only once.
[Wrn] [IioObjectPrivate.hh:287] request for sample already ongoing!
[Wrn] [IioObjectPrivate.hh:287] request for sample already ongoing!
[Wrn] [IioObjectPrivate.hh:287] request for sample already ongoing!
[Wrn] [IioObjectPrivate.hh:287] request for sample already ongoing!
[Wrn] [IioObjectPrivate.hh:287] request for sample already ongoing!
[Wrn] [IioObjectPrivate.hh:287] request for sample already ongoing!
[Wrn] [IioObjectPrivate.hh:287] request for sample already ongoing!

Hello,

On this page, you can see the list of WiFi requirements:
http://developer.parrot.com/docs/sphinx/system-requirements.html#wifi
In particular, you have to check that your WiFi adapter is not based on the Realtek chipset RTL8192CU.

If you have a low-end GPU, you may also want to try without the front camera:
sphinx /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone::with_front_cam=false

1 Like

Thanks for your feedback. Indeed the WiFi adapter is one of the suggested ones - actually a n EP-N8531. The AP does start up properly and has the IP 192.168.42.1 equivalent to the real Bebop2.
Front camera is also disabled.
Is there a way to check if the simulated Bebop2 is actually connected to the AP ??

Thanks.

The only way to see if the simulated drone is connected is by seeing it connected in FreeFlight.

Do you, by any chance, use a Linux kernel version less recent than 3.19?

You can try this sequence of actions to make sure that your installation is correct:

Clean firmware artifacts:
fdc drop_all instances
fdc drop_all firmwares
rm /dev/shm/shd_*

Stop firmwared:
sudo systemctl stop firmwared.service

Delete download firmwares:
sudo rm /usr/share/firmwared/firmwares/*

Reinstall parrot-sphinx:
sudo apt-get remove --purge parrot-sphinx
sudo apt-get install parrot-sphinx

Restart your machine.

Restart firmwared:
sudo systemctl start firmwared.service

Relaunch sphinx:
sphinx /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone::with_front_cam=false

1 Like

Thanks a lot !!!
I managed to get it to work - pardon, to fly!
First of all I installed a bootable Ubuntu disk on my Mac (my previous attempt was using Ubuntu under Parallels)
Then set the name of the wifi dongle as wlan0.
Then indeed explicitly disabled the front cam – and I got the drone visible in FreeFligth.
I could connect and fly it!!!

Is there a way to “follow” the drone, since the front-cam is disabled?

Best regards !

Glad to hear it.

There is a section in sphinx documentation that explains how to set the wifi interface name: http://developer.parrot.com/docs/sphinx/troubleshooting.html#my-wifi-interface-got-its-name-changed-after-exiting-the-simulation
If you don’t do that, you have to change the <stolen_interface> parameter in your bebop2.drone like so:
$ sphinx /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone::stolen_interface=my_wifi_name:eth0:192.168.42.1/24

To follow the drone, just right click on it and select “Follow”.
The GUI camera can be adjusted dynamically within Gazebo: http://gazebosim.org/tutorials?tut=track_visual&cat=tools_utilities&branch=track_visual#DynamicReconfigure

1 Like

Thanks, Ocrave for your help.
I could fly nicely around one of the outside worlds, following the bebop2 drone.
What I find quite amazing is that the simulator does behave as the real drone - I have a real bebop2 as well!
Next steps are to develop a world around my home and connect also the skycontroller2 - and then fly there!

FYI, by disabling the front camera a friend was also able to run the simulation on a virtual machine under Parallels, but the computing power is not sufficient for a smooth control.

Best regards, Gabriele

1 Like

Thanks for the feedback.
There is a page in sphinx documentation that explains how to create a custom world with OpenStreetMap that you may find useful: http://developer.parrot.com/docs/sphinx/openstreetmap.html

Maybe I should open up a new discussion on this topic, but it is a next step of our ongoing discussion.
I have been trying to control my simulated Bebop2 with my Skycontroller2 with no success.
When I switch on the Skycontoller while the simulation is running -i.e. the AP is active- the switch on button will turn from steady red to blinking green for a couple of seconds and then turn blinking red for ever.
The Skycontroller is connected to the iPhone running Freeflight, and it looks active but it cannot detect any drones present.
If I connect the iPhone to the simulation controlled AP I can detect it is actually active on 192.168.42.1.

Hebelow by bebop2.drone file.
Any suggestions?

<?xml version=“1.0” encoding=“UTF-8”?>
<drone
name="bebop2"
firmware="http://plf.parrot.com/sphinx/firmwares/ardrone3/milos_pc/latest/images/ardrone3-milos_pc.ext2.zip"
hardware=“milosboard”>
<sdf_params
low_gpu="false"
with_front_cam="true"
with_hd_battery="false"
with_flir="false"
flir_pos=“tilted”/>
<pose>default
<interface>eth1
<wifi_channel>6</wifi_channel>
<!-- ‘wlan0’ may need to be replaced the actual wifi interface name -->
<stolen_interface>wlan0:eth0:192.168.42.1/24</stolen_interface>
</drone>

I don’t know if that’s a copy/paste error but you should close the <pose> and <interface> XML tags in your bebop2.drone file.

Other than that, I don’t see any error. In particular, you did not forget to add <wifi_channel>6</wifi_channel> which is mandatory to connect to a Skycontroller 2.

Do you disable the wifi on your phone during the simulation?

Well, I disabled WiFi and put the iPhone in airplane mode and then the Skycontroller2 got connected!
It takes a while, and the drone appears with the AP name, but it di work! Thanks.
I have to say that I never had problems with a real Bebop2, even with WiFi switched on in my iPhone.

When the drone crashes (it happens…) is there an easy way to reset the simulation without restarting everything?
If I just set the position of the drone back to a reasonable state, sometimes I can restart it and take off again - sometimes I can’t - sometimes I get an erratic behaviour and a “barometric” sensor error…

Thanks for your very good help!

The recommended way to reset the simulation is to click on “Edit > Reset World” in gazebo. This command resets the firmware, time and model poses.

Edit->reset->world and edit->reset->model poses do reset the simulation and the position of the drone. The problem is that the sky controller (or the iPhone) get disconnected (the AP appears no longer to be active) and so it not possible to restart flying.
The only way out I found is to actually abort the simulation and restar everything.
A good incentive to stay airborne as long as possible !!