3D Movement Using Accelerometer
Hey everyone, in a recent post i showed you my accelerometer code i have and a demo… i got so bored i figured id learn some 3D programming to use with this…
The easiest way i found was to use a 3D Engine that was premade and FREE!!! heh i stumbled across Panda3D from google…
Its a great tool but no good tutorials really… Also it was mainly for Python which is a programming language mainly for linux…
Ok i found out they also have a windows version …
Now my goal was to use this 3D engine which would involve me learning Python…
I installed python and Panda3D then PySerial which is a serial module for python. Then i had to learn how to intertwine all of these… Here is my script. Its no way a professional thing but it works.
[Download]
Python is not just for Linux users. Plenty of Windoze users and other people program in Python.
It’s trivially easy to learn anyway. You already know most of it, since it’s so C-like (all high level languages these days are). The only trick to Python is that proper indentation is part of the syntax – it doesn’t allow sloppiness.
Once you know Python you pretty much know Ruby as well – they’re real similar.
cool heh… syntax did kill me at first
So Jason… When are you going to build that balancing robot? All you need now is a gyro, motor controller and motors/wheels.
I gave up temporarily – math was too much for my little brain. 😀
haha i doubt id be able to do that for a long time… if you got a little brain mines is still in the sack swimming (if you know what i mean heh) I would love to play with a gyro tho… can you recommend me a place to buy what i need to get started? mostly like the motor and wheels and such… i can buy a gyro from mouser easy … (I think)
The Analog Devices ADXRS150 that Sparkfun sells on a breakout board (SEN-09059) is super easy to use and works great. Cheap too (lots cheaper now than when I bought mine).
http://www.sparkfun.com/products/9059
Motors and wheels and stuff… There’s tons of places. Here’s a few Canadian ones first:
http://www.hvwtech.com
http://solarbotics.com/
http://www.robotshop.ca/
USA stores:
http://www.budgetrobotics.com/
http://www.trossenrobotics.com
http://www.lynxmotion.com
http://www.pololu.com
sparkfun.com
and many, many more. 😀
Hey futz i know very little about gyros… is ±150°/sec better than ±100°/sec
I forget. Gyros measure rate of change – accelerometers measure amount of change. 150/sec is probably more sensitive?
Sparkfun has a buyers guide for you – http://www.sparkfun.com/tutorials/167
I don’t think one or the other is “better” anyway, more like what range of rate of angle change do you want to measure? Whichever one suits what you’re doing best is best for you.
Same thing for accelerometers – different G ratings don’t make one better than the other. They’re just different ranges of measurement.
ahh ok cool… $24 isnt cheap to me heh i see some on Mouser for $7 like:
http://www.mouser.com/ProductDetail/STMicroelectronics/LY550ALH/?qs=sGAEpiMZZMskzhF9uAtig0PaRHy2pb49RgJygMfQD3E%3d
which is ±500 °/s
and a dual axis pitch and roll ±500°/s analog gyroscope
http://www.mouser.com/ProductDetail/STMicroelectronics/LPR550AL/?qs=sGAEpiMZZMskzhF9uAtig0PaRHy2pb498TLxOm%252bUUZ0%3d
I guess ill have to read that sparkfun page… thanks
That $7 one may be a bare, unbuffered chip. Might be difficult to interface (and solder). The more expensive one is dead simple to use.
Did you get my motors & wheels reply? It’s gone!
Hey Sparkfun has the LPR530AL, i can simply copy there schematic to use it heh
and only cost me $7+s/h since i have the boards and toner heh…
http://www.sparkfun.com/products/9990
There ya go. Doo eet! Be sure to post your project here with lots of pics! 😀
I just ordered an Arduino Uno. Decided I better have a look at the latest ultra-popular newb hardware. Even if I don’t end up using it with the Arduino software it’s still a nice MCU and a nice board, with lots of nice shield boards available for it.
yeah.. i was going to make a PIC version but decided why… and quit on it heh.. arm has one also.. the only thing i hate about arm is the JTAG… so many wires heh.. i was thinking of just placing pads and having the resistors and ect off board.
There’s a PIC version already available, and another one… can’t remember… might have been an ARM version. Saw it the other day while surfing around.
cool.. I need to get into 100pin ARMs heh…
I remembered finally! What I was thinking of was the Esduino, which is Arduino compatible with a Freescale 9S12C microcontroller.
http://www.technologicalarts.ca/catalog/product_info.php?cPath=164&products_id=567&osCsid=ea46c0cb7eb8e025aba181beb96f3112
cool! heh
i got the wheel one it was in spam since it had so many links heh
Awesome links!!
OK quick question… which is best to use..for the movement of robot? stepper or DC motor?
I was thinking about making a walking robot.. would be fun. I think i would only need servos then if i do correct?
Steppers are slow wimpy gutless useless for robots. DC gear motors (with encoders (home made is fine)) are the way to go.. Solarbotics has a whole line of white gearmotors in different torque and speed combinations – http://solarbotics.com/motors_accessories/gear_motors/. You can probably find those in the States too.
A real walker (dynamic balance)? Or just a big-foot walker? Dynamic is HARD. Big-foot is easy. Parallax used to have some, but they seem to be gone now. There’s lots of fancy (EXPENSIVE) bots available now, like the Bioloid – http://www.crustcrawler.com/products/bioloid/index.php
A fully loaded bot like that will run ya like $1000 or better. They’re very cool, but I haven’t shelled out the dough yet. Go to Youtube and watch the Japanese compete with them – awesome!
sorry about late delay damn wordpress didnt email me heh
Yeah a real walker. I want to make my own type of mechassault type walker
http://xbox.ign.com/dor/objects/655496/mechassault-2-lone-wolf/images/mechassault-2-lone-wolf-20041221033711929.html
I want it to shoot nurf bullets like this…
http://walyou.com/nerf-toys-vulcan-automatic-heavy-blaster/
I would of course paint it dark grey/black with a red/orange muzzle so police wont shoot me heh
For instance – http://www.youtube.com/watch?v=ufOz00oYzZM
awesome heh in 10years ill make this:
Aren’t those cool? I’ve been waiting for decades (since I was a kid – I’ve been a science fiction reader/collector forever) for those things to get made.
Have you seen Boston Dynamics’ “Big Dog”? Very cool robot.
http://www.youtube.com/results?search_query=big+dog+boston+dynamics&aq=0
Oh ya, look up Boston Dynamics “LittleDog” as well.
Awesome i was also looking at:
Man, is there something you cannot do 😀
🙂 Thanks, i try to do what every i can sink my brain into heh