PyCon 2014

Programando un dirigible autónomo con Python

Scott Lobdell  · 

Presentación

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

now see thank you for joining us I'd like to take a moment to introduce Scott Lobdell he's a software engineer at hearsay social who's recently left the army is going to talk about this big blimp here so give it up Jeremiah how much did you tie

this thing so this is a presentation about blimps so I did want to get to start it off right so bear with me which is one moment please all right it's not hydrogen though so that was good as going to hell it was going to be really awesome anyway it just

a little bit about me my name is Scott Lobdell left the army I work for hearsay social now I do have some resources for this talk I did present or I have them post it at the end of the slide show but otherwise if you just follow me on Twitter I have the resources

posted online you can follow along if you want if I can also just put in a brief plug hearsay social is going to be hosting the blimp after party the deer jepara if you will directly after this at the the Wesen in the reserved room right a lot of big names

going to be there akshay Shah is going to be there for any fans of him and his work so without further ado let me just go ahead and get into the blimp here so what this is is the semi-autonomous blimp so the idea is that I can instead of piloting this thing

directly I can click way points on a map the blimp will navigate to my own goal for this was to do aerial photography so the idea behind this here is that if any of you want to replicate any or all of this project this should give you enough resources to get

started and to avoid some of the same pitfalls that I had so the overall architecture that we have here is we have a laptop that has a client application that's in Python everything is in Python and even wearing python skin boots no big deal so we've

got an xbox remote it's wired to a laptop that we can control that xbox remote sends commands that are that are encoded into specialized bike commands that I wrote they're sent across the wire wireless XP connection which I'll get into that then

connects to the onboard controller here in blimp which is actually a full-blown computer running a bun to 10 for that in turn sends commands to the rotor so with any basic aircraft I know Ned just had a previous talk about helicopters but your basic controls

are pitch roll and yaw so pitch of course controls the nose of the aircraft roll is going to be your side to side and then y'all is going to be your your compass azmuth here so if we have a blimp then we have those same controls and we just manipulate

pitch rolling you on different manners so for pitch we essentially manipulate the tail the tail elevator to to apply force as a result of the win then we can also manipulate the thrust vector on the gondola to control the direction of the rotors as far as

role goes blimp is a blimp is naturally it has a very center a very heavy center of gravity so it's going to naturally roll to your your normal position so you really only need to worry about pitch and yaw then of course with y'all you could just control

the tail rudder and then you can go left or right so the idea behind the autopilot algorithm or how this goes about working is I only care about pitching y'all so I have I need to establish a target pitch in a target y'all so the target pitch is established

based on your current altitude and your target altitude and that tells you whether you want to pitch up or down and then for y'all you have your current azmuth and then you have your target azmuth which is based on gps coordinates so with both of those

things you can easily determine do I need to go up or down do I need to turn left or right so from there you have the intensity of how hard you want to turn or how hard you want to pitch and that's based on the differential between those two so it's

directly proportional to the relative to relative distance between those two things alright so here's the overall start software architecture behind what we have so we have a controller which is responsible for managing all of these different asynchronous

tasks and I just say task because I actually use G event here so this isn't a talk about G event but G event itself is emulated threat emulated multi-threading so it's not actually multi-threaded you have what's called green let's hear here

and so how this works is essentially you spawn multiple green 'let's and as soon as you create those there kicked off asynchronously and once you get down to that joint all that's going to block until each of those different green 'let's

finishes its task so in this case case each one of those individual green 'let's was an infinite loop so it didn't have to do that we can also do monkey patching which will take anything that naturally blocks so in this case we have a serial connection

for example so anytime anything is blocking it's going to immediately yield to another thread so that's also going to make it when we do time dot sleep so if you even in that bottom bottom example we have the sample green lit and that's the basic

structure of every single green lit that we have we're going to do something we're going to do a little thing and then we're going to sleep which is going to yield to the other threads and then once that sleeping is complete it's going to be

reactivated alright so the very first thing we have to do is we had to read from sensors so the the sensors themselves had sample code written in C++ and that's really the easiest way to interface with them so the basic premise behind what I did is I took

the things that I had to write in C++ so the things that needed to be particularly fast and then I bubbled up the high-level abstractions to python and then with Python it's very easy to kind of create an autopilot algorithm here so again this is going

to talk about boosts either but here's the basic premise we have a we have some things that we want to do in C++ and then we want to create a manager class for those different things and then we want to surface some of those functions up to python so here

[ ... ]

Nota: se han omitido las otras 3.097 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.