What type of drone are you using?
This should only work with a Bebop drone.
The Anafi does not know how to flip and will simply ignore the Flip command message.
I am sorry, but do you the default IP address of simulated Bebop? I did not find on this website.
Besides, do ANAFI and Bebop share the same function command or I need to download another library specifically for Bebop?
No need to apologize. I’m sorry but I just forget to tell you one important piece of advice.
For Bebop drones, the drone type has to be given to the olympe.Drone class constructor :
import olympe
import olympe_deps as od
drone = olympe.Drone("10.202.0.1", drone_type=od.ARSDK_DEVICE_TYPE_BEBOP_2)
the default drone simulated IP address (10.202.0.1) does not change.
Let me know if that works for you.
Please note that unlike Anafi, Bebop drone support in Olympe is provided on a best effort basis.
Hello ndessart,
Is what you said still relevant if I want to connect to a physical drone ? Im trying to reach my parrot bebop 2 but it says the IP isnt correct, even though im using the IP that shows up in the drone’s wifi properties.I tried with and without the code ```
import olympe_deps as od
drone = olympe.Drone(“my ip”, drone_type=od.ARSDK_DEVICE_TYPE_BEBOP_2)
This is the main part of what is returned
08/07/2019 18:30:56.602504 _connecting_cb Connecting to device: drone_under_test
08/07/2019 18:30:56.603970 _connect_to_device Connection in progress...
08/07/2019 18:30:56.605135 _inject_device_to_raw_discovery Device manually added to raw discovery
08/07/2019 18:30:58.610878 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7fa2f667cd90> socket_fd 12 socket_kind 1 userdate_pointer None
08/07/2019 18:31:00.617616 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7fa2f667cd90> socket_fd 12 socket_kind 1 userdate_pointer None
I arsdkctrl: discovery 'raw': remove device name='drone_under_test' id='000000000'
I arsdkctrl: internally disconnect device name='drone_under_test' type=BEBOP_2 id='000000000'
08/07/2019 18:31:01.675813 connection Unable to connect to the device. IP : b'192.168.42.44'
Traceback (most recent call last):
File "takeoff.py", line 11, in <module>
>> FlyingStateChanged(state="hovering", _timeout=10)
NameError: name 'FlyingStateChanged' is not defined
08/07/2019 18:31:01.682798 _canceled_cb Connection to device: <ctypes.LP_c_char object at 0x7fa2f667cae8> has been canceled for reason: LOCAL
08/07/2019 18:31:01.789429 _device_removed_cb Device has been removed
08/07/2019 18:31:01.793711 _stop_discovery Device removed from discovery
I arsdkctrl: discovery 'raw': stop
08/07/2019 18:31:01.796857 _stop_discovery Discovery has been stopped
It seems that your problem is that you do not define the function FlyingStateChanged()
Please add this: from olympe.messages.ardrone3.PilotingState import FlyingStateChanged
Traceback (most recent call last):
File “takeoff.py”, line 3, in
from olympe.messages.ardrone3.PilotingState import FlyingStateChange
ImportError: cannot import name ‘FlyingStateChange’
Thats the error it returns. Here is the python code:
import olympe
from olympe.messages.ardrone3.Piloting import TakeOff, Landing
from olympe.messages.ardrone3.PilotingState import FlyingStateChange
08/07/2019 19:11:11.255789 _create_pomp_loop Creating pomp loop
08/07/2019 19:11:11.257151 _create_manager New manager has been created!
08/07/2019 19:11:11.257761 _create_manager Manager device callbacks has been added to the manager
08/07/2019 19:11:11.258593 _create_net_backend New net backend has been created
08/07/2019 19:11:11.259191 _create_net_backend Set backend socket callback OK
08/07/2019 19:11:11.259770 create_timer Creating pomp timer
08/07/2019 19:11:11.260520 create_timer Creating pomp timer
08/07/2019 19:11:11.263990 _start_net_discovery Net discovery object has been created
I arsdkctrl: discovery ‘net’: start
08/07/2019 19:11:11.265680 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f872d390f28> socket_fd 10 socket_kind 0 userdate_pointer None
08/07/2019 19:11:11.266646 _start_net_discovery Net discovery has been started
08/07/2019 19:11:13.272246 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f872d380400> socket_fd 10 socket_kind 0 userdate_pointer None
08/07/2019 19:11:15.276597 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f872d380400> socket_fd 10 socket_kind 0 userdate_pointer None
I arsdkctrl: discovery ‘net’: stop
08/07/2019 19:11:16.350050 connection trying to bypass discovery using device {‘name’: b’drone_under_test’, ‘addr’: b’192.168.42.44’, ‘port’: 44444, ‘dronetype’: 2316, ‘serialnb’: b’000000000’}
08/07/2019 19:11:16.354364 _stop_discovery Discovery has been stopped
08/07/2019 19:11:16.355787 _stop_discovery Discovery object has been destroyed
08/07/2019 19:11:16.357174 _start_raw_discovery discovery object has been created
I arsdkctrl: discovery ‘raw’: start
08/07/2019 19:11:16.358196 _start_raw_discovery discovery started
I arsdkctrl: discovery ‘raw’: add device name=‘drone_under_test’ id=‘000000000’
08/07/2019 19:11:16.363167 _device_added_cb New device has been detected
08/07/2019 19:11:16.364714 _device_added_cb {‘state’: 0}
08/07/2019 19:11:16.367759 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f872cb5ce18> socket_fd 11 socket_kind 2 userdate_pointer None
08/07/2019 19:11:16.369636 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f872cb5ce18> socket_fd 12 socket_kind 1 userdate_pointer None
08/07/2019 19:11:16.371318 _connecting_cb Connecting to device: drone_under_test
08/07/2019 19:11:16.375147 _connect_to_device Connection in progress…
08/07/2019 19:11:16.376092 _inject_device_to_raw_discovery Device manually added to raw discovery
08/07/2019 19:11:18.378828 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f872cb5cd90> socket_fd 12 socket_kind 1 userdate_pointer None
08/07/2019 19:11:20.384795 _backend_socket_cb backend_pointer <olympe_deps.LP_struct_arsdkctrl_backend_net object at 0x7f872cb5cd90> socket_fd 12 socket_kind 1 userdate_pointer None
I arsdkctrl: discovery ‘raw’: remove device name=‘drone_under_test’ id=‘000000000’
I arsdkctrl: internally disconnect device name=‘drone_under_test’ type=BEBOP_2 id=‘000000000’
08/07/2019 19:11:21.444743 connection Unable to connect to the device. IP : b’192.168.42.44’
08/07/2019 19:11:21.452983 _canceled_cb Connection to device: <ctypes.LP_c_char object at 0x7f872cb071e0> has been canceled for reason: LOCAL
08/07/2019 19:11:21.558604 _device_removed_cb Device has been removed
08/07/2019 19:11:21.562395 _stop_discovery Device removed from discovery
I arsdkctrl: discovery ‘raw’: stop
08/07/2019 19:11:21.566258 _stop_discovery Discovery has been stopped
08/07/2019 19:11:21.567572 _stop_discovery Discovery object has been destroyed
08/07/2019 19:11:21.573341 _send_command Ardrone3.Piloting.TakeOff(): has been sent asynchronously
Traceback (most recent call last):
File “/home/alpha/code/parrot-groundsdk/packages/olympe/src/olympe/_private/pomp_loop_thread.py”, line 203, in _run_task_list
ret = f(*args, **kwargs)
File “/home/alpha/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py”, line 872, in _send_command_impl
raise RuntimeError("[sendcmd] Error cmd interface seems to be destroyed")
RuntimeError: [sendcmd] Error cmd interface seems to be destroyed
08/07/2019 19:11:21.576156 _stop_discovery No discovery instance to be stopped
08/07/2019 19:11:21.583256 _stop_discovery No discovery instance to be stopped
08/07/2019 19:11:21.589306 _send_command Ardrone3.Piloting.Landing(): has been sent asynchronously
Traceback (most recent call last):
File “/home/alpha/code/parrot-groundsdk/packages/olympe/src/olympe/_private/pomp_loop_thread.py”, line 203, in _run_task_list
ret = f(*args, **kwargs)
File “/home/alpha/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py”, line 872, in _send_command_impl
raise RuntimeError("[sendcmd] Error cmd interface seems to be destroyed")
RuntimeError: [sendcmd] Error cmd interface seems to be destroyed
08/07/2019 19:11:31.613217 _stop_discovery No discovery instance to be stopped
08/07/2019 19:11:31.617874 _destroy_net_backend Net backend has been destroyed
08/07/2019 19:11:31.619198 _destroy_manager Manager has been destroyed
08/07/2019 19:11:31.620591 destroy_timer Pomp loop timer has been destroyed
08/07/2019 19:11:31.621776 destroy_timer Pomp loop timer has been destroyed
08/07/2019 19:11:31.622705 _destroy_pomp_loop Pomp loop has been destroyed
I am now trying the function circle using bebop. I can see the command is processed in the terminal but I cannot see the drone doing any activities, wondering the reason.
Thanks in advance.
Here is the code:
import olympe
import olympe_deps as od
from olympe.messages.ardrone3.Piloting import TakeOff, moveBy, Landing, Circle
from olympe.messages.ardrone3.PilotingState import FlyingStateChanged
from olympe.messages.ardrone3.Animations import Flip
drone = olympe.Drone(“10.202.0.1”,drone_type=od.ARSDK_DEVICE_TYPE_BEBOP_2)
drone.connection()
drone(TakeOff()>> FlyingStateChanged(state=“hovering”, _timeout=5)).wait()
drone(moveBy(5, 5, 0, 0)>> FlyingStateChanged(state=“hovering”, _timeout=5)).wait()
drone(Circle(0)>> FlyingStateChanged(state=“hovering”, _timeout=5)).wait()
drone(Landing()).wait()
Here is what is shown in terminal:
10/07/2019 01:20:27.449785
_send_command Ardrone3.Piloting.Circle(c_uint(0),): has been sent asynchronously
Do you how to connect to the simulated disco drone?
I run this code drone =olympe.Drone(“10.202.0.1”,drone_type=od.ARSDK_DEVICE_TYPE_DISCO)
but maybe I mistake the type, it does not work.
You should just have to connect to the simulated disco, “shake hit” to simulate a hand launch and then send the usual takeoff command.
drone =olympe.Drone(“10.202.0.1”,drone_type=od.ARSDK_DEVICE_TYPE_DISCO)
drone.connection()
# send a "shake" request to the simulator here as explained in the Sphinx documentation
drone(TakeOff()).wait()