Coder Social home page Coder Social logo

pyparrot's Introduction

pyparrot

Python interface for Parrot Drones

pyparrot was designed and implemented by Dr. Amy McGovern to program Parrot Mambo and Parrot Bebop 2 drones using python. This interface was developed to teach K-20 STEM concepts (programming, math, and more) by programming a drone to fly autonomously. Anyone can use it who is interested in autonomous drone programming!

Installation, Quick-start, Documentation, FAQs

Extensive documentation is available at https://pyparrot.readthedocs.io

Major updates and releases:

  • 10/16/2019: Version 1.5.21: Several fixes submitted by users merged into the main branch.
  • 07/05/2019: Version 1.5.20: One more fix to the new DroneVisionGUI to fix invalid image crashes
  • 06/20/2019: Version 1.5.19: Updated the new DroneVisionGUI to not segfault with invalid images
  • 06/20/2019: Version 1.5.18 Added the ability for DroneVisionGUI to have two windows, one for video and one for user images. Note that the initial geometry isn't quite right but resizing the window makes it work.
  • 04/17/2019: Updated documentation to include workshop slides from April 2019 workshop. Restructured coursework directory to contain AI projects and workshop slides.
  • 03/13/2019: Version 1.5.17: Required PCMD commands to be ints (PR from daanzu)
  • 03/12/2019: Version 1.5.16: Added a disco fix (PR from proff) and fixed IP address fix (PR from daanzu)
  • 03/03/2019: Version 1.5.15: Added disco into wifi connected devices (thank you proff for the PR)
  • 03/02/2019: Version 1.5.14: Fixed ffmpeg vision bug where it wasn't properly killing the ffmpeg subprocess
  • 03/02/2019: Version 1.5.13: Added removal of old files in images directory by default to ffmpeg vision (can turn it off with a parameter)
  • 02/19/2019: Version 1.5.12: Added pull request of wificonnection parameters and added ability to specify IP address (default uses mDNS still)
  • 01/25/2019: Version 1.5.11: Added an example of using a cv2.namedWindow to show two vision windows (but it has issues on mac os 10.14 because it isn't a main thread)
  • 10/29/2018: Version 1.5.10: Updated the groundcam to not break on disconnect with BLE. Also have updated documentation with slides from workshop and windows FAQs.
  • 10/21/2018: Version 1.5.9: Fixed the wifiConnection without mDNS to work for Bebop (mDNS still works on bebop!). Verified that mambo and bebop work now with latest firmware.
  • 10/19/2018: Version 1.5.8: Parrot broke mDNS in firmware 3.0.26 (and ftp is still broken). Disabled the groundcam and hard-coded the IP address and ports for the mambo. Long term we want mDNS back. tested backwards compatiblity on older firmware and it works.
  • 10/13/2018: Version 1.5.7: Parrot released a security update/firmware upgrade to 3.0.25 that breaks ftp login for Mambo. pyparrot now allows the mambo to still connect without errors but the groundcam will not work until we hear from parrot. Also added example for joystick for the parrot swing from victor804
  • 10/05/2018: Version 1.5.6: Removed a bug in the library on pypi where an old file was hanging around
  • 09/19/2018: Version 1.5.5: Added joystink demo for swing (thanks Victor804)
  • 09/06/2018: Version 1.5.4: Removed wait in indoor mode for bebop 1
  • 09/06/2018: Version 1.5.3: Added indoor mode for bebop 1
  • 8/30/2018: Version 1.5.2: Updated camera pan_tilt for Bebop 1 (thanks Victor804)
  • 8/21/2018: Version 1.5.1: fixed small fix for typo in minidrones (for swing)
  • 8/18/2018: Version 1.5.0: major update to suppport parrot swing drones (thank you Victor804). This does break a small backwards compatibility in that you need to import Mambo from Minidrone instead of Mambo. Everything else remains the same.
  • 8/9/2018: Version 1.4.31: hard-coded name for vision stream on windows
  • 8/9/2018: Version 1.4.30: fixed vision bug in windows using VLC (tempfile issues) and also made fps a parameter for VLC vision
  • 7/16/2018: Version 1.4.29: added bebop user sensor callback function to match mambo
  • 7/15/2018: Version 1.4.28: added bebop battery state to default state variables (was in the dictionary only before)
  • 7/13/2018: Version 1.4.27: updated Mambo() initialization to not require address for wifi mode and also updated groundcam demo for Mambo
  • 7/12/2018: Version 1.4.26: added new Bebop commands (mostly setting max limits for the bebop)
  • 7/11/2018: Version 1.4.25: fixed groundcam pictures for Mambo
  • 7/8/2018: Version 1.4.24: switched tempfile to back to NamedTemporaryFile in DroneVisionGUI due to OS incompatibilities
  • 7/8/2018: Version 1.4.23: switched tempfile to SpooledTemporaryFile in DroneVisionGUI to make it faster (uses memory instead of disk)
  • 7/6/2018: Version 1.4.22: Added a wait in flat_trim for Bebop until it is received (optional)
  • 7/5/2018: Version 1.4.21: Added max_tilt and max_altitude to the Bebop commands.
  • 7/4/2018: Version 1.4.20: While move_relative is implemented, it seems to have a firmware bug so DO NOT USE.
  • 7/4/2018: Version 1.4.19: Added move_relative command to the Bebop API. For now, only dx, dy, and dradians should be used as there seems to be a bug internal to the firmware on dz.
  • 6/17/2018: Version 1.4.18 Added landed button status to the Drone Vision GUI for safety in user code
  • 6/16/2018: Version 1.4.17 Added flat trim to mambo also
  • 6/16/2018: Version 1.4.16 Added flat trim to bebop
  • 6/15/2018: Version 1.4.15 Removed a stray print, updated documentation, cast turn_degrees arguments to an int in Mambo.
  • 6/11/2018: Version 1.4.14 Added bebop sdp file to the release on pip
  • 6/7/2018: Version 1.4.13 Fixed duration in PCMD to use milliseconds instead of integer seconds
  • 6/7/2018: Version 1.4.12 Added an option to fly_direct to allow the command to be sent once
  • 6/6/2018: Version 1.4.11 Fixed a stray import statment not fixed from the move to pip
  • 5/31/2018: Version 1.4.10 Documentation updated significantly and moved to readthedocs
  • 5/30/2018: Version 1.4.7 and 1.4.8 and 1.4.9 fixed scripts location to release find_mambo script and added readthedocs documents
  • 5/29/2018: Version 1.4.6 Accepted fixes for Bebop 1 compatibility
  • 5/28/2018: Version 1.4.5 Fixed imports for new pypi structure and added xml files to pypi.
  • 5/25/2018: Version 1.4.3. Uploaded to pypi so pyparrot can now be installed directory from pip. Updated documentation for new vision.
  • 5/23/2018: Updated function (contributed) to download pictures from Mambo's downward facing camera.
  • 3/25/2018: Added DroneVisionGUI which is a version of the vision that shows the video stream (for Bebop or Mambo) in real time.
  • 2/22/2018: Version 1.3.2. Updated DroneVision to make the vision processing faster. Interface changed to only have the user call open_vision and close_vision (and not start_video_buffering)
  • 2/10/2018: Version 1.3.1. Updated DroneVision to work on Windows.
  • 2/8/2018: Version 1.3. Vision is working for both the Mambo and Bebop in a general interface called DroneVision. Major documenation updates as well.
  • 2/6/2018: Updated Mambo to add speed settings for tilt & vertical. Needed for class.
  • 2/4/2018: Unofficial updates to add ffmpeg support to the vision (will make an official release with examples soon)
  • 12/09/2017: Version 1.2. Mambo now gives estimated orientation using quaternions. Bebop now streams vision, which is accessible via VLC or other video clients. Coming soon: opencv hooks into the vision.
  • 12/02/2017: Version 1.1. Fixed sensors with multiple values for Mambo and Bebop.
  • 11/26/2017: Initial release, version 1.0. Working wifi and BLE for Mambo, initial flight for Bebop.

Programming and using your drones responsibly

It is your job to program and use your drones responsibly! We are not responsible for any losses or damages of your drones or injuries. Please fly safely and obey all laws.

pyparrot's People

Contributors

aelthalyste avatar aleixpb2 avatar alexanderdavid avatar amymcgovern avatar awmt102 avatar carryaurel avatar daanzu avatar gprestes avatar mmaz avatar nchengyeeshen avatar sagarjogadhenu avatar tito1337 avatar vabe7 avatar victor804 avatar vladsafin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyparrot's Issues

Accelerometer

Hello, is there a way to gather accelerometers' information via the API ??

newbie question

I thought I'd start slow and just ran python findMambo.py

got "
Traceback (most recent call last):
File "findMambo.py", line 16, in
class ScanDelegate(DefaultDelegate):
NameError: name 'DefaultDelegate' is not defined
"

Is there something else I should be doing

Connection Error

I am trying to control my Mambo drone from my python interpreter to test out the features Ill be using for my class project, but the drone keeps giving me some strange error.

I have the drone with the camera, so the wifi should work, so I connect my laptop to the drone's wifi and give the mambo's number from the wifi hotspot's name to the Mambo constructor, and it prints to the console that Success in setting up the wifi network to the drone!, before continuously printing out timeout - trying again, and i cannot call any of the functions on the drone object.
Is there something I'm doing wrong?
Thanks!

send_auto_takeoff_command() missing in wifiConnection.py

Hi,

I was going through the wifiConnection.py file and could not find the function 'send_auto_takeoff_command()' function which is internally called by the 'turn_on_auto_takeoff()' function. However, this function is present in the bleConnection.py file.

Was this done on purpose to support auto-takeoff feature with only BLE? I updated the wifiConnection.py file, at my end, to include this function and the throw mode seems to work fine.

However, the next time I connect the drone and create the Mambo instance, I observe that the drone stops sending the initial packets after sending the "cut-out enabled" packet.
I am able to take off and perform other operations however the drone does not send any sensor data.

Not identifying Mambo.

Hi All,
I am trying to Run the examples py with Pi. I installed python 3 as per documentation.
I have a Rolling spider verion 1.99.2 / HW_05
Seriel number PIO40320AE 4K160544
It has BLE interface RS_B160544 BLE
The spider works well when i use the FreeFlight Mini App how ever if i
use the code pyparrot It does not work. When i run the findMambo.py
It identify the following BLE addresses .Even if i use all of the BLE address the spider does
not fly, Is is necessary to It should be Mambo 2 or this code will work with Rolling Spider ?
See the bellow error. Any suggesion greatly appriciated.

pi@raspberrypi:~/drone/pyparrot $ sudo python3 findMambo.py
Discovered device e0:14:bc:06:3d:51
Discovered device d0:4f:7e:26:bf:31
Discovered device 68:64:4b:08:36:d2

pi@raspberrypi:~/drone/pyparrot $ python3 demoMamboTricks.py
trying to connect
trying to connect to the mambo at address f4:f5:d8:73:8e:9b
retrying connections
trying to connect to the mambo at address f4:f5:d8:73:8e:9b
retrying connections
connected: False

Drone reconnecting issue

So I am working on a voice-activated drone. the general gist of my code is that I use my mac to access the google speech api for voice recognition, then i use flask and requests to send the commands over to my rpi which controls the drone. Connecting at first is fine, but then when I give the command to take-off, i get the following error messages:
reconnecting to wait
trying to re-connect to the mambo at address 'my addr'
retrying connections
trying to re-connect to the mambo at address 'my addr'
It keeps doing that so my command to take off doesn't work. Any help would be appreciated!

Mambo Altitude over BLE?

Hello,
Is there any way to acquire the Parrot Mambo's Altitude data over BLE? It doesn't seem like something that should be restricted to WiFi, but I understand there may be hardware limitations.

macos support

Hey hi, in the README it seems you only support Linux. Do you have any plans on supporting macos? Thanks!

Error message typo in 'max_tilt' function

Hi,

The error in the 'max_tilt' function talks about the horizontal speed in m/s. I am guessing it is a typo.

On the same note, do you have plans to provide APIs for setting Max Altitude, Max Rotation speed and horizontal speed?

Is there a reason why you chose Max_tilt and Max_vertical Speed only?

Computer Vision Support

I am looking to buy a parrot mambo fpv for a computer vision project involving person tracking and following and was looking at library support for this. You had mentioned that MamboVision was still under development.

Just wanted to know if there is basic support and what is working with respect to vision.
Any suggestions are also welcome! Thanks!

OPENCV issue

could you give which opencv repository with anaconda works with video?
I just install the pip but it has ffmpeg issue.

Problems sending commands to Mambo after updating to 3.0.17

Recently the smartphone app forced me to update to 3.0.17, and since then, I've been getting odd errors relating to sensors:
Could not find sensor in list - ignoring for now. Packet info below. (2, 25, 3) Could not find sensor in list - ignoring for now. Packet info below. (2, 25, 5)
I've also had a harder time connecting to the camera (I'm using opencv directly to connect to the rtsp feed. It now tends to stop reading frames after about 10 frames. Minutes before the update I was able to read at least 1000 frames without issue.

Has anything changed in this firmware update that you know of?

I've tried running the sample program: demoMamboDirectFlight.py

When I do, it tends to combine some of the commands, for example sending a vertical movement command followed by a turn+forward command will result in a climbing turn.

My source is available here: https://github.com/davismariotti/JordanAIDrone/blob/master/drone.py

Sensor data not sent by Mambo FPV drone

Hi,

I was working with the Mambo FPV drone connected to my laptop's wifi connection.
After connecting the drone again, the drone stopped sending the navigation data and battery status.
In fact, it stopped sending any data for that matter.

Speed, Altitude, and battery values never change since no data is received from the drone.

However, it is accepting the control commands like takeoff, fly_direct, land etc.
I tried resetting the drone and re-flashing the firmware. Nothing seems to work. I am not sure what to do next.

Have you ever faced this issue?

Getting state from "moveToChanged"

Hello, first, thank you for the code! It's really helping me with my thesis.

I'm working with a Bebop 2 and have a question about moving the drone to GPS coordinates.
I’ve made some code that uses the “moveTo” command to make the drone reach a specific coordinate. I was wondering if I could ask the bebop whether it has reached its destination coordinate. I currently have no way of knowing when the drone actually reaches that point. Since I noticed in the code that you ask for “AllStates” (in common.xml, common class, AllStates cmd), I thought you might know how to go about this.

I’ve figured out there is a command that seems to poll for a “moveToChanged” state. Refer to the following code (in ardrone3.xml, PilotingState class, moveToChanged cmd):

<cmd name="moveToChanged" id="12">
    <comment
        title="Move to changed"
        desc="The drone moves or moved to a given location."
        support="090c:4.3.0"
        triggered="by [MoveTo](#1-0-10) or when the drone did reach the given position."/>
    <arg name="latitude" type="double">
        Latitude of the location (in degrees) to reach
    </arg>
    <arg name="longitude" type="double">
        Longitude of the location (in degrees) to reach
    </arg>
    <arg name="altitude" type="double">
        Altitude above sea level (in m) to reach
    </arg>
    <arg name="orientation_mode" type="enum">
        Orientation mode of the move to
        <enum name="NONE">
            The drone won't change its orientation
        </enum>
        <enum name="TO_TARGET">
            The drone will make a rotation to look in direction of the given location
        </enum>
        <enum name="HEADING_START">
            The drone will orientate itself to the given heading before moving to the location
        </enum>
        <enum name="HEADING_DURING">
            The drone will orientate itself to the given heading while moving to the location
        </enum>
    </arg>
    <arg name="heading" type="float">
        Heading (relative to the North in degrees).
        This value is only used if the orientation mode is HEADING_START or HEADING_DURING
    </arg>
    <arg name="status" type="enum">
        Status of the move to
        <enum name="RUNNING">
            The drone is actually flying to the given position
        </enum>
        <enum name="DONE">
            The drone has reached the target
        </enum>
        <enum name="CANCELED">
            The move to has been canceled, either by a CancelMoveTo command
            or when a disconnection appears.
        </enum>
        <enum name="ERROR">
            The move to has not been finished or started because of an error.
        </enum>
    </arg>
</cmd>

However, in contrast to the AllStates cmd, this cmd seems to require arguments (refer the the snippet below).

<cmd name="AllStates" id="0" timeout="RETRY">
    <comment
        title="Ask for all states"
        desc="Ask for all states.\n\n
        **Please note that you should not send this command if you are using the\n
        libARController API as this library is handling the connection process for you.**"
        support="drones"
        result="The product will trigger all states events (such as [FlyingState](#1-4-1) for the Bebop).\n
        Then, it will trigger [AllStatesEnd](#0-5-0)."/>
</cmd>

I tried to pass no arguments, to see what it gives. In following snippet you can see how I did this.

def ask_for_move_to_status(self):
    command_tuple = self.command_parser.get_command_tuple("ardrone3", "PilotingState", "moveToChanged")
    return self.drone_connection.send_noparam_command_packet_ack(command_tuple)

This doesn’t really return anything. I was wondering if you know whether the “moveToChanged” cmd is a valid way for retrieving the state. If so, then should I pass parameters and what should I pass? Or how would I go about this? Any help or advice would be much appreciated! Thanks in advance.

How to tell pyParrot to use specific BLE device ?

I got two BLE: 1. Build-in BLE 4.0 , 2. Dongle BLE 4.0 USB.
Everything working fine with Dongle BLE 4.0 USB.
How I can enforce PyParrot to use build-in BLE 4.0 that came with the RaspberryPi/ Asus TinkerBoard?
Right now if I remove the Dongle BLE 4.0 USB the code will not working any more.

Pls kindly advice how to tell pyParrot to use internal one.

Thank you

pyqt problem

Hello Captain
I am trying to use the vision data for the vision based control.
I have 2 question actually first one is pyqt5 issue.
Second one is about image object.
1.
Have you ever use this code in the windows? (DroneVisionGUI.py )
"ImportError: DLL load failed: The specified procedure could not be found"
I just use the pip install in the Anaconda virtual env.
I am trying to install the Pyqt5 and face the dll error.
I am looking for the how to fix this issue.
Does VLC require the window? In your code you said why we need to use the pyqt that it requires windows.
2. Actually this is more important to me. I am little confuse right now Please help!!!
Also I confuse that usually in the opencv example we can use the while loop to handle the every frame.
http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html
However in your DronevisionGUI.py code and demoBebopVisionGUI.py code shows that no while loop.
Is this because of VLC catch the latest frame already?
I just can ask the while loop and get the latest frame as cv2.imread function or below
img = bebopVision.set_user_callback_function(userVision.save_pictures, user_callback_args=None)
This could be related with img = self.vision.get_latest_valid_picture()
however why don't you get the img object directly?

Thank you.
Best Regards
freaad

bluepy.btle.BTLEException: Failed to execute mgmt cmd 'le on'

First of all thank you for your super great effort and support on this project.

I managed to run the demo code successfully, however once I tried to run findMambo.py I got this error. Do you got any suggestion to solve it? I am using Linux tinkerboard 4.4.71+ on Asus Tinker Board.

~/pyparrot$ python findMambo.py 
Traceback (most recent call last):
  File "findMambo.py", line 27, in <module>
    devices = scanner.scan(10.0)
  File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 679, in scan
    self.start(passive=passive)
  File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 617, in start
    self._mgmtCmd("le on")
  File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 276, in _mgmtCmd
    "Failed to execute mgmt cmd '%s'" % (cmd))
bluepy.btle.BTLEException: Failed to execute mgmt cmd 'le on'

Does this work with the Parrot Rolling Spider?

Update: The Rolling Spider drone can be controlled using the Mambo pyparrot module!

All you have to do is replace the Mambo's bluetooth address in the script with that of the Spider's. If you don't know your Spider's address, you can easily edit the findMambo.py script to search for "RS_" instead of "Mambo" on line 37 of the findMambo script.

Note that most sensor data available on the Mambo is not accessible from the Spider. I think only battery can be accessed.


Hey Amy,
I heard that the Parrot Mambo and Spider share commonalities in their firmware and hardware. Does this library work with the Spider, too?

Thanks for your fantastic work on this project!
Peter

Wifi Connection Error -python newbie

I am new to python and parrot mambo programming. I am trying to get this application to work for my wife who is a fifth-grade teacher.
The issue I am trying to connect parrot mambo via wifi on my window 10 laptops. I have an FPV drone.
I followed the Installation offered by Dr. Amy: https://pyparrot.readthedocs.io/en/latest/installation.html#installing-from-pip
I was able to get the drone to take off only twice (no flips nor landing), but now nothing is working?
I confirmed the drone still works via a remote and Bluetooth connection.

The issue seems to be a socket error - Erron 100060 - the third party did not properly respond after a period.

I am able to connect to the mambo wifi network on my laptop. I am not sure which IP address to use - 92.168.99.3, or the one showing up on the device 192.168.99.32. I did update the mambo to current firmware. Also, should the mac address be caps or lower case?
If there is a know safe troubleshooting tool for wifi, or if anyone could offer some suggestions?
I did a reinstall and still having the issues. Fixed the pip3 for windows that was causing me to question if I did the installation correctly, the pip shows the install was successful. As my issue remains to get a success wifi connection, may I ask is there a need to have Linux run on the windows machine? Referencing "findMambo.py"
Thank you

No sensordata when script is executed in command line

I have a rather bizarre problem when running some of my scripts (which use the pyparrot package). Whenever I run them in PyCharm, "udp_receive_sock" receives data from the drone and sensors_dict (from Bebop) gets filled up and updates nicely. However, when I run the same script in Powershell, no data gets sent back from the drone. What's striking, is that all commands like "safe_takeoff" or "fly_direct" do work.

In the screenshot below I've framed the problem.

data not coming in

As can been seen, "udp_receive_sock" continuously times out. "batterij" is dutch for battery, and should normally display the current battery percentage.
Have I perhaps called the script in a wrong way?
I've also tried to run it like this:

alternative command

This gave the same effect...

Any help would be appreciated, thanks!

No module name 'Mambo'

I am not sure why I am getting this error when trying to run one of the example files. Can anyone assist? Typically I would pip install the missing module which I did but it did not resolve the issue.

Reading IMU Values

Hi,
Firstly, Thank you for your work, it's really nice.
secondly, I have a mambo (AIRBORNE Night drone), and I'm trying to read IMU Values while it's moving,
I've started with reading Speed_x, Speed_y, and Speed_z ... As it's shown below... but I got zeros value
`
from Mambo import Mambo
t=0
mamboAddr = "e0:14:bc:d0:3d:a1"
mambo = Mambo(mamboAddr, use_wifi=False)

print("trying to connect")
success = mambo.connect(num_retries=3)
print("connected: %s" % success)

if (success):

print("sleeping")
mambo.smart_sleep(2)
mambo.ask_for_state_update()
mambo.smart_sleep(2)

print("taking off!")
mambo.safe_takeoff(5)

while(t<8):

    print("speed_x state is %s" % mambo.sensors.speed_x)
    
    
    print("speed_y state is %s" % mambo.sensors.speed_y)

    
    print("speed_z state is %s" % mambo.sensors.speed_z)


    print("battery %s" % mambo.sensors.battery)

    
    print("Flying direct: going forward (positive pitch)")
    mambo.fly_direct(roll=0, pitch=50, yaw=0, vertical_movement=0, duration=1)



    print("Flying direct: going backwards (negative pitch)")
    mambo.fly_direct(roll=0, pitch=-50, yaw=0, vertical_movement=0, duration=1)

    
    print("ask_for_state_update")
    mambo.ask_for_state_update()

    t=t+1

print("landing")
mambo.safe_land(5)
mambo.smart_sleep(5)

print("disconnect")
mambo.disconnect()`

I thought the cause is the sequent of code,
So I have tried to make two threads, One of them to pilot and the other to update sensors and read it. but it doesn't work.
I hope BLE give me the Possibility to read IMU Values.
I will be grateful for any ideas.
Thank you.

Import Error Continues

I noted the earlier post with a simliar issue but upon reinstalling and following the sequence I am continuing to get an error with demoMamboTricks,py calling Mambo.py

File "examples/demoMamboTricks.py", line 5, in
from Mambo import Mambo
ImportError: No module named 'Mambo'

If a path issue between the files, what is the best way to approach? Thank you.

have question about angle parsing

Hello Captain.
I digging around about IMU data from bebop for yaw correction.
I think that the yaw for Bebop can get the data from AttitudeChanged.
Following by this information
AutonomyLab/bebop_autonomy#158
I do not have any experience about parsing the data. could you guide the code relationship little bit to get the data?
The class name is PilotingState I need the information from

Yaw value (in radian)

Thank you.

GPS coordonate

Hi, I'm currently using your API to control a bebop 2 and I would like to get the gps coordonate from the drone, do you know how can I do this ? I figured out that I will have to use the command parser and the ardrone3.xml but I don't know exactly how.
Thanks, Sebastien

Python 2.7 compatibility

Hello, nice job done with this package, it has been very helpful, unfortunately I would like to ask if this can be adapted or used with python 2.7. I would like to used parrot mambo with ROS, and ROS is not compatible with Python 3.

demoBebopVisionGUI.py question

Hello. Captain.
I hope you have good weekends.
I read your GUI example for obstacle detection for bebop.
The question is user_vision use the argument
Argument is the demo_user_code_after_vision_opened.
I do not understand the relationship between this two.
Second, I try to use the img variable with opencv.
img = self.vision.get_latest_valid_picture()
if (img is not None):
filename = "test_image_%06d.png" % self.index
cv2.imwrite(filename, img)
self.index +=1
Opencv can not read it.
Do you think it is wrong approach?
Thank you.

Not really working

Hi!

I'm trying to use my mambo with this api that seems very promising, but unfortunately, the drone won't answer...

I'm running my script on a Raspi 3b. My program starts a mqttClient that loops

When I try to use the "safe_takeoff(5)" command, it stays hanging forever on magic handshake and never takes off

pi@snipsparrot:~/snipsparrot $ python main.py
Loading Snips Parrot
trying to connect to the mambo at address e0:14:28:a2:3d:d1
connected! Asking for services and characteristics
magic handshake to make the drone listen to our commandsandsensors
initializing notification delegate
Connected to drone
Could not find sensor in list - ignoring for now. Packet info below.
(2, 25, 3)
Could not find sensor in list - ignoring for now. Packet info below.
(2, 25, 5)
Snips Parrot loaded
Taking off
reconnecting to send packet
trying to re-connect to the mambo at address e0:14:28:a2:3d:d1
connected! Asking for services and characteristics
magic handshake to make the drone listen to our commandsandsensors

Waits a long while and then

reconnecting to send packet
trying to re-connect to the mambo at address e0:14:28:a2:3d:d1
retrying connections
trying to re-connect to the mambo at address e0:14:28:a2:3d:d1
connected! Asking for services and characteristics
magic handshake to make the drone listen to our commandsandsensors

Any idea what's wrong?

Control Multiple Mambos?

I am looking at some 'swarm' based work with mini-drones. I realise that the Mambo doesn't have the GPS or sensors to do proper swarming, but could the python interface be used to simulate a swarm (place the Mambos in different locations on the ground and then get each one to take of, record a photo or two and then land in sequence for example).

Fly the Bebop Power 2 at a certain speed / to a precise point in space

Hi,
First of all thank you for your work that's really helpful.
I would like my Bebop Power 2 to take off at 2 meters from the ground.
Is there a simpler way to do that than playing with the vertical_movement and duration variables pls?
That would (I guess) also answer to my 2nd question which was how to get the drone to go to a certain 2D point in space, without changing its altitude (wondering if there is a simpler way to do that than playing with yaw, pitch, and duration variables).
Thanks a lot,
Rayan

No image appears on the VLC. (demoBebopVisionGUI.py)

I am sorry to frequently ask you a question.
I also tried to run demoBebopVisionGUI.py, and it successfully connected.
PyQt GUI appears and "Run my program" button is pushed, but there are no images on the VLC(Version 3.0.1), and there are no error codes.
I tried it and reboot repeatedly, but no images appears. Of course, the camera cap is removed.
Please tell me the way to get the real time images correctly.

Emergency landing?

In case of emergency that Mambo would crash in to something, how to emergency stop the drone ?

fly_direct doesn't work over wifi

I downloaded and ran Mambo demos using my Windows computer connected to Mambo drone via wifi.
Both in demoMamboTricks and in demoMamboDirectFlight mambo.fly_direct doesn't seem to have any effect on the drone. mambo.flip seem to work fine.
I'm running pyparrot-1.1 as downloaded from "release" tab.

connection failed: bebop 1

Hello,
I can't connect to my bebop 1.
connecting connection failed: did you remember to connect your machine to the Drone's wifi network? False
I am well connected to my drone :p
And I use a raspberry.
I do not know what's the problem?
If you have an idea...

Thank you

Support for other Parrot Minidrones (Cargo)

Does this work with other Parrot Minidrones? I'm trying to use it with a Cargo (Mars).
I can find the drone:
pi@raspberrypi:~/Workspace/drone $ sudo python3 pyparrot-master/scripts/findMambo.py Discovered device e0:14:1c:d3:3d:7e

But when running the demo i get:
pi@raspberrypi:~/Workspace/drone $ python3 pyparrot-master/examples/demoMamboDirectFlight.py ERROR: you are trying to use a BLE connection on a system that doesn't have BLE installed. trying to connect connected: False
Of course I changed the Address in demoMamboDirectFlight.py and the error occurs as well when running as sudo.

ImportError: No module named 'utils.colorPrint'

First of all, i found the error that says "ImportError: No module named 'utils".
So, i used the command "sudo pip install utils" and passed this error, but now I found another error says "ImportError: No module named 'utils.colorPrint'" and i can't solve it.
Please help me

ImportError: libjasper.so.1: cannot open shared object file: No such file or directory

I tried to run the demoMamboVisionGUI.py but got this error msg.

ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

then I managed to solved it by this command

pip3 install opencv-python

then I got another error when try to execute the demoMamboVisionGUI.py

ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

then I solved it with this command

sudo apt-get install libatlas-base-dev

no I got another error
ImportError: libjasper.so.1: cannot open shared object file: No such file or directory

How I can solve this problem? Any complete guide to install all dependencies ?

Yaw value question

Hello Captain.
Do you have any idea that we can get the interneal IMU value such as gyro and compass. I try to do the velocity control but sometime yaw is messing during the fluctation.
Thank you for your nice library.

import issue for DroneSensorParser

Hi @amymcgovern - thank you for providing such a friendly and educational library for Parrot drones! This package is by far my favorite option for the Mambo FPV!

I ran into the following import error on DroneSensorParser after installing via pip; please see the associated PR which adopts the import convention from DroneCommandParser

File "mambo/pyparrot/pyparrot/Mambo.py", line 301, in __init__
    self.sensor_parser = DroneSensorParser(drone_type="Mambo")
TypeError: 'module' object is not callable

Feature requests

GitHub doesn't run a discussion forum so I'm making this "open issue" for anyone to post feature requests to

Could not find some sensor : Bebop2

I am looking for python code for bebop2, and I find your source, thank you.
I tried "demoBebopIndoors.py", but video streaming doesn't work and these comment appears:
"Could not find sensor in list -ignoring for now. Packet infobelow "
(142, 0, 3)
The header_tuple=(134, 0, 3), (134, 0, 4),(144, 0, 2), (144, 0,1) are also appeared,
and one Error comment "Error:tried to parse a bad sensor packet"
I don't know the cause, but sensor_name is none maybe.
However, other commands such as takeoff and land works.

bebopVision.open_video() is not succeed

Hello.
I tried to run "demoBebopVision.py", and the drone connection was OK, but "bebopVision.open_video()" was not succeed.
This problem is similar to the closed Issues "Problem with Vision #15", however no solutions are shown in that Issues.

And ,the error comment are follows:

Opening ffmpeg
ffmpeg -protocol_whitelist "file,rtp,udp" -i C:\Users\Tomoyuki\Desktop\Bebop2\pyparrot-master\utils/bebop.sdp -r 30 image_%03d.png &
starting vision thread
Opening non-blocking readers
timeout - trying again
ffmpeg version N-90054-g474194a8d0 Copyright (c) 2000-2018 the FFmpeg developers

built with gcc 7.2.0 (GCC)

configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth

libavutil 56. 7.101 / 56. 7.101

libavcodec 58. 11.101 / 58. 11.101

libavformat 58. 9.100 / 58. 9.100

libavdevice 58. 1.100 / 58. 1.100

libavfilter 7. 12.100 / 7. 12.100

libswscale 5. 0.101 / 5. 0.101

libswresample 3. 0.101 / 3. 0.101

libpostproc 55. 0.100 / 55. 0.100

[udp @ 000001d7fc73ec40] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)

[udp @ 000001d7fc74f540] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)

timeout - trying again
timeout - trying again
[sdp @ 000001d7fc72a880] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size

Consider increasing the value for the 'analyzeduration' and 'probesize' options

Input #0, sdp, from 'C:\Users\Tomoyuki\Desktop\Bebop2\pyparrot-master\utils/bebop.sdp':

Duration: N/A, bitrate: N/A

Stream #0:0: Video: h264, none, 90k tbr, 90k tbn, 180k tbc

Output #0, image2, to 'image_%03d.png':

Output file #0 does not contain any stream

Having trouble connecting to the camera 1. A reboot of the mambo may help.

How can I connect 2 mambo drone simultaneously with 1 computer using wifi?

In my laptop, I have 2 lan card and connect it to 2 wi-fi sources at same time.
If only one drone is connected (another wi-fi is connected to normal internet), there is no problem running example code. But if 2 different mambo drones are connected to laptop, program said "connection failed: did you remember to connect your machine to the drone's wifi network?" not only when I tried to connect 2 mambo simultaneously but also when I run example file and tried to connect to 1 mambo.

Can I connect to 2 mambo drones simultaneously by one or more python prosseses? I want to use wi-fi because I need to get pictures from each camera.

Problem with Vision

I can't start the DroneVision.open_video.
ffmpeg can't connect to my Bebop 2.

I'm using Archlinux with python 3.6, is it maybe the firmware version of my drone?
The drone is new, so the fw version is 4.4.

How to change streaming resolution of parrot mambo fpv?

The default streaming resolution of mambo is 360p.
I want to change this to 720p.
I tried it by this code but this did not work. :(
I define this function in Mambo class in Mambo.py

def SetResolution(self)
(command_tuple, enum_tuple) = self.command_parser.get_command_tuple_with_enum("minidrone", +"VideoSettings", "VideoResolution", "hd")
return self.drone_connection.send_enum_command_packet_ack(command_tuple, enum_tuple)

I used SetResolution function in demoMamboVision.py
after the function called 'success = mambo.connect(num_retries=3)'
How should I modify the code to change resolution?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.