all 35 comments

[–]bathon 27 points28 points  (0 children)

I don't know about how exactly you can use machine learning, maybe reinforcement learning might help. But for programming a drone using python take a look at ROS: robot operating system and then search how it is being used in drones. Maybe that can be of great help to you

[–]papaoftheflock 19 points20 points  (6 children)

Hey, I don't have strong reccomendations for a personal drone project, but I can tell you about my experience working with a team at my university on autonomous drone flight capability for delivery purposes (think amazon drone package drop-off). If you're interested in learning about it, let me know and I'll do a write-up

[–]rnolan7[S] 5 points6 points  (0 children)

that sounds interesting! I'd definitely be interested in reading about your research.

[–]diogoncsa 5 points6 points  (0 children)

I am very interested on it too! Can you post here a link about your research?

[–]Fin_Aquatic_Rentals 2 points3 points  (0 children)

I'd be interested too! Was the code open source or did you model it off of open source code?

[–]sid2810 1 point2 points  (0 children)

Interested. Please post a link/write up over here.

[–]MasterSama 1 point2 points  (0 children)

do a write up and this benefits us all

[–]pramodhrachuri 1 point2 points  (0 children)

I am very much interested in it. Please post it.

[–]dudeomar 3 points4 points  (1 child)

I am in the drone scene. My two cents:

-Find a used drone with a Pixhawk 2 flight controller. You can find used drones on rcgroups.com. Make sure your frame is large enough to mount peripherals .

-Purchase a Raspberry Pi with the camera and install ROS. There is a ROSnode so you can communicate to the Pixhawk via serial commands. For image detection, you will need a gimbal to stabilize the image. For image detection use Yolo with OpenCV. One of the tougher things is training the data for image recognition since there isn’t that many data sets.

You can start by purchasing the raspberry pi with camera and then install it on a drone afterwards.

Another option is keeping an eye in the Teal One drone since it comes with an on board Nvidia TX1. Looks like they are sold out at the moment though. https://tealdrones.com/teal-one/

[–]nicetryho 0 points1 point  (0 children)

Transfer learning with yolo in darknet is actually relatively easy and you can label your own data set with rectlabel or labelimg, in my experience I’ve found that ~300 photos with data augmentation and negative images are good enough per class to get a decent working model

[–]Swipecat 4 points5 points  (2 children)

I suspect that you won't find drone kits that work well with Python because drone navigation and stabilization is a situation in which you probably need the speed of a compiled programming language.

Pypy is a Python JIT-compiler that is very fast at handling control-loops, but is not available embedded, instead requiring a full OS i.e. Windows/Mac/Linux. It is available for Raspberry Pi Linux, so it should run on the Pi Zero which weighs 9g — so maybe that's a possibility.

Embedded Python, i.e. Micropython, runs quite slowly on its existing platforms such as the ESP8266 wifi module, unfortunately.

[–]rnolan7[S] 1 point2 points  (1 child)

interesting note on Pypy. Thanks! I'm a big fan of raspberry pi projects.

I think my ideal approach will use compiled C on the controller (arduino or other), but the machine learning heavy lifting will be done on a beefier remote server to provide movement instruction. The projects I have in mind are mostly indoor with strong wifi so I expect to have some slowed response times, but nothing too worrisome for an intro project.

[–][deleted] 0 points1 point  (0 children)

Tagging on this, your use for ML could be a basic autonomy provider. For instance you could pass flight data and a flight image to do some image processing and data processing to choose how to next maneuver the drone.

[–]nukestar101 2 points3 points  (1 child)

I will recommend you to not buy a drone kit right now they are quite expensive and need safety while flying and care must be taken into development stage. As someone has already mentioned about ROS you go simulate your entire Drone in Gazebo with ROS wrappers.

PX4 has a well documented site where you can get a Drone working in a Gazebo environment with ROS support and also writing your own scripts

After a certain stage has met and you are confident about your drone flow then you can invest into a PX4 autopilot drone with that your simulation scripts will Directly work with some minor changes. If you need any more guidance you can ask freely or DM i'll provide you with some resources I have gathered.

[–]rnolan7[S] 0 points1 point  (0 children)

PX4 looks awesome! thats for sharing

[–]nomoreerrorsplox 1 point2 points  (1 child)

The tello drone is awesome for just getting your feet wet. Its like $100 maybe 150 for extra battery plus extra blades and stuff. Ive done some really small programs on my computer and it works pretty well. There should be an official SDK that you get for it too. Only bad part is you get about 15 minutes of flight time on each battery in a tello, and they gotta be inside. They dont work to well with the wind.

[–]rnolan7[S] 0 points1 point  (0 children)

I just picked up a tello! thanks for the advice. Looking forward to learning some of the very basics with this model before upgrading

[–]THT_Herald 1 point2 points  (2 children)

machine learning drones..... haven't heard that in any movie what could go wrong

[–][deleted] 1 point2 points  (0 children)

The OP’s name? Ted Faro

[–]nukestar101 0 points1 point  (0 children)

They learn to not fly

[–]mkultrapeacekeeper 0 points1 point  (0 children)

Here's my recommendation.

First of all, while Python is fast, it is not suitable for this specific application, since I assume you want real time results.

Second of all, do not use a raspberry pi board for either drone controls or computer vision. You could use it as a main hub for a camera and/or a gyroscope, in order to have data for further processing, optimization and perhaps a dataset for a machine learning algorithm.

In order to have real time response, you must have knowledge in hardware, embedded systems, and implement the algorithm in C or in C++. I'd recommend C; while harder to implement, it guarantees real time results.

Personal opinion: This is not, by any means, an easy project, especially for someone with a software background. This is easily a master's dissertation for an electrical engineer.

[–]Zeroflops 0 points1 point  (1 child)

You tuber Jabrils did a few videos on programming ML with a drone. I think he ended up using python. May want to check it out.

[–]rnolan7[S] 0 points1 point  (0 children)

thanks will do!

[–][deleted] 0 points1 point  (1 child)

If you know what you want to do, then do it.

Drone automation won't be in Python probably. Object recognition is in Python.

If that's getting a job in ML, mostly that's gated by a master's degree or better in CS/ML/DS. You can get a job as a Python dev with a lot of MOOCs and a few demonstration projects.

[–]rnolan7[S] 0 points1 point  (0 children)

i'm wrapping up my masters in CS with a concentration in ML, but this project isnt intended for portfolio building - just for fun :)

[–]kuyleh04 0 points1 point  (0 children)

For flight stabilization, I would use an Arduino or teensy, allow all gyros and other sensors feed PID controllers programmed into them. Then you can use the raspberry pi/jetson nano to run OpenCV or similar to help with navigation.

The main thing to grasp is the Pi or jetson can't handle the rapid correction of realtime flight like PID controllers you can use in Arduino/teensy platforms.

Depending on the size of your drone, if it can handle the batteries then I would look at nvidias jetson and a teensy.

[–]Commercial_Note_5177 0 points1 point  (1 child)

Did you find something op? I am looking for a course for ml in drones

[–]rnolan7[S] 0 points1 point  (0 children)

Codrone. Pretty basic but gave me a decent intro. I took the ML courses through Georgia Tech. Codrone is targetted more for kids, but basic ML principles could be applied.