How to learn Drone programming as a beginner?

I think Teal have basically used the Kiss powered sports drone to distract from the fact that they haven’t delivered on the jetson powered drone.
Shifting to ArduPilot would probably help George get the jetson powered drone to market, and allow them to use a common stack across the product line, but let’s wait and see.

I didn’t notice that before. I thought they were using a custom flight stack. Ardupilot on the teal sport will be useless tbh. but on the upcoming teal 2. I can only imagine the possibilities.
Anyway, back to the point. So getting an Arduino kit is the best way to go? Shouldn’t there be something more to it? Shouldn’t I get some books or an online course or anything else like that? If yes could I have some suggestions please :blush: ?

The ArduPilot tutorials are worth a look: http://ardupilot.org/dev/docs/learning-the-ardupilot-codebase.html
particularly if you already have a Pixhawk or similar.
Specifically for learning to code, ArduPilot is C++. Arduino shares some similarities, and is a great entry pathway to embedded coding, but has significant differences too.
A raspberry pi is also a great, cheap platform to launch into embedded coding from, and like arduino has a massive community with examples and support.
What type of thing do you enjoy? The core stability and navigation code requires deep, specialist engineering and mathematical knowledge that isn’t easily self taught. Device drivers, and new modes/functions are less daunting but still challenging and really important.

Thank you, James. Damn, that’s a lot to read. I will surely read it all but slowly. I don’t have a Pixhawk but will be getting one soon.

I think I’ll go with Arduino first and then I’ll move to PI/Beaglebone/Odroid/???.
I am not sure about what I like/enjoy in programming. I am not sure which part of drone programming will interest me. I want to explore. 2 years back I went to a C++ programming language summer course in one of my countries best institutes but the class was really crappy. It sucked and I didn’t learn anything. I lost interest in coding because of that. I enjoy the hardware part more though. I’ll be going to college next year and I guess there I’ll get some exposure and I can learn some stuff. The college that I plan to go to has a team that participates in the AUVSI-SUAS competition every year yet they don’t have a very good obstacle avoidance system. I want to contribute to that and also work on something like this https://www.youtube.com/watch?v=ec1EF2UaQ4U&t=2s. Tealdrone 2 has the hardware but lacks the software and the sensors for this, that’s why I was interested in tealdrone :smiley: .

Something like obstacle avoidance comes under what category? Do I need to have strong mathematical knowledge and specialist engineering?

Sorry for burdening you with so many questions. It’s been a month since I’ve started researching on various autopilot systems and my curiosity keeps increasing every day. Thank you if you’ve come this far.

The reason why object avoidance is in an early state is because it is a hard problem that needs both engineering skills and mathematical skills.

You are picking an hard problem to solve.

You should not be surprised that Physics and Math are very important to flight controller development, either from a coding perspective or hardware design perspective. So either way take as much Physics and Math as you can.

1 Like

@amilcarlucas As someone once said, “If it’s easy it’s no fun.”

@mike Yes, I will take as much physics and maths as I can. Thank you. I am excited :stuck_out_tongue: to learn more and delve into the world of endless possibilities.

I think you need, in the beginning, to separate the subject areas, much like they do in schools until you at least get to an intermediate level. IMO, a Raspberry Pi 3 (RPi), with keyboard, mouse, and monitor, are your least expensive (and maybe the most fun) method of learning the very fundamentals of programming in general. It has a programming tutorial method but it’s aimed at children so might not be fun at first. You will outgrow it quickly. For books, you can’t go wrong learning BASIC for more fundamentals and theory. Use the $35 RPi (plus whatever you want to spend on monitor, mouse, and keyboard) to do the practice sessions for any programming language you would like to learn. After you have a good handle on BASIC, the best programming book, bar none, is “Learning to Program in C,” by Thomas Plum, also known as “The Red Book.” He has a clever way of introducing the new concepts as if you already knew them all along. He moves from the fundamentals to more advanced concepts at a reasonable pace. When you’re comfortable with C, then and only then, move to C++ learning. I submit you can’t learn C++ without knowing C already.
What you desire is quite advanced in physics, mathematics, and programming languages, so it is not a one-stop shop.
If you need background in basic electronics and circuits, Arduino kits are the cheapest and easiest way to get there and are directly applicable to “drone programming.” To help you with learning Arduino, start by getting Visuino ($20/year) to do your graphical programming of circuit setups before jumping headlong into mixing electronics AND programming concepts at the same time.
That’s my advice and is worth every penny you just paid for it.

2 Likes

Hi Nitesh
Alsoif you are going to be interested in the nav/obstacle avoidance field i would suggest learning some good info on Neural Network programming and deep learning as that is the future of autonomous navigation.
2 good intros for that which are free are on Coursera Machine Learning by Andrew Ng and Deep Learning Specialization
Thats my small contribution to your huge but ultimately enjoyable undertaking
Cheers
Al

@skypuppy1 Damn, that was long. I already have a pc so I don’t think I’ll have to buy a raspi+mouse+keyboard to learn or is the raspi going to be used for something else that I don’t understand here?
The learning with Arduino and visuino approach seems to be more appealing tbh. Do I really have to start with BASIC then move to C and then finally to C++? Can’t I directly start with C++? I am asking this because I know a few guys who learnt programming in Python. Thank you though. I feel following your suggestion may take time but will be worth it.

@eye-zen thank you Al. I would definitely look at your suggestion.

Thanks everyone for your suggestions.

Do you think it practical to jump into integrals and derivatives without having first learned algebra and trig?

Haha, good point. I’ll go with BASICS then.
@skypuppy1
PS: I have a question. What exactly is the difference between different programming languages? As per my understanding, the major difference is the syntax. The inherent concepts are almost the same. So what difference does it make if you start with any language? Correct me if I am wrong which I most probably am :wink:

Most of them have the common control flow basics, implemented with varying degrees of finesse. Very few are implemented with adequate data flow concepts. Some are oriented more toward specific tasks and while good at that one type of task, they suck at anything else. So the first thing to do is determine what the goals of a project are, determine the required resources in dollars, time, brainpower, and etc. You’ve identified your current goal as an applications programmer, that of playing with drones. (Whether you get paid for it or not, you’re still playing!) If you’re at the beginning and are unsure which direction you want to take, then take the University approach: learn about languages in general and learn some examples of each problem domain and which tools fit that domain best. Lots of time, but you get laid a lot during school.
Some computer languages are tailored, some are generalized. Your problem domain is identified as zeroing in on drones this time. Ok, that helps narrow your options enormously. Within that domain, you figure out which subdomains exist, then subsequently, which (or all) of those you wish to tackle.
IMO, there are different approaches available. The easiest, by far, is what most have chosen: a general purpose language (like C or C++) along with some subdomain specific languages/tools, like Fourier Transforms, sensor fusion, and image recognition and processing, for decoding live data sensors (navigation, obstacle avoidance, etc.)
Each language and sadly, each version of a language, has it’s own syntax variants. Between languages, syntax varies WILDLY. Some low level languages (2nd generation) like assembler, are time and head-space intensive. 3rd gen languages, like C, BASIC, Ruby, Lisp, require less time and are less head-space intensive because you can think (and program) on a higher level because all the drudge work is already built into the language. 4th and 5th gen languages are on the horizon (a few are already well developed) but aren’t popular due to the enormous learning curve required. Long learning time, but short programming time while requiring intense head-space effort during that time. Some 6th gen’s are on the horizon that are coupled with AI but they’re still in the labs at this point. AI still has a L-O-N-G way to go for this purpose.

If you want to see some extreme examples of syntax and capability, spend a little time looking at assembler, BASIC, Lisp, C, and SQL. Once you get over the headaches, you’ll understand better.

But then, I really don’t know what I’m talking about, Nitesh.

Thank you so much, David.
As far as I know, SQL is used for database management, C is used for embedded systems programming, C++ is used for game development and other stuff and Python is used for machine learning and web development (both of them seem completely different things Lol). As you’ve told about the university approach, I think what I know what I want to do. I’ll learn a non-OOPS based language first like C and then I’ll also learn an OOPS based language like C++ or Python. Also with a little research, I found that C is the preferred language for interacting with drivers and Python is the preferred language for working with Linux and machine learning, all of which I might be needing in the future.
I was thinking about starting this course on edx this. Is it any good?

Thank you so much for spoonfeeding me all the info needed.

SQL is used in databases, but is one of the most horrible “languages” out there. Still, it is what most people know and use, sadly. For machine learning, you want a compiled language as ML is already so slow. Python is good at some things like string handling but as far as I know, doesn’t have a compiled version. Edx, when it even works, is like most things: it has some great courses and some crappy courses.

learning to use Github I got the basics like fork fetch and clone navigating in the PX4 shell, All seems well I see the directories.

After I CD to the local directory called “firmware” from the docs I used this command.: "Git make px4fmu-v2_default "

the shell seems to be in a hold status no text after the command I see the "> " in the shell. How long does it take to compile? I am running Windows do I need to use Linux to compile or will the git shell be ok?

You’re following the wrong instructions…
Try http://ardupilot.org/dev/docs/building-px4-with-make.html
You need to be in the ArduPilot vehicle directory (copter/plane etc), and use the correct make command for your board.
Much better to use waf though, so perhaps consider setting up a Linux VM.

Hi James, Thank you so much for the pointers I going to setup a Linux VM is that better than a usb boot to ubuntu option?

I haven’t tried working off a live USB.
I’ll try to have a look, but not likely today: out at the flying field :slight_smile:

Regards,

James