Friday, May 29, 2009

Minoru stereo webcam review

I predicted the arrival of stereo webcams a long time ago, and now it's finally happened. Recently I bought a Minoru "3D webcam" and have been trying it out. So far I have to say that I'm quite pleased with it.

The stereo camera itself is incredibly easy to install. It's a UVC device, and so "just works" out of the box with not much messing around. On a Linux system the camera appears as two separate video devices, which is exactly what I was looking for. I had initially thought that maybe the anaglyph shown in advertisments was created in hardware and then the single composite image sent to the PC, but fortunately this isn't the case.

Installation

Using an image grabbing utility called fswebcam the Minoru device worked straight away with no obvious issues. Later I found that there was an issue when trying to grab two images near simultaneously, but this is fixed in the latest UVC driver which will eventually be included as part of the kernel. To fix the problem on an Ubuntu 9.04 system, I did the following:

1. sudo apt-get install linux-headers-generic
2. Download and extract the latest UVC driver.
3. cd to the directory where the driver was extracted and run make followed by sudo make install
4. Plug in the Minoru webcam
5. Use my hacked version of the fswebcam utility to grab images from both cameras.

fswebcam -q -d /dev/video1,/dev/video2 -r 320x240 --no-banner -S 2 -s brightness=50% --save capture.jpg



Some reservations

So this looks like an excellent and easy to use device for use with PC based robots, which eliminates the time and complexity of needing to make your own stereo camera. I only have a couple of reservations:

1. The field of view is narrow - which is actually the case for most webcams. I havn't tried to measure the angle, but it looks something like the standard 40 degrees. For robotics purposes a wider field of view would be preferable.

2. I expected that the alignment of the cameras on a factory produced device would be better than what I've previously been able to hack together manually, but actually this seems not to be the case. There is a conspicuous vertical difference between the two images, which means that one camera is tilted relative to the other. This can be corrected by calibration though.

Upon subsequent investigation it seems that the apparent tilt is actually due to a very small misalignment of the camera lens mounting. To adjust this requires disassembling the casing, then loosening the two screws fixing the lens mount to the circuit board, moving it by some small amount then re-tightening the screws. Repeat the process until the alignment looks good.

Overall it looks like things are going my way, and that the Minoru device is probably just the first of many similar devices to come.

So, are these good enough to replace the aging webcams used on GROK2? The answer at the moment is a "maybe". Using the Minoru cameras I could make the robot's head smaller and more compact. The main thing which concerns me though is the narrow field of view, which could impair the grid mapping process due to excessive "tunnel vision". An alternative might be that instead of using two stereo cameras I could use three or four to try to reduce the field of view issues, and from a software and USB bandwidth point of view this wouldn't be any big issue. Another option might be to try to fit alternative lenses, but this might be difficult to do, and wherever possible I'd prefer to use "off the shelf" type hardware with as few ad-hoc modifications as possible.

Under the bonnet

The outer casing of the Minoru is quite attractive, but not readily conducive to mounting on a flat surface. I removed the casing, which unfortunately means destroying it. To do this I sawed off the camera stand at a point just underneath the main camera housing, and the silver coloured middle section can then be removed in two halves. The tricky part is then separating the camera housing, and for this I ran a precision screwdriver along the join until it came apart. The plastic lens covers can then be removed, and I also removed the microphone, since I don't need it for my applications.



The two cameras are mounted onto a single board, with the lens holders being fixed by two screws at the back. These look like the same holders that I've seen used on other boards (presumably "M12" type). There's a rubber backing to the circuit board, and I've kept this because this will provide insulation for the board components when mounting onto a flat metal surface.

It would be possible to mount two Minoru stereo cameras back to back to make an extremely compact dual stereo vision head. Also the circuit board would probably be quite easy to mount to some of the standard pan and tilt mechanisms sold by robotics hobby stores.

Image quality

Image quality I would say is average for a modern webcam. It's certainly better than my old Quickcam Express cameras, but not as good as the Quickcam Pro series. The sensors are CMOS devices measuring 3x4 millimetres. The part number is Vimicro VC0342PLNBA TSO3408 0230909.





The reverse side of the circuit board looks like this:


Camouflage

A long tailed tit is almost perfectly camouflaged amongst dried bramble leaves.

Thursday, May 28, 2009

Avoiding millennialist cognitive biases

On the internet there are a seemingly endless supply of millennialists. Up until a few years ago I would refer to them as "millennial doomsters", although now I usually either just call them "doomsters", or use the new and fashionable term "collapsitarians".

James Hughes offers some advice on how to sensibly navigate the outrageous claims made by various religious and secular groups. As always it's important to think critically, and also to consider the possibility that at least some of your most cherished assumptions will turn out to be incorrect.

GCR 2008: James Hughes - Avoiding Millennialist Cognitive Biases from Future of Humanity Institute on Vimeo.

Wednesday, May 20, 2009

It's grim up north

So once again it looks as if I'm imminently about to be made redundant. In the software business this is a constant hazard, even during a booming economy, so it's a situation I've become familiar with.

As a probably soon to be job seeker the prospects for re-employment look grim, and it could be a year or more before companies stop firing and start hiring again. One thing I have learned from the last fifteen or so years of software engineering is that sometimes situations which seem like a total disaster occasionally turn out to be an opportunity in disguise. One thing which unemployment will give me is time to complete at least the first phase of the GROK2 robot development. I'm not expecting the robot stuff to be a commercial enterprise - it's really just pure research at this stage - but if I manage to reach a point at which it looks like there might be commercial spinoffs that might be an avenue worth considering. I'm especially interested in getting robots out of factories and doing useful work in offices and homes. Unemployment also provides time to learn new skills and new programming languages, so that aspect might be fun.
"The beliefs of the Labour party of 2006 should be recognisable to the members of 1906. Full employment; strong public services; tackling poverty; international solidarity." - Tony Blair
I'm certainly not looking forward visiting job centres again (or whatever they're now rebranded as). The last time I was unemployed a few years ago the jobless figures were still quite low and Tony Blair was talking about "full employment being within sight", but now the official figures are over two million, and the actual number are probably higher still, so job centres are going to be packed with confused/angry/desperate/frustrated people, a proportion of which who will recently have gone through the trauma of losing their home.

Sunday, May 17, 2009

Saturday, May 16, 2009

What will the next bubble be?

Ok, so we've had a dot com bubble and a property bubble within the last decade. What will the next bubble be? It seems that people will rush to invest in anything which they believe to be increasing in value, and that many social phenomena are dominated by positive feedback effects.

During the recent property bubble it was quite common to hear phrases like "buy now before prices go up" or "get on the property ladder while you still can". The use of marketing terms like these is the classic sign that a bubble is taking place, which will inevitably be followed by a crash.

My favourite economic bubble is the tulip mania of 1637. This seems to have been very similar in nature to more recent economic bubbles, except substituting tulips for houses or web startups.
"People were purchasing bulbs at higher and higher prices, intending to re-sell them for a profit. However, such a scheme could not last unless someone was ultimately willing to pay such high prices and take possession of the bulbs. In February 1637, tulip traders could no longer find new buyers willing to pay increasingly inflated prices for their bulbs. As this realization set in, the demand for tulips collapsed, and prices plummeted"
Maybe at some time there will be a robotics bubble, or a bio/nanotech bubble, or even an AGI bubble. If I were to hazard a guess as to what the next major economic bubble will be I think I would go for solar power. Solar energy is something which many people would like to have in order to offset electricity prices which seem set to continue increasing otherwise. When the price of solar panel production reaches a certain level at which it's considered afforable there might be a sudden increase in companies selling panels and installation services, with consequent effects upon the share prices of those companies.

There is also a slightly more worrying side to bubble economics. Is the current exponential growth in human population on Earth also a bubble? Clearly the pace of growth is unsustainable if continued for the next few centuries. Even with the most sophisticated technology imaginable there will be some upper bound upon how many people that Earth can sustain, although it's not clear what that bound is yet. Maybe population will level off in a sustainable way (like a S curve), or perhaps there will be crashes if very finely tuned and automated agricultural systems fail due to small unexpected deviations in weather conditions or other perturbations.

Humanoid Sumo



I think the "robot in every home" is coming, but when it will actually arrive is hard to tell and there have already been a few false dawns. This isn't simply a question of the price/performance of PCs, but also depends upon the rate of development of algorithms suitable for making robots which can do useful things.

Wednesday, May 13, 2009

Terminated!

A question someone just asked me:

> Q: Is a Terminator-like scenario possible? And if so, how likely is it?

Well, the time travel aspect of the Terminator movies probably isn't possible, otherwise by now we'd have a lot of tourists from the future coming back to take photos of quaint and care-free early 21st century life, and also to place winning bets. What you're probably refering to is the idea that there comes a point in time where technology can function more or less autonomously from the people who created or administrated it, and that by some quirk of circumstance the technology comes to view humans as a hostile aggressor or an obstacle to progress which needs to be removed.

I was a teenager in the 1980s and so saw the first Terminator movie, although I must admit that it didn't have very much effect on me because at that time the "Terminator scenario" just seemed like pure fantasy. If you ask most people who are involved with robotics research or development today they will also dismiss the notion of a robotic takeover as merely an entertaining Hollywood plot device. Despite some advances in the last couple of decades a vast chasm remains between the sorts of capabilities with which robots are endowed in the movies and what even the most advanced contemporary robots can do in reality. The likelihood of a Terminator scenario occuring in the near future, as in the next few decades, seems nominal. This is mainly because a great deal of work remains to be done in order to reach a point where technology becomes fully self sustaining and can exist independently from human intervention for indefinite periods of time. Even if the robots were to rise up and overthrow us, in the absence of infrastructure capable of sustaining their existence this would indeed be a Pyrrhic victory.

Looking to the longer term future, which might be the late 21st century or beyond, a Terminator scenario would at least in principle be possible if you make a sufficient number of assumptions. In this flighty vision of a future world we imagine that the industrial revolution continues more or less unabated (despite the end of cheap oil) and the relentless march of automation - powered by the never ending quest for greater and greater economic efficiency - extends into all areas of life. Agriculture is fully automated, as is virtually all industrial production, with humans living out little more than a parasitic existence, going along for a free, or almost free, ride. We can safely assume that no significant changes have occured within human psychology, and that wars still occur from time to time which are mainly targeted at disrupting the machinations of the technological bubble within which mankind has insulated himself. If there is a time when humans are essentially superfluous - merely froth on the technological wave (from the human perspective a kind of comfortable retirement) - then it is at least in principle possible that we could be trivially usurped by a rival species of militant machinery.

Of course it's hard to make predictions about things which might or might not occur in the distant future, but one thing we can depend upon is that evolution will continue both in the biological and post-biological realms. We may be able to hold rivals at bay by ensuring that we retain control over their ability to reproduce, but in the long term as a strategy this probably isn't going to buy us very much time. This isn't a Judgement Day scenario though, it's just another chapter in the varied history of life on Earth, which has already seen countless batons transferred from one species to the next.

I'm not much of a visionary though, and am far more concerned about things which might actually occur within my own lifetime. In the next few decades I think there may be dangers arising from the uses and abuses of robotics technology, in a similar manner to the way that existing computer technology suffers from various forms of abuse. As I write this many of the industrialised nations are gearing up for telerobotic warfare - robot planes, and an assortment of unmanned ground vehicles. What we've already seen with the Predator UAV and Pacbots is just the tip of a very large iceberg. As Illah Nourbakhsh put it in a recent talk, what we should fear in the foreseeable future is not unethical robots, but unethical roboticists (see http://www.youtube.com/watch?v=giKT8PkCCv4). Unlike conventional fighter planes or tanks, telerobots capable of delivering deadly force will not be expensive to manufacture and so will inevitably fall into the hands of non-state actors which may include criminal gangs and cults. As a near term scenario, imagine a cult consisting of a few tens of followers building a hundred telerobots equipped with firearms then driving them into a city centre, under supervisory control similar to a real time strategy game. All of the technology needed for such a dastardly plan exists today, and will only get cheaper and less complex with time.

People love to focus on grandiose gloom and doom scenarios - it makes their own personal troubles appear diminutive in stature - but at least as far as robotics is concerned I think the future is bright, and that the overwhelming majority of robotics applications in the foreseeable future will be peaceful and beneficial.

Tuesday, May 12, 2009

Sand dunes and entropy

The mars rover Spirit gets stuck in loose sand, whilst also dragging a damaged wheel. Both of the NASA rovers have been incredibly successful and have survived long beyond their expected operational lifetimes. This kind of telerobotic exploration is probably the best we can hope for in the foreseeable future. A manned mission would be significantly harder of pull off, but certainly wouldn't be impossible if there were sufficient motivation and money behind it.



An open question is whether it will be possible to devise planetary robotic systems which are capable of surviving indefinitely as roving outposts. This would require systems which could be serviced and maintained, either by themselves or other robots, and might favour legged designs over wheeled ones. If a leg fails on a hexapod design, the robot might detach it using a neighbouring leg, stow it away, then return to some servicing location where spare parts had previously been landed. Self repairing machines is an area which seems to have received little research attention, but will be important for the longer term exploration of space. There is also some crossover between the problems of self repair and machines which will be capable of constructing bases suitable for subsequent human visitors.

Rocket Man

As a long time appreciator of Bill Shatner's Beatles covers, here he is again in 1978 with a rendition of Rocket Man.

Saturday, May 09, 2009

Humanoid soccer players warm up

Through a window

Stereo images taken from one of GROK2's cameras looking through a window.



The stereo disparity can be more easily visualised in this animated gif. If the calibration is good there should normally be no significant vertical movement, and objects further away should have smaller disparity than those closer to the camera.

Saturday, May 02, 2009

The singularity of Ray Kurzweil

A four part series of videos in which Ray Kurzweil espouses the usual mix of futurism and immortalism. He is of course right that the current economic crisis will have no impact on the general pace of technological progress. Whether taking a lot of pills and potions will significantly boost your longevity I remain very skeptical about. Often when you really investigate these things their evidential basis seems highly sketchy, but where I would agree with Kurzweil is that in time medicine will become far more of a science than it is now, and the pill-pushing quacks will become a thing of the past. It should eventually be possible to simulate the interaction of drugs with the body in exquisite detail using models of human cells where every chemical interaction is simulated and the DNA sequence is the same as that of the patient (this might be called "the human cell project"). It might even become possible to arbitrarily synthesise drugs at home using some kind of medical version of a reprap machine. All this is probably at least several more decades away though, but it seems well within the bounds of possibility that such things will occur.

Of course there is no "knee" of the exponential curve. A better way of describing it might be that there comes a point at which improvements in a particular technology have accumulated sufficiently for the technology to become widely visible to society at large. So for example there will be some point at which a wave of robotics technology appears to "come out of nowhere" and be commercially successful, whereas to anyone following the history in more detail this will just be another step in a long, mostly incremental, line of developments going back decades into the past.

The first 1% is the hardest

I use desktop versions of Linux nearly all the time, and they're really far better than Microsoft Windows in terms of speed, ease of use, aesthetic appearance and security. The only thing carrying Windows on the desktop at the moment is pure inertia. Windows 7 is really going to need to be a very slick piece of software to compete.

Friday, May 01, 2009

Cup grabber

The Intel Herb robot picking up cups.

Robot podnosi kubki (Intel Developer Forum Fall 2008) from Pawel Pilarczyk on Vimeo.



One thing which would concern me here is that the scanning laser will be in the line of sight of cats and dogs, so I'm not sure how practical that would be.

Grabbing things other than cups still looks quite impressive.

Robot wyczuwajÄ…cy obiekty from Pawel Pilarczyk on Vimeo.