Monday, July 18, 2011

Nona installation

1. Download the Hugin bundle from http://sourceforge.net/projects/hugin/
2. Copy the Hugin application to the Applications folder
3. Copy the initialize_environment.txt to your home folder, like /Users/angelica
4. From your home folder, run
source ./initialize_environment.txt

Robot accompanist


To do's
-       test with .wav file, sound not loud enough
-       have to make media location correct

Tuesday, July 12, 2011

Chapter 1 - Why should we make humanoid robots?

Translations from "Why I Make Humanoid Robots" by Hiroshi Ishiguro 

From Computer Vision to Robot Research

For 10 years, I've been completely absorbed in robot research and development, but in the beginning, I studied computer vision. Some of it had to do with writing Prolog, but researching computer vision  meant mainly analyzing computer images from a camera, so the computer could recognize what was in the photo.

Upon digging deeper into computer vision, this question sprang to mind: "Can a computer recognize reality without a body?"

For a computer to recognize an image, it needs to be loaded with knowledge about the contents of that image. But how much knowledge should we store? For example, to recognize a chair, we'd have to teach the computer every type of chair in the world. How do humans accomplish this kind of thing?

Based on our own human experience, we recognize that a chair is basically something we can sit on. Even if it's the first time seeing a particular chair, we can recognize that it's a chair.

That is, humans can recognize objects using their bodies, and don't need to comprehend that shape in the photo.

We observe what features we need to recognize whether we can sit on it or not, and find it possible to have a kind of generalized recognition.

For computers to have an equivalent recognition ability, they should be able to move around in their environment, just like humans, and have a body that can touch things.

That's the reason I widened my research from the world of computer vision to the world of robotics.

Research on making robots with human-like vision
After that experience in computer vision, the first thing I tackled in robot research was giving them a human-like sense of sight. That research could be classified into two categories: omni-directional vision and active vision.

In humans, two types of eye movements happen. The first kind is called omni-directional eye movement, used to survey our environment: we first recognize where we are, then figure out how to get there. The second type is continually looking at an object of interest to examine it in detail. This is called active vision. We need this research in eye movements for robots to play an active role in our daily lives.

Saturday, July 2, 2011

Improvements

Some things I want to do to improve NAO's theremin playing:
  • 1. Turn off his head fan during recording. 

Thursday, June 30, 2011

Transfer files to/from NAO from your program

# This all assumes the default setting of username=nao with robot name =nao.
# Reminder to me -- I need to mkdir the recording folder on nao.

I often want to transfer files to and from my NAO from within my program. To do this without it asking for a password, I have to use public keys.


Example usage:
In Python, I can use the os.system() function to run linux commands.

import os
cmd = 'scp nao@nao.local:/home/nao/recording.wav .'
os.system(cmd)

This would copy the recording I made (for example, using the ALAudioDevice API) to the current directory on my Mac (for example).


How to scp from your computer to NAO without a password:  

1. If you don't already have a public key, generate one:
  • In the home directory of your computer, run ssh-keygen
  • Press enter to name it using the default id_rsa.pub
  • Enter some passphrase (at least 5 characters)

2. Copy the public version of the key to your NAO: 
scp ~/.ssh/id_rsa.pub nao@nao.local:~

3. Log into NAO using ssh nao@nao.local

4. Add the public key to NAO's authorized keys list:
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys


Even cooler!

You can do

cmd = 'scp nao.local:/home/nao/recording.wav .'

without needing to specify the username every time (did you notice it was missing?). This is handy if you're already storing IP='nao.local'.

Adding a default username for nao.local host:

Add the following into ~/.ssh/config:
Host nao.local
        User nao

Note that before "User" you need to put a tab.

Friday, June 24, 2011

Proxy ridiculous!

Here's how to set up the proxies for git and svn.

git
export $http_proxy=proxy.com:8080
git config --global http.proxy $http_proxy

svn
> sudo vim ~/.subversion/servers
http-proxy-host = proxy.com
http-proxy-port = 8080

Thursday, June 23, 2011

Mach-o errors finally fixed

I've been having problems for ages trying to get NAO libraries to play nicely in Python on my Mac (Snow Leopard).

First of all, I'd have to run Python 2.6 by doing:
>> python2.6

And then I'd try to import the naoqi library, and get the error:

Python 2.6.6 (r266:84292, May 17 2011, 11:58:30)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import naoqi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/angelica/Nao/Library/naoqi-sdk-1.10.44-mac/lib/naoqi.py", line 35, in <module>
    import inaoqi
  File "/Users/angelica/Nao/Library/naoqi-sdk-1.10.44-mac/lib/inaoqi.py", line 7, in <module>
    import _inaoqi
ImportError: dlopen(/Users/angelica/Nao/Library/naoqi-sdk-1.10.44-mac/lib/_inaoqi.so, 2): no suitable image found.  Did find:
    /Users/angelica/Nao/Library/naoqi-sdk-1.10.44-mac/lib/_inaoqi.so: mach-o, but wrong architecture
    /Users/angelica/Nao/Library/naoqi-sdk-1.10.44-mac/lib/_inaoqi.so: mach-o, but wrong architecture


The main problem seemed to be making it all work with my MacPorts installation.

The PATH environment variable in my ~.profile had been modified by my MacPorts installation to look something like:

export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH

I deleted this line from my .profile and opened a new terminal. Now the PATH was not being overridden by my .profile setting, so when I did

>> which python
I got
>> /usr/bin/python

More importantly, I can import my Nao library again! <3

h22:~ angelica$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import naoqi
>>>