Pi powered Panobot v1

I have just finshed work on version 1 of my Pi powered Panobot. It is a robot designed to take panoramas with the official raspberry pi camera board.

It is built out of lego and uses the same motors and motor controller as my Lego Pibot.

It runs a python script which allows me to program how wide a panorama I want and how many levels. Once the images are taken I copy them over to my laptop and stitch them together into one image using Hugin http://hugin.sourceforge.net/

The Pi camera is very good for its price but compared to my DSLR has a smaller dynamic range and also a smaller HFOV (Horizontal Field Of View) so to get a panorama, it requires a few more pictures. I found to allow enough overlap that 10 pictures wide was sufficient by 3 pictures tall. This totaled to 30 pictures per panorama compared to my normal 25 pictures for my DSLR. I have to stitch them on my laptop instead of the pi due to massive amount of processing power to find the control points

So, time for some pictures

The panobot on a hedge taking some pictures
The panobot on a hedge taking some pictures
A closer look inside the panobot
A closer look inside the panobot

Now for what you have been waiting for, what images does it produce?

180 Degree panorama

A full 360 degree panorama shot with the Raspberry Pi camera board
A full 360 degree panorama shot with the Raspberry Pi camera board

For the full sized panobot panorama click here as wordpress limits the upload size

A panorama taken from the same area with my DSLR (Canon 600d)
A panorama taken from the same area with my DSLR (Canon 600d)

For the full sized DSLR panorama click here as wordpress limits the upload size

280 degree panorama taken in the evening before batteries died
280 degree panorama taken in the evening before batteries died

For the full sized  panorama click here as wordpress limits the upload size

Full 360 degree panorama made up of just 30 pictures!
Full 360 degree panorama made up of just 30 pictures!

For the full sized  panorama click here as wordpress limits the upload size

For the full sized  panorama click here as wordpress limits the upload size

 

As you can see, there really isn’t much in it between the DSLR and the Raspberry Pi Panobot. There is two thing though to take into account though.

Time

The Panobot takes around 2 mins to complete a full panorama

Using the DSLR I took the example panorama in under 30 seconds

Stitching

Because of the larger HFOV on my 28mm lens on my DSLR, I only took 24 photos for the full panorama (In portrait mode to reduce lens distortion). 24 photos takes about 3-4 mins to stitch

The Pi camera board took 30 pictures to get a full panorama. It took 4 mins to stitch those though.

So there is definitely trade off with using a completely automated pi camera but I am still quite pleased with the results. It was a great learning experience and a great option for someone who can’t afford a larger camera, the whole system (excluding lego) runs in about £50-£60

A copy of the python code can be found here

A copy of the python code on github can be found here

Lego Pibot Ultrasonic wall avoider

I have been working on getting the cheap ultrasonic sensor working for the past week and have got it working with my Lego Pibot.

It sends out an ultrasonic blip every 0.1 seconds and measures the time it takes for it to get a bouce back.

I followed a very helpful guide at raspberry spy which I got a lot of the ideas from.

http://www.raspberrypi-spy.co.uk/2012/12/ultrasonic-distance-measurement-using-python-part-1/

Raspberry Pi camera board – Gstreamer

So, my Raspberry Pi camera board has arrived and I have started playing with it.

Raspberry Pi camera board

My first impressions were tiny, super cheap camera. Its low light capabilities are not great but I can live with that. The important bit is the quality, full 1080p at 25 frames per second (UK). That on its own is pritty awesome.

I was though only really interested in getting the pi to work remotely for my robot to replace the 3-4 fps standard def USB webcam I currently use. Currently though with the camera, there is no V4L driver so we have to make do with their provided applications then pipe it out to streaming applications. Their recommended method is slow and very laggy (netcat and mplayer with wifi provides 3-6 seconds of lag). So I had to find another option. I happened to be sitting on the #raspberrypi IRC on freenode and heard a user having success with gstreamer. So this is how to set up gstreamer to stream HD video with less than 0.5 seconds of lag.

First we need to add a repositary with gstreamer1.0

 

sudo nano /etc/apt/sources.list

 

and add to the end

 

deb http://vontaene.de/raspbian-updates/ . main

 

Then do an sudo apt-get update

next grab gstreamer

 

sudo apt-get install gstreamer1.0

 

 

On your recieving end you will also need gstreamer. Because I mainly use a mac, I decided to get it working on the mac so with help from arcanescu on IRC, we figured out how to get it working on mac os (10.8)

The simplest way is with brew, a package manager like apt-get, but for mac os. To install it run this in terminal on your mac simply run

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

It will grab and install brew. Now update it with

 

brew update 

 

Now we need to grab gstreamer

 

 brew install gstreamer gst-libav gst-plugins-ugly gst-plugins-base gst-plugins-bad gst-plugins-good 

 

Once that installs you should be good to go. Enter

 

 raspivid -t 999999 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse !  rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=YOUR-PI-IP-ADDRESS port=5000 

 

on your raspberry pi and enter on your mac

 

 gst-launch-1.0 -v tcpclientsrc host=YOUR-PI-IP-ADDRESS port=5000  ! gdpdepay !  rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false 

 

The picture quality is good but I see a number of flickers which isnt a problem for me, if it is for you, maybe try adjusting the resolution

 

So thanks again to arcanescu, I take no credit for this as it was him that came up with this, if you ever see him in IRC, give him a virtual pat on the back

His blog garagedeveloper.wordpress.com

Lego Pibot revision 0.2

 

I have been working away at my Lego Pibot recently and now have something to show for it.

I rebuilt the entire thing making it more efficient in turning, it uses a towering design and is more modular. It has 4 levels with batteries, pi, breadboard and camera.

It also has support for an additional attachment on the front, so far I have used that to attach a lift-able pen on the front to draw over paper (turtle style). Finally I have added space for a breadboard and also added the extra motor for rotating the webcam.

All the electronics are the same as the first Lego Pibot with the exception of the additional motor and the breadboard for prototyping. i have also added a cheap ultrasonic sensor off eBay to it but am having issues with it right now.

What isn’t shown in the video is the wiimote support I have added. I have written an additional script for controlling the robot with Bluetooth using a wiimote.

When it is finished I will post the source code, as normal, it is in python.

Also new is the addition of scratch controlling. The robot can be really easily controlled by scratch GPIO making it really simple to write control programs.

 

As normal, if you have any questions on this, post a comment below or on the video.

We WON!

 

On Wednesday the 20th of April the Dalriada school robotics team traveled to Cambridge to compete in the PA Consulting Raspberry Pi competition. Our team brought with us a prototype of our revolutionary new product, the Raspberry Pi Powered Internet Connected Pill Dispenser. This device uses a raspberry pi, connected to the internet to dispense pills at predesignated times that have been defined on a custom made website of ours.

All this for under £50!

The prototype of the pill dispenser
The prototype of the pill dispenser

When we arrived we were met by some helpful PA Consulting staff that had been assigned as our representatives for the day. We went up through a maze of halls to the event room. A massive room with banners everywhere and a lot of raspberries. We went over to our area and set up

Our whole design is a bit of a mess but we left it out of its box so people could have a look and see how it worked

We have plenty of cables. Spot the raspberry pi in there.
We have plenty of cables. Spot the raspberry pi in there.

After setting up I was immediately thrown in the deep in with an interview as no one else in the team wanted to do it. You can see a shortened version in the video above.

We then got shown around PA Consulting’s building and got to see some cool 3d printers, a machine for making kitchen roll (Way more exciting that it sounds) and a number of other activities planned for us. We then had to demo our design to a number of judges, this went ok but could have gone a lot better after a jammed the machine up by pulling out the wrong bit 🙂

After this the judges continued round the rest of the teams and members of the press and PA Consulting clients came and we presented our product to them, these seemed to go a lot better and we ended up with a number of impressed people including a lot of “My mother/father would greatly appreciate one of these”.

After a tantalizing wait, the judges announced the winners including us and we each walked away with a raspberry pi (My 4th raspberry pi) and a PIbow. The school got a golden envelope with £1000 in it (which we plan to spend on a classroom of raspberry pis) and an custom engraved Pibow case.

 

We had a stunning day and would especially like to thank PA Consulting for putting on this event

Check out what other bloggers have said

http://www.itpro.co.uk/mobile/19479/raspberry-pi-competition-award-winners

http://www.bbc.co.uk/news/technology-21882845