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]

Published by atomsoft

Starting a small company. Trying to build it from ground up. Only 2 employees so far. Nothing serious yet but soon!

29 thoughts on “3D Movement Using Accelerometer

  1. 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.

  2. 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. 😀

    1. 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)

    1. 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.

      1. 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!

    1. 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.

      1. 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.

      2. 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.

  3. 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?

    1. 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!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: