Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
so i have this plan to build a semiautonomous UAV; the physical airplane part is easy enough but i want to stuff it with the guts of an old phone so i can preprogram it with GPS coordinates that it will fly to

also using the accelerometers in the phone for inertial navigation to supplement the GPS is a thing that would be cool to do

could i just use a rooted android phone? how easy would it be to get it to talk to an arduino or something through the USB port so that it could control the plane?

Adbot
ADBOT LOVES YOU

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
but you could do the same with a regular old model airplane

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

Bloody posted:

usb sucks to work with, phone accelerometers should be called isthephoneupsidedownornoters and are pretty much useless beyond that so good luck getting useful ins done with them, also phone gps is pretty crappy even by gps standards so just even more lol

im basically just here to poo poo on your dreams, sorry

realistically you could do it okay with a gps receiver from sparkfun which has the added bonus of not androiding your battery life, working well with an arduino, and being at least decently accurate. still won't be able to land but for flying to some coordinate position itll do okay until it's close.

no i definitely want to hear what parts of my plan aren't realistic, so it's good to know

what about standalone 3-axis accelerometer modules? or are these super expensive or something.

also if the dead reckoning navigation is good enough then you could probably get away with only turning on the gps every once in a while for course corrections, although this would probably only work if there's a negligible amount of wind. re: battery life, i'd like to have the phone or whatever running off the plane's battery where it'd be a small draw compared to the motor and servos anyway. i just thought it'd be easier to have all the avionics in a single package. but idk really about this sort of thing


uG posted:

i thought UAVs that could fly from point A to point B without any human input (after takeoff) were illegal for potential future terrorists aka civilians?

is this true in canada too? i mean it's not like i'm trying to build a cruise missile here; the most dangerous thing i'd strap to it is a gopro camera

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
huh so it's legal for me to fly a model airplane over someone's farm fields for fun, but the moment that i perform the very same flight to inspect the fields in order to improve crop yield it's illegal

laws are weird

i wonder what it takes to get that certificate? i guarantee that natural resources companies would want to use the hell out of UAVs for looking at pipelines or forests or whatever

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
in any case it looks like they don't make any distinction between a piloted or autonomous thing so long as it's recreational, so i guess i can go hog wild with my fly-to-gps-coordinates model plane

e: ^^^^^^^^^^ thanks

i'm looking at the transport canada site right now

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

Bloody posted:

it depends on how much you wanna do yourself and how much you wanna spend but you can buy pretty heavily integrated avionics packages that'll do lots of sweet poo poo for you like poo poo on this page https://www.sparkfun.com/categories/160 which'll integrate accels and gyros and they probably won't suck as much as phone accels

the thing with MEMS accelerometers and gyros is that you pretty much always get what you pay for. the ones in phones are basically the cheapest you can get that still function, since pretty much their only use is "which direction is down relative to the screen". cheap accels are fine if you just want to know instantaneous acceleration, but once you start integrating for velocity and displacement the errors start adding up hilariously quickly. realistically though you're not going to be able to buy good enough accels for decent position data longer than half an hour or so and that's only if you're shelling out thousands. idk much about UAVs though last time i was loving around with GPS and inertial navigation was on a boat, and GPS was more than adequate for our needs. we used one of these receivers and it put our boat within a couple feet of our target pretty reliably: https://www.sparkfun.com/products/465 as an added bonus they're dead simple to use. ive actually got atmega C code around here somewhere for talking to one, although there's almost certainly a more integrated arduino solution.

drat this poo poo is cheap as balls; i had no idea. i was kind of figuring on spending like several hundred dollars on electronic components. gotta love technology. (and here i was thinking that i was going to save money by using a phone, instead of a raspberry pi or something with a couple of boards strapped to it)

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
Global Proprioception System

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
https://www.youtube.com/watch?v=MkUPG0tS4YU

just another thing that only the rich and famous can get :(

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
Motor drivers are surprisingly simple to build and you get to learn about diodes and such

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

WorkingPeer posted:

i know i'm an idiot but whats the advantage of using a driver versus just plugging it straight into the dc? everyone i've seen make this thing has just wired it up to the wall wart. :confused:

For the amperage you'll be using it probably doesn't matter too much, it can just be hard on the little rectifier stuff in the adapter. Solder a capacitor across the motor terminals and you'll be good.

Mainly it would just be a good learning experience and start you on the path to more complex drivers that can reverse and do PWM and poo poo

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
My idiot spare time project: finally figuring out how to do graphics with Python and then doing the simplest poo poo i can think of in it, apparently

fractals!





conway's game of life!



langton's ant!



yeah i know i'm really breaking new ground here

i also wrote a thing for doing anti-aliased lines but then realized pygame already had one

oh well

ol qwerty bastard fucked around with this message at 18:18 on Aug 16, 2013

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
this one is a rose or maybe the female reproductive system iunno



yeah i'll probably get around to making a github account at some point

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
okay i've cleaned up the code so it's not as dreadfully embarrassing as it was

https://github.com/kyle90/mandelbort/blob/master/Mandel.py

that'll generate a mandelbrot fractal; it doesn't do much else but i'm working on some 2-D math stuff so i can make something that can use other polynomials. vector arithmetic is tedious.

https://github.com/kyle90/simple-conway/blob/master/Conway.py

game of life yay

includes some kind of stupid functions that i can't be arsed to rewrite. just wait until you see how i'm drawing a square on the screen

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
more python graphics stuff:

i modified the langton's ant algorithm so that the trail would fade slowly, which was interesting but it always still ended up in the same pattern

so then i added random cell activations to disrupt that



i call it "ant in a rainstorm"

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
hm okay clearly my ball collision algorithm needs work



i hate vector math

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

coffeetable posted:

i like your version of physics. it's more fun.

(by any chance did you design it so collision boundaries strongly repel eachother? because then if two boundaries are found to be intersecting at the end of a time step, the repulsion would force one ball into the other)

it's supposed to detect when the distance is less than (r1+r2) and then apply a force to each based on their velocities and masses

but i'm getting some weird negative numbers in a place that should only have positive numbers (i.e. under a square root) and i don't know if it's because i hosed up somewhere or because floating point handling in python is apparently lovely

this would be a lot easier if i just said that both balls have the same mass and made the system symmetrical but that's kind of boring

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
hah it totally was just a sign that i had flipped, and also i'd forgotten to divide by 2 when figuring out the kinetic energy so it was doubling in energy upon every collision

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
yessssssss

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
looks cool if you add gravitational attraction between the two balls and then plot the paths too



awww yeahh sexy patterns

e:

ol qwerty bastard fucked around with this message at 21:21 on Aug 21, 2013

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
yeah i'm not understanding that equation either, but it looks like the slowing down might be caused by the accleration being applied in the wrong direction?

like if your acceleration is +1 in the x-direction, or whatever, and your speed is 5, then the speed would become 6

but then if you bounce off a wall or something so your speed is -5, then the speed would become -4 if you just added an acceleration onto it, which then actually slows it down

i dunno though i'd have to see more of the code

anyway i managed to get my collision thing working so that it doesn't sometimes randomly vastly increase the speed of one of the balls (and crash the program), and also so that multiple balls could all collide with each other and be gravitationally attracted to each other



so now they clump together which is kind of cool (i put in a bit of friction too so the energy would dissipate)

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
gooncam to capture it and then photoshop to crop/resize/save for web/etc

it's pretty tedious (especially with several hundred frames, which slows my computer to a crawl) and one of these days i'm going to look up how to make it output to a series of bitmap files instead of the screen so that i can just string them together into a gif

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

coffeetable posted:

see if you can simulate the Theia impact :v:

my planet keeps shattering :(

need to add damping i think, it's just too rigid

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
big ol' collision experiment:



i let it clump together for a while and then fire an "asteroid" at it, which destroys everything

(also holy crap it's simple as poo poo to make python output frames as files, i could have saved so much time)

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
this week's project: same as last week, but now in THREETHREETHREEDEEDEEDEE


so far i've got lighting figured out; holy hell it takes a long time to light a sphere though. basically doing the vector math at each point on its surface to figure out the intensity (dot product of the normal vector with the unit vector pointing at the light source)

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
oh i'm sure i could do like

code:
import 3d

ball=([320,240,0],[127,127,255],80)
light = [500,500,500]

3d.drawlitball(ball,light)
and be done but yeah i'm doing it to learn mainly

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
i imagine there are some significant speedups that i could do, mainly in the areas of simplifying the trig functions and making sure each pixel within the defined area is only called once

oh and that pixels on the other side of the ball from the light source aren't touched

right now it calls a trig function five times per pixel which is definitely way overkill

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

echinopsis posted:

i respect it


are you using an accepted falloff algorithm or just normal directions?

not sure exactly what you mean but i'm first calculating the intensity of light hitting a point as (some constant)/(distance from point to light source)2 and then multiplying that by the dot product of the surface normal (unit) vector and the unit vector from the point to the light source to get the actual brightness of the point

(then the point gets drawn as just its x and y coordinates; i'll mess around with depth and visual field and camera angles and poo poo later)

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
my problem with programming is i get sidetracked a lot

FOR EXAMPLE i thought "man, my lit sphere thing looks like a planet's day/night cycle, i wonder if i could make it look more like a planet by putting clouds on it"

and then "the clouds should evolve with time, though, and look realistic; i wonder how hard it is to do 2-D CFD on the surface of a sphere"

so now i'm bashing together a silly little fluid mechanics program; right now it's only going on a regular 2-D plane but it's interesting watching it evolve:



(red is x-velocity, blue is y-velocity at each point)

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
i dunno if i'll do anything substantially more interesting with 3d stuff but i'll probably look into opengl and such if i do

this is definitely just a learning exercise for me; there's nothing practical about it at all

(yeah i'm still using pygame for these things)

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
final thing for tonight: made the ball bounce around in 3d space with a light just off to the right of the screen



tomorrow perhaps... two balls! i already wrote the collision algorithm from my bouncysticky 2d ball program to work in 3d so that should be straightforward; harder will be getting the balls to cast shadows on each other

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
still writing my vector function library



oh my god vectors suck so much

but at least when i've got all these basic functions, i can just call them when i'm doing 3d stuff and i don't have to think about angles and cosines and all that bullshit

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
so i'm still kind of trying to simulate planetary cloud bands

i'm getting some interesting results anyway



ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
i went back to my cloud whatever simulator thing and rewrote it using actual navier-stokes this time :pcgaming:
now it gets turbulent flow (that currently builds up and makes it go all hosed eventually because i haven't written any sort of proper planet-spin-is-imparting-momentum-to-atmosphere stuff, i'm just naively adding some constant to the x-component of the vector so it goes out of control, but for now it looks pretty cool and that's what i was trying to accomplish)


how do u make youtube not turn your pixel-perfect simulation output into a lovely blurry mess

https://www.youtube.com/watch?v=AcfzPZwxu80

the red is supposed to be little vectors showing wind direction but instead they are blobs and streaks

for example here is what one of the frames is supposed to look like:

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
i changed the colour of the vectors in hopes that something else would compress better than red (gently caress red forever) and rendered a 1080p version which looks a bit better

https://www.youtube.com/watch?v=mUJQnR1_oNU

i'm still playing around with the acceleration thing

eventually i'll stop using a cylinder and use something actually shaped like a planet

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
i have a personal policy where i try to understand all the technology that i use, at least on a somewhat general level, because i don't want to be useless after civilization falls and more importantly because i think poo poo is cool and i like to learn about it. i know there's way more to learn about than any one person could ever do in their lifetime but i just don't want anything to be a magic black box to me the way computers and phones and car engines seem to be to some other people

i don't know where i'm going with this but don't just look at things in terms of "hm if modern society were wiped out, how useful would this be?"; because every single skill that you can learn is going to be in the context of society as it exists now and if you're going to prepare for a postapocalyptic future you might as well dig yourself a bunker and hole up in it with a year's worth of canned food and ten thousand rounds of ammunition

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
I bought a book on blacksmithing because it seems cool.

If it were 200 years ago I'd totally be a blacksmith.

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

my stepdads beer posted:

wat about your puny frame and arms

Lol

Im 6'2" and pretty much all my jobs are manual labour

Not worried about being able to swing a hammer

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

Smythe posted:

have u actually seen a blacksmith irl ?

Yeah

Grew up on a farm and the guy who shoed our horses made the shoes himself in his forge

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
i'm actually halfway through guns, germs, and steel right now; i had watched the pbs documentary version of it but never read it before

it's interesting if a bit dry and dated; is there a followup book that i should read after?

Adbot
ADBOT LOVES YOU

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
poo poo remember when i was talking about maybe building some sort of drone with an autopilot thingy on it

why would i even bother trying to rig up my own control system when this exists

http://www.wired.com/wiredenterprise/2013/08/drone-autopilot/

quote:


Size: 20mm x 20mm x 5mm (0.787" x 0.787" x 0.197")
Weight: 2.8g (0.1oz)

Features

72MHz 32bit ARM Cortex M3 MCU with 16KB RAM and 512KB Flash
Combined 3 Axis Gyroscope and 3 Axis Accelerometer
3 Axis Magnetometer
Barometer (Altimeter)
Onboard U-Blox GPS

drat son

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply