A Touch of Light

A step towards enlightenment for those living in the world of darkness.

A Young India Fellowship Initiative in collaboration with University of Pennsylvania


      





Saturday, November 12, 2011

Time for Efficiency Optimization


YIF journey has been a life-changer for each of the Young India Fellows. Especially for our team viSparsh, managing a technical project alongside an intensive liberal arts course has been tough. We have been working many days and nights to quickly complete the 1st phase of our ELM (to build viSparsh belt prototype). However, the demanding coursework and other activities at YIF also consumed effective part of our time. Thus, we finally understood the urgency for effective time management for our project which we were not able to strictly abide to earlier. As per the guidance of our mentor Prof. Rahul Mangharam, to start with we decided of chalking out a plan for our coming two weeks. Given below is the work allocation for our next two weeks:
– Resolving Issues coming with Kinect on Beagleboard(Tushar- 16/11/11)
– Completing all installation work( including OS and Kinect) on PandaBoard (Jatin-17/11/11)
– Talking to organizations like Kritical Solutions and Saksham NGO (suggested by YIFP admin) to get inputs from visually impaired people, knowing about their issues and talking to other people already working in this field. (Rolly-30/11/11)
– Making PCB for the project (Jatin-22/11/11)
– Integrating all components (Tushar-26/11/11)
– Making Initial Project with Belt (Tushar-26/11/11)
– Updating Blog, contacting people and other communications (Rolly- on regular basis)
Alongside, this initial work distribution we would be soon making a proper timeline till the end of our project to help us keep better track of the project and work accordingly to meet the deadlines.

Problem Bubbles Popping Out


It seems we are on the board of ‘Snakes & Ladders’. The time when we were about to complete our phase-I another technical issue has bugged us. The Kinect which was working well so far (as posted earlier) is not getting detected with beagleboard now. 
We are getting the follwing error on running a sample Kinect program-
Error:One or more of the following nodes could not be enumerated.
Device: PrimeSense/SensorKinect/5.0.3.4: The device is not connected!
For the last four days we have been struggling with this problem. We have tried various fixes available on the web but none has worked so far. We have even prepared a new SD card with everything installed from scratch but same error persists. We are trying our level best to find any point we have been unknowingly missing so far. However, this had resulted us in push our submission deadlines also accounting the fact that we have term papers and exams on the pipeline.

Monday, November 7, 2011

Battle with Bugs


The entire last was a battle with bugs and installation problems. The OpenNI website has updated the OpenNI files without updating the Sensor files. It created errors during installation and we were forced to read almost every blog and website on web to debug it. We left no stone unturned and finally managed to install the sensor correctly. Here is a detailed description on installation instructions and debugging. We are trying to put all the problems and there solutions at one place so that it can save others time.

STEP 1: Install required packages for Kinect
We need to install certain packages in Ubuntu. These packages, then, would facilitate the installation of OpenNI and Kinect.

COMMAND:
sudo apt-get install git-core cmake libglut3-dev pkg-config 
sudo apt-get install gcc g++ build-essential libxmu-dev 
sudo apt-get install libxi-dev libusb-1.0-0-dev 
sudo apt-get install doxygen graphviz git

ERROR:
libglut3-dev cannot be installed

FIX:
sudo apt-get install git-core cmake freeglut3-dev pkg-config
sudo apt-get install gcc g++ build-essential libxmu-dev 
sudo apt-get install libxi-dev libusb-1.0-0-dev 
sudo apt-get install doxygen graphviz git
In the latest versions ‘libglut3-dev’ has been replaced by ‘freeglut3-dev’ so install it inplace of ‘libglut3-dev’. In case it does not work, install libglut3 from launchpad.net/ubuntu/natty/+package/libglut3-dev.

Although some blogs tell that ‘doxygen’ and ‘graphviz’ are optional, we found that they are required so don’t skip them while installation.

STEP 2: Create a new directory for Kinect

COMMAND:
mkdir ~/kinect
cd ~/kinect

STEP 3: Download OpenNI from the git repository

COMMAND:
git clone https://github.com/OpenNI/OpenNI.git


STEP 4: Install OpenNI

COMMAND:
cd OpenNI/Platform/Linux-x86/Build
make && sudo make install

ERROR1:
Cannot find the metadata file "system.windows.forms.dll"

FIX1:
sudo apt-get install mono-complete
Although, it is weird that linux throws error of windows dll file, the solution is to install ‘mono’. Mono is a platform for running and developing applications based on the ECMA/ISO Standards.

ERROR2:
No access permission for install.sh and RedistMaker.

FIX2:
The error indicates that the install.sh and RedistMaker files do not have execution permission. Therefore give them permission to execute.
cd ../CreateRedist
sudo chmod +x install.sh RedistMaker
cd ../Build

ERROR3:
CommonMakefile does not exit

FIX3:
sudo apt-get install mono-complete

ERROR 4:
“arm-angstrom-linux-gnueabi” does not exist.
The error is generated as we are on ARM Platform and the Platform.Arm file tries to access gnueabi file for Angstrom (arm-angstrom-linux-gnueabi) which does not exist in Ubuntu.

FIX 4:
cd Common 
mv Platform.Arm Platform.Arm.BAK
cp Platform.x86 Platform.Arm

ERROR 5:
Unrecognized command line option "-malign-double"
Unrecognized command line option "-mmse2"

FIX 5: Edit the Platform.Arm file in ~/kinect/OpenNI/Platform/Linux-x86/Build/Common

In the latest version of OpenNI, the ARM platform has been included by the name Linux-ARM. However if we go into ~/kinect/OpenNI/Platform/Linux-ARM/Build/ and try to build it you’ll face errors thus better would be to use the old Linux-x86 platform files with some modifications.

Open ~/kinect/OpenNI/Platform/Linux-x86/Build/Common/Platform.Arm and ~/kinect/OpenNI/Platform/Linux-x86/Build/Common/Platform.x86 files to comment out these lines:

  CFLAGS += -malign-double
  and
  ifeq ($(SSE_GENERATION), 2)
        CFLAGS += -msse2
  else
        ifeq ($(SSE_GENERATION), 3)
               CFLAGS += -msse3
        else
               ($error "Only SSE2 and SSE3 are supported")
        endif
  endif

We need to do this because ‘ -malign-double’ and ‘-msse3’ flags are valid only for x86 platform and will not work for gcc on ARM. Commenting out these statements makes the code usable for ARM.


STEP 5: Download Kinect driver

Most of the blogs mention https://github.com/boilerbots/Sensor.git to get the Kinect sensor’s files. These files are not updated and generated many errors and bugs. Use https://github.com/avin2/SensorKinect which is the updated version and do not produce these errors.

COMMAND: 
cd ~/kinect/
git clone https://github.com/avin2/SensorKinect
cd SensorKinect


STEP 6: Install Kinect driver
cd Platform/Linux-x86/Build
make && sudo make install

ERROR1:
CommonMakefile does not exit

FIX1:
sudo apt-get install mono-complete
Now try building again. If the method does not work do this-
gedit ~/kinect/SensorKinect/Platform/Linux-x86/Build
Replace ‘LIB_USED’ by ‘USED_LIBS’ and build again. You may find that the name is already ‘USED_LIBS’ in that case follow the below given instructions.

Latest versions of OpenNI have changed the name of the common file as CommonCppMakefile. How most of the Sensor files have not yet been updated. Therefore, execute this command to create a soft link copy of CommonCppMakefile with the name CommonMakefile.
cd /usr/include/ni
ln –s  ./CommonCppMakefile ./CommonMakefile

If it does not work open /usr/include/ni and search for these file-
CommonCppMakefile
CommonDefs.mak
CommonTargets.mak
CommonCSMakefile
CommonJavaMakefile
Platform.CE4100
Platform.x86
Platform.Arm
The OpenNI probably hasn’t created these files. Therefore, you need to copy them here. Execute these commands-
cd ~/kinect/OpenNI/Platform/Linux-x86/Build
cp Common/* /usr/include/ni

STEP 7: Now use your kinect
Connect the kinect with the beagleboard and run sample programs-
cd ~/kinect/OpenNI/Platform/Linux-x86/Bin/Release
./SampleNiRead


ERROR :
InitFromXml failed: Failed to set USB Interface!

FIX :
sudo rmmod gspca_kinect


    

Bootstrap


Here are the instructions to download an image of Ubuntu Maverick and installing it on SD/MMC card. You may choose any Ubuntu flavor as you wish. We have chosen Maverick 10.10 here. Download any other flavor of Ubuntu from here: http://rcn-ee.net/deb/rootfs/maverick/.

STEP 1: Download and extract Ubuntu Maverick 10.10
wget http://rcn-ee.net/deb/rootfs/maverick/ubuntu-10.10-r7-minimal-armel.tar.xz
 
tar xjf ubuntu-10.10-r7-minimal-armel.tar.xz
cd ubuntu-10.10-r7-minimal-armel

STEP 2: Look for the MMC/SD card
sudo ./setup_sdcard.sh --probe-mmc

This would result in something like this-
Are you sure? I Don't see [/dev/idontknow], here is what I do see...
 
fdisk -l:
Disk /dev/sda: 500.1 GB, 500107862016 bytes <-x86 Root Drive
Disk /dev/sdb: 7957 MB, 7957325824 bytes    <-MMC/SD card
 
mount:
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0) <-x86 Root Partition
 Here you can see that /dev/sdb matches your MMC card specification.

STEP 3: Partition the MMC/SD card and install the Ubuntu image
sudo ./setup_sdcard.sh --mmc /dev/sdb --uboot beagle

Version
--uboot option
BeagleBoard Bx
--uboot beagle_bx
BeagleBoard Cx, xM, A/B/C
--uboot beagle
Panda Board
--uboot panda

STEP 4: Insert the MMC/SD card in SD card slot at BeagleBoard, connect the monitor and boot it. Use these login details:
Username: ubuntu 
Password: temppwd

STEP 5: Connect to Internet and install GUI and other necessary packages
sudo dhclient eth0
sudo apt-get update
sudo apt-get install xubuntu-desktop
sudo apt-get install xfce4 gdm xubuntu-gdm-theme xubuntu-artwork 
sudo apt-get install xserver-xorg-video-omap3 network-manager
We also used ‘sudo apt-get upgrade’ in this step 5. It took several hours and resulted into non graphical interface. Therefore, there is no need to do that here. 

STEP 6: Restart the BeagleBoard.


Saturday, November 12, 2011

Time for Efficiency Optimization


YIF journey has been a life-changer for each of the Young India Fellows. Especially for our team viSparsh, managing a technical project alongside an intensive liberal arts course has been tough. We have been working many days and nights to quickly complete the 1st phase of our ELM (to build viSparsh belt prototype). However, the demanding coursework and other activities at YIF also consumed effective part of our time. Thus, we finally understood the urgency for effective time management for our project which we were not able to strictly abide to earlier. As per the guidance of our mentor Prof. Rahul Mangharam, to start with we decided of chalking out a plan for our coming two weeks. Given below is the work allocation for our next two weeks:
– Resolving Issues coming with Kinect on Beagleboard(Tushar- 16/11/11)
– Completing all installation work( including OS and Kinect) on PandaBoard (Jatin-17/11/11)
– Talking to organizations like Kritical Solutions and Saksham NGO (suggested by YIFP admin) to get inputs from visually impaired people, knowing about their issues and talking to other people already working in this field. (Rolly-30/11/11)
– Making PCB for the project (Jatin-22/11/11)
– Integrating all components (Tushar-26/11/11)
– Making Initial Project with Belt (Tushar-26/11/11)
– Updating Blog, contacting people and other communications (Rolly- on regular basis)
Alongside, this initial work distribution we would be soon making a proper timeline till the end of our project to help us keep better track of the project and work accordingly to meet the deadlines.

Problem Bubbles Popping Out


It seems we are on the board of ‘Snakes & Ladders’. The time when we were about to complete our phase-I another technical issue has bugged us. The Kinect which was working well so far (as posted earlier) is not getting detected with beagleboard now. 
We are getting the follwing error on running a sample Kinect program-
Error:One or more of the following nodes could not be enumerated.
Device: PrimeSense/SensorKinect/5.0.3.4: The device is not connected!
For the last four days we have been struggling with this problem. We have tried various fixes available on the web but none has worked so far. We have even prepared a new SD card with everything installed from scratch but same error persists. We are trying our level best to find any point we have been unknowingly missing so far. However, this had resulted us in push our submission deadlines also accounting the fact that we have term papers and exams on the pipeline.

Monday, November 7, 2011

Battle with Bugs


The entire last was a battle with bugs and installation problems. The OpenNI website has updated the OpenNI files without updating the Sensor files. It created errors during installation and we were forced to read almost every blog and website on web to debug it. We left no stone unturned and finally managed to install the sensor correctly. Here is a detailed description on installation instructions and debugging. We are trying to put all the problems and there solutions at one place so that it can save others time.

STEP 1: Install required packages for Kinect
We need to install certain packages in Ubuntu. These packages, then, would facilitate the installation of OpenNI and Kinect.

COMMAND:
sudo apt-get install git-core cmake libglut3-dev pkg-config 
sudo apt-get install gcc g++ build-essential libxmu-dev 
sudo apt-get install libxi-dev libusb-1.0-0-dev 
sudo apt-get install doxygen graphviz git

ERROR:
libglut3-dev cannot be installed

FIX:
sudo apt-get install git-core cmake freeglut3-dev pkg-config
sudo apt-get install gcc g++ build-essential libxmu-dev 
sudo apt-get install libxi-dev libusb-1.0-0-dev 
sudo apt-get install doxygen graphviz git
In the latest versions ‘libglut3-dev’ has been replaced by ‘freeglut3-dev’ so install it inplace of ‘libglut3-dev’. In case it does not work, install libglut3 from launchpad.net/ubuntu/natty/+package/libglut3-dev.

Although some blogs tell that ‘doxygen’ and ‘graphviz’ are optional, we found that they are required so don’t skip them while installation.

STEP 2: Create a new directory for Kinect

COMMAND:
mkdir ~/kinect
cd ~/kinect

STEP 3: Download OpenNI from the git repository

COMMAND:
git clone https://github.com/OpenNI/OpenNI.git


STEP 4: Install OpenNI

COMMAND:
cd OpenNI/Platform/Linux-x86/Build
make && sudo make install

ERROR1:
Cannot find the metadata file "system.windows.forms.dll"

FIX1:
sudo apt-get install mono-complete
Although, it is weird that linux throws error of windows dll file, the solution is to install ‘mono’. Mono is a platform for running and developing applications based on the ECMA/ISO Standards.

ERROR2:
No access permission for install.sh and RedistMaker.

FIX2:
The error indicates that the install.sh and RedistMaker files do not have execution permission. Therefore give them permission to execute.
cd ../CreateRedist
sudo chmod +x install.sh RedistMaker
cd ../Build

ERROR3:
CommonMakefile does not exit

FIX3:
sudo apt-get install mono-complete

ERROR 4:
“arm-angstrom-linux-gnueabi” does not exist.
The error is generated as we are on ARM Platform and the Platform.Arm file tries to access gnueabi file for Angstrom (arm-angstrom-linux-gnueabi) which does not exist in Ubuntu.

FIX 4:
cd Common 
mv Platform.Arm Platform.Arm.BAK
cp Platform.x86 Platform.Arm

ERROR 5:
Unrecognized command line option "-malign-double"
Unrecognized command line option "-mmse2"

FIX 5: Edit the Platform.Arm file in ~/kinect/OpenNI/Platform/Linux-x86/Build/Common

In the latest version of OpenNI, the ARM platform has been included by the name Linux-ARM. However if we go into ~/kinect/OpenNI/Platform/Linux-ARM/Build/ and try to build it you’ll face errors thus better would be to use the old Linux-x86 platform files with some modifications.

Open ~/kinect/OpenNI/Platform/Linux-x86/Build/Common/Platform.Arm and ~/kinect/OpenNI/Platform/Linux-x86/Build/Common/Platform.x86 files to comment out these lines:

  CFLAGS += -malign-double
  and
  ifeq ($(SSE_GENERATION), 2)
        CFLAGS += -msse2
  else
        ifeq ($(SSE_GENERATION), 3)
               CFLAGS += -msse3
        else
               ($error "Only SSE2 and SSE3 are supported")
        endif
  endif

We need to do this because ‘ -malign-double’ and ‘-msse3’ flags are valid only for x86 platform and will not work for gcc on ARM. Commenting out these statements makes the code usable for ARM.


STEP 5: Download Kinect driver

Most of the blogs mention https://github.com/boilerbots/Sensor.git to get the Kinect sensor’s files. These files are not updated and generated many errors and bugs. Use https://github.com/avin2/SensorKinect which is the updated version and do not produce these errors.

COMMAND: 
cd ~/kinect/
git clone https://github.com/avin2/SensorKinect
cd SensorKinect


STEP 6: Install Kinect driver
cd Platform/Linux-x86/Build
make && sudo make install

ERROR1:
CommonMakefile does not exit

FIX1:
sudo apt-get install mono-complete
Now try building again. If the method does not work do this-
gedit ~/kinect/SensorKinect/Platform/Linux-x86/Build
Replace ‘LIB_USED’ by ‘USED_LIBS’ and build again. You may find that the name is already ‘USED_LIBS’ in that case follow the below given instructions.

Latest versions of OpenNI have changed the name of the common file as CommonCppMakefile. How most of the Sensor files have not yet been updated. Therefore, execute this command to create a soft link copy of CommonCppMakefile with the name CommonMakefile.
cd /usr/include/ni
ln –s  ./CommonCppMakefile ./CommonMakefile

If it does not work open /usr/include/ni and search for these file-
CommonCppMakefile
CommonDefs.mak
CommonTargets.mak
CommonCSMakefile
CommonJavaMakefile
Platform.CE4100
Platform.x86
Platform.Arm
The OpenNI probably hasn’t created these files. Therefore, you need to copy them here. Execute these commands-
cd ~/kinect/OpenNI/Platform/Linux-x86/Build
cp Common/* /usr/include/ni

STEP 7: Now use your kinect
Connect the kinect with the beagleboard and run sample programs-
cd ~/kinect/OpenNI/Platform/Linux-x86/Bin/Release
./SampleNiRead


ERROR :
InitFromXml failed: Failed to set USB Interface!

FIX :
sudo rmmod gspca_kinect


    

Bootstrap


Here are the instructions to download an image of Ubuntu Maverick and installing it on SD/MMC card. You may choose any Ubuntu flavor as you wish. We have chosen Maverick 10.10 here. Download any other flavor of Ubuntu from here: http://rcn-ee.net/deb/rootfs/maverick/.

STEP 1: Download and extract Ubuntu Maverick 10.10
wget http://rcn-ee.net/deb/rootfs/maverick/ubuntu-10.10-r7-minimal-armel.tar.xz
 
tar xjf ubuntu-10.10-r7-minimal-armel.tar.xz
cd ubuntu-10.10-r7-minimal-armel

STEP 2: Look for the MMC/SD card
sudo ./setup_sdcard.sh --probe-mmc

This would result in something like this-
Are you sure? I Don't see [/dev/idontknow], here is what I do see...
 
fdisk -l:
Disk /dev/sda: 500.1 GB, 500107862016 bytes <-x86 Root Drive
Disk /dev/sdb: 7957 MB, 7957325824 bytes    <-MMC/SD card
 
mount:
/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0) <-x86 Root Partition
 Here you can see that /dev/sdb matches your MMC card specification.

STEP 3: Partition the MMC/SD card and install the Ubuntu image
sudo ./setup_sdcard.sh --mmc /dev/sdb --uboot beagle

Version
--uboot option
BeagleBoard Bx
--uboot beagle_bx
BeagleBoard Cx, xM, A/B/C
--uboot beagle
Panda Board
--uboot panda

STEP 4: Insert the MMC/SD card in SD card slot at BeagleBoard, connect the monitor and boot it. Use these login details:
Username: ubuntu 
Password: temppwd

STEP 5: Connect to Internet and install GUI and other necessary packages
sudo dhclient eth0
sudo apt-get update
sudo apt-get install xubuntu-desktop
sudo apt-get install xfce4 gdm xubuntu-gdm-theme xubuntu-artwork 
sudo apt-get install xserver-xorg-video-omap3 network-manager
We also used ‘sudo apt-get upgrade’ in this step 5. It took several hours and resulted into non graphical interface. Therefore, there is no need to do that here. 

STEP 6: Restart the BeagleBoard.