Showing posts with label mindstorms. Show all posts
Showing posts with label mindstorms. Show all posts

Wednesday, January 10, 2007

Introducing nxtsh - the command line interface to our favorite brick

First of all happy new year to everyone here. A lot of my christmas vacation was spent on making a shell that allows for easy file manipulation on the NXT brick from linux. My other computer is a linux machine, and I want to be able to use that when my wife wants to use the mac.

So I dug up Douglas P. Laus excellent NXT_Python module that does everything you need in terms of managing files on the brick, and then I added a shell on top. You can find it here: http://www.danbbs.dk/~kibria/nxt/nxtsh.py.

A couple of notes:
  • You need the NXT_Python package, and you need the packages that NXT_Python requires. You can find these at Douglas' page.
  • The pyusb link on Douglas' page seems broken - use the SourceForge page instead if you have problems
  • This can as far as I can see only run as root when using USB due to a restriction in the pyusb module used by NXT_Python.
If you find this useful or have suggestions, drop me a note. I might update this further (command completion and readline support springs to mind), but I made it so I could play with nbc, so don't hold your breath.

Monday, December 25, 2006

Catchy Robot


I just got my NXT LEGO set, and I had to challenge the system and myself a bit, so I set out to create a version of the tribot that could catch balls. That was challenging in several ways:

  • The robot had to detect that the ball was approaching (and at what speed). I solved that by tilting the ultrasonic sensor, and then sample the distance to the ball twice with a 100 ms interval after it came withing 50 cm. That way I could get a quite reliable estimate at the speed, and hence when the claws should close.
  • The robot had to know wether it caught the ball, so that it would only return if it actually had something to return with. I solved that by installing a bar over the claws that gets pushed up by the ball when the 'bot catches it. It triggers a small lever to push the push button sensor when the wheels and axels turn.
  • The original tribot actually twists quite a bit in the construction, so the "ball detector" didn't work reliably until I reinforced it, so that the claws ended up the same place each time it caught the ball.
I think in all it came out quite well. You can see a movie of the bot here:

http://www.youtube.com/watch?v=w2n24bk81iQ