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


      





Showing posts with label OpenNI. Show all posts
Showing posts with label OpenNI. Show all posts

Sunday, March 25, 2012

mbed Removed

We have finally succeeded in removing one major component from the belt. The initial design of the belt had mbed in it. We were using mbed to generate PWM (Pulse width Modulation) to be sent to the actuators (vibration motors in our case). However, we eventually figured out that the same functionalities can be provided by PandaBoard without incurring that extra component cost of mbed.

PandaBoard has on-board GPIO (General Purpose Input Output) pins that can be used to render multiple functionalities. We configured three GPIO pins as output and created three software threads to generate variable-duty PWM. This PWM further actuates the vibration motors to guide the visually impaired in obstacle-detection.

Removal of mbed is a major breakthrough for us as we are continuously working on decreasing the size of the belt to make a sleek wearable design.

Wednesday, January 4, 2012

Test Drive-2: Rigorous Testing

This is the second test drive of viSparsh belt. We prepared an obstacle course in a closed hall and and simulated a special test environment with dummies and different sort of obstacles. The obstacles were of different materials, heights and widths. The test results were quite encouraging.


There has been some significant changes from our last test drive- 
1. We have increased number of vibrators from three to six to give a better indication of obstacle to the user. 
2. An autorun script has been created and deployed which starts the viSparsh belt automatically when we switch it on.  


Here is a video snippet of this test drive-


Tuesday, November 29, 2011

Test Drive-1: GET, SET……… GO!!!!!!!!!!


After the hard work of one and a half month finally we finished first phase of our project. We have designed the viSparsh v1.0. The belt includes a plastic box which contains PandaBoard, Mbed and Voltage Convertor and the Kinect fixed at the front of the belt. Currently we are using three vibration motors on three sides which we plan to increase to six in version 1.1.

We had our test drive today in our hostel and it worked exceptionally well with no false alarm. Some of the other fellows helped us in shooting the video and becoming the obstacles. Here is the video for this test drive-






Booting Ubuntu on Pandaboard EA3

STEP1: Download the Ubuntu image
Use this link to download the pre-installed image of ubuntu 10.10. 

STEP2: Prepare the SD card
Insert the SD card in your PC and unmount it. Then use this command to copy the pre-built image on the card.

COMMAND:
sudo sh -c 'zcat ./ubuntu-netbook-10.10-preinstalled-netbook-armel+omap4.img.gz|dd bs=4M of=/dev/sdb; sync'

STEP3: Download and copy required u-boot and MLO files
For Pandaboard version A2 and later follow these instructions. In our case we had a EA3 version so we followed it.  

2.      Untar with "tar -jxf panda.tar.bz2"
3.      Mount the first partition of the imaged SD card
4.      Copy MLO and u-boot.bin (extracted from the tar file) to the mounted partition.

STEP4: Boot from Pandaboard
Now unmounts the SD card and insert it in Pandaboard and give it the power. It shall start booting.

STEP5: Now use the same procedure to install OpenNI and Kinect that we used for BeagleBoard.



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


    

Friday, November 4, 2011

Kinectised the BeagleBoard

Finally, we have "Kinectised" the beagleboard. After working for more than a week to install OpenNI and Kinect sensor on the beagleboard things have finally worked out for us.

OpenNI though initially  showed some errors while installing but it was done in a couple of days.
Then we tried the methods given on N number of sites on the internet, still we were not able to install Kinect Sensor. Ultimately, we had to use our brain and employ some tricks to get that working. For this we understood it first by installing it on Linux installed on our laptop and then going through the files and the functions handled by them. Then we moved on to beagle board to resolve the error. Detailed process will be posted after we complete the next phase.


So, now the game is ON and we are just waiting for the delivery of Logic level converters and vibrations motors which we have ordered from Sparkfun. Stay tuned for the next updates!!



Sunday, October 23, 2011

Serially the way out


In order to transmit the data from BeagleBoard to Mbed microcontroller to actuate the vibration motors we need to transmit data serially. Hence we successfully tested serially full duplex communication from Linux (x86 processor) to other PC terminal. Next target is running the Kinect and OpenNi on Ubuntu (we have already succesfully checked the same on Windows7).
Showing posts with label OpenNI. Show all posts
Showing posts with label OpenNI. Show all posts

Sunday, March 25, 2012

mbed Removed

We have finally succeeded in removing one major component from the belt. The initial design of the belt had mbed in it. We were using mbed to generate PWM (Pulse width Modulation) to be sent to the actuators (vibration motors in our case). However, we eventually figured out that the same functionalities can be provided by PandaBoard without incurring that extra component cost of mbed.

PandaBoard has on-board GPIO (General Purpose Input Output) pins that can be used to render multiple functionalities. We configured three GPIO pins as output and created three software threads to generate variable-duty PWM. This PWM further actuates the vibration motors to guide the visually impaired in obstacle-detection.

Removal of mbed is a major breakthrough for us as we are continuously working on decreasing the size of the belt to make a sleek wearable design.

Wednesday, January 4, 2012

Test Drive-2: Rigorous Testing

This is the second test drive of viSparsh belt. We prepared an obstacle course in a closed hall and and simulated a special test environment with dummies and different sort of obstacles. The obstacles were of different materials, heights and widths. The test results were quite encouraging.


There has been some significant changes from our last test drive- 
1. We have increased number of vibrators from three to six to give a better indication of obstacle to the user. 
2. An autorun script has been created and deployed which starts the viSparsh belt automatically when we switch it on.  


Here is a video snippet of this test drive-


Tuesday, November 29, 2011

Test Drive-1: GET, SET……… GO!!!!!!!!!!


After the hard work of one and a half month finally we finished first phase of our project. We have designed the viSparsh v1.0. The belt includes a plastic box which contains PandaBoard, Mbed and Voltage Convertor and the Kinect fixed at the front of the belt. Currently we are using three vibration motors on three sides which we plan to increase to six in version 1.1.

We had our test drive today in our hostel and it worked exceptionally well with no false alarm. Some of the other fellows helped us in shooting the video and becoming the obstacles. Here is the video for this test drive-






Booting Ubuntu on Pandaboard EA3

STEP1: Download the Ubuntu image
Use this link to download the pre-installed image of ubuntu 10.10. 

STEP2: Prepare the SD card
Insert the SD card in your PC and unmount it. Then use this command to copy the pre-built image on the card.

COMMAND:
sudo sh -c 'zcat ./ubuntu-netbook-10.10-preinstalled-netbook-armel+omap4.img.gz|dd bs=4M of=/dev/sdb; sync'

STEP3: Download and copy required u-boot and MLO files
For Pandaboard version A2 and later follow these instructions. In our case we had a EA3 version so we followed it.  

2.      Untar with "tar -jxf panda.tar.bz2"
3.      Mount the first partition of the imaged SD card
4.      Copy MLO and u-boot.bin (extracted from the tar file) to the mounted partition.

STEP4: Boot from Pandaboard
Now unmounts the SD card and insert it in Pandaboard and give it the power. It shall start booting.

STEP5: Now use the same procedure to install OpenNI and Kinect that we used for BeagleBoard.



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


    

Friday, November 4, 2011

Kinectised the BeagleBoard

Finally, we have "Kinectised" the beagleboard. After working for more than a week to install OpenNI and Kinect sensor on the beagleboard things have finally worked out for us.

OpenNI though initially  showed some errors while installing but it was done in a couple of days.
Then we tried the methods given on N number of sites on the internet, still we were not able to install Kinect Sensor. Ultimately, we had to use our brain and employ some tricks to get that working. For this we understood it first by installing it on Linux installed on our laptop and then going through the files and the functions handled by them. Then we moved on to beagle board to resolve the error. Detailed process will be posted after we complete the next phase.


So, now the game is ON and we are just waiting for the delivery of Logic level converters and vibrations motors which we have ordered from Sparkfun. Stay tuned for the next updates!!



Sunday, October 23, 2011

Serially the way out


In order to transmit the data from BeagleBoard to Mbed microcontroller to actuate the vibration motors we need to transmit data serially. Hence we successfully tested serially full duplex communication from Linux (x86 processor) to other PC terminal. Next target is running the Kinect and OpenNi on Ubuntu (we have already succesfully checked the same on Windows7).