Raspberry Pi Robotics: Part 1 – Pi controlling the NXT

I’m currently studying an MSc in Computing Science and have been given a super interesting individual project all about robotics to sink my teeth into for the next 3 months.

Welcome to the first of many posts about Raspberry Pi Robotics!

Pi controlling the NXT

My first step is to investigate how the Raspberry Pi integrates with the Lego Mindstorm NXT 2.0 brick. I’ve spotted a few examples of people creating Pi/NXT robots and PiBot is a nice example. The author used nxt-python to communicate between the Pi and the NXT brick, hence that seemed like a good place to start.

by RebeccaAJones

My first Raspberry Pi/NXT robot. by RebeccaAJones

First things first, I got everything to talk to each other, laptop-to-Pi and Pi-to-NXT brick. I’m using a USB wifi dongle to connect the Pi to the network, and am using SSH to log into the Pi from my laptop.

Next I built a differential drive robot (inspired by the NXT Castor Bot) and stacked the Raspberry Pi on top of it.

The lead attached to the robot is the power cable, hence my little robot is tethered at the moment – this is not ideal. Luckily my supervisor is lending me a mobile phone charger power supply, so I’ll connect this up at the end of the week for a truly mobile robot – hoorah!

The video below shows the first program run on my little robot. Yes, I know it looks like the robot is going bananas, however it is actually running one of the example scripts that comes with nxt-python. This script is cnc.py which showcases the support nxt-python has for multi-threaded programs, which is very useful for robotics.

Next steps are to write some of my own scripts and integrate with Lego sensors to build some cooler robots. In the longer term I’ll be investigating other sensors (Arduino, the new Raspberry Pi camera module, etc) and hopefully push the limits on what can be done with robotics using the Pi.

Stay tuned for more Raspberry Pi Robotics fun times!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s