Installing touchlib based cheap touch pad on Ubuntu 10.04

While I was watching the below youtube clip, I was not able to control my passion to try it out. This is actually a do it yourself cheap touch pad for your computer. This is a touch pad made with a good web cam, card board box and open source touchlib library. I was trying to get it done in Ubuntu 10.04. Here is how to do it.

Making of touch pad

I followed the above youtube video to get a touch pad box. What I needed was,

1. A web cam

2. A card board box

3. A glass tile

4. A white paper

5. Adhesive tape

Installing dependencies

$ sudo apt-get install cmake libcv-dev libcvaux-dev fftw-dev g++ libxmu-dev libglut3-dev subversion libhighgui-dev

Installing oscpack

Download oscpack_1_0_2.zip from http://www.audiomulch.com/~rossb/code/oscpack/

$ unzip oscpack_1_0_2.zip
$ cd oscpack
Add #include <cstring> in tests/OscUnitTests.cpp, osc/OscPrintReceivedElements.cpp and examples/OscDump.cpp
Add #include <cstdlib> in tests/OscSendTests.cpp, tests/OscReceiveTest.cpp, examples/OscDump.cpp
$ make
$ sudo make install

Installing touchlib

$ mkdir ~/touchlib
$ cd ~/touchlib
$ svn checkout http://touchlib.googlecode.com/svn/trunk/ .
Add #include <stdio.h> in src/RectifyFilter.cpp if it is not there.
$ cmake .
$ make

Command to configure the device

$ cd ~/touchlib/src
$ ./configapp
. . . . . . .
HIGHGUI ERROR: V4L2: device /dev/video0: Unable to query number of channels
. . . . . . .
It seems to be my video device (cheap Gear head Web cam 093a:2620) does not support the above said feature. I am not sure about its V4L2 compatibility. If you have any clue to get rid of this, please let me know. Right now my budget not allowing me to get it tested with any other good web cam. I thought these steps may be helpful for some one else who may try to get it. Please comment here if you get it done.

References

Share this post

3 comments

  1. without install oscpack I could compile touchlib.

    But in config time an error…
    :~/touchlib/src$ ./configapp
    . . . . . . .
    HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
    Unable to stop the stream.: Bad file descriptor
    HIGHGUI ERROR: V4L: Pixel format of incoming image is unsupported by OpenCV

  2. Hello i tried to do it but found some error.

    I install extra packets from instruction in http://paraisolinux.com/superficie-multitouch-casera-para-linux/

    aptitude install libavcodec52 libjasper1 libdc1394-22 libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev libtiff4 libtiff4-dev zlib1g zlib1g-dev python-opencv

    :~/oscpack$ make
    g++ -o bin/OscUnitTests tests/OscUnitTests.o osc/OscOutboundPacketStream.o osc/OscTypes.o osc/OscReceivedElements.o osc/OscPrintReceivedElements.o
    g++ -o bin/OscSendTests tests/OscSendTests.o osc/OscOutboundPacketStream.o osc/OscTypes.o ip/posix/NetworkingUtils.o ip/posix/UdpSocket.o ip/IpEndpointName.o
    g++ -o bin/OscReceiveTest tests/OscReceiveTest.o osc/OscTypes.o osc/OscReceivedElements.o osc/OscPrintReceivedElements.o ip/posix/NetworkingUtils.o ip/posix/UdpSocket.o
    g++ -o bin/OscDump examples/OscDump.o osc/OscTypes.o osc/OscReceivedElements.o osc/OscPrintReceivedElements.o ip/posix/NetworkingUtils.o ip/posix/UdpSocket.o

    :~/oscpack$ sudo make install
    g++ -shared -Wl,-soname,liboscpack.so -o liboscpack.so.1.0.2 ./ip/IpEndpointName.o ./ip/posix/NetworkingUtils.o ./ip/posix/UdpSocket.o ./osc/OscOutboundPacketStream.o ./osc/OscPrintReceivedElements.o ./osc/OscReceivedElements.o ./osc/OscTypes.o -lc
    /usr/bin/ld: ./ip/IpEndpointName.o: relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
    ./ip/IpEndpointName.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make: *** [liboscpack.so.1.0.2] Error 1

  3. Hello, i tried to do it on Linux 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 GNU/Linux but i found an error and many warning

    :~/oscpack$ make
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o tests/OscUnitTests.o tests/OscUnitTests.cpp
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o osc/OscOutboundPacketStream.o osc/OscOutboundPacketStream.cpp
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o osc/OscTypes.o osc/OscTypes.cpp
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o osc/OscReceivedElements.o osc/OscReceivedElements.cpp
    osc/OscReceivedElements.cpp: In function ‘osc::int64 osc::ToInt64(const char*)’:
    osc/OscReceivedElements.cpp:142: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:143: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:144: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:145: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp: In function ‘osc::uint64 osc::ToUInt64(const char*)’:
    osc/OscReceivedElements.cpp:166: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:167: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:168: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:169: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp: In member function ‘osc::int64 osc::ReceivedMessageArgument::AsInt64Unchecked() const’:
    osc/OscReceivedElements.cpp:142: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:143: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:144: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:145: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp: In member function ‘osc::int64 osc::ReceivedMessageArgument::AsInt64() const’:
    osc/OscReceivedElements.cpp:142: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:143: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:144: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:145: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp: In member function ‘osc::uint64 osc::ReceivedMessageArgument::AsTimeTagUnchecked() const’:
    osc/OscReceivedElements.cpp:166: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:167: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:168: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:169: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp: In member function ‘osc::uint64 osc::ReceivedBundle::TimeTag() const’:
    osc/OscReceivedElements.cpp:166: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:167: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:168: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:169: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp: In member function ‘osc::uint64 osc::ReceivedMessageArgument::AsTimeTag() const’:
    osc/OscReceivedElements.cpp:166: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:167: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:168: warning: array subscript is above array bounds
    osc/OscReceivedElements.cpp:169: warning: array subscript is above array bounds
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o osc/OscPrintReceivedElements.o osc/OscPrintReceivedElements.cpp
    g++ -o bin/OscUnitTests tests/OscUnitTests.o osc/OscOutboundPacketStream.o osc/OscTypes.o osc/OscReceivedElements.o osc/OscPrintReceivedElements.o
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o tests/OscSendTests.o tests/OscSendTests.cpp
    tests/OscSendTests.cpp: In function ‘int main(int, char**)’:
    tests/OscSendTests.cpp:193: warning: deprecated conversion from string constant to ‘char*’
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o ip/posix/NetworkingUtils.o ip/posix/NetworkingUtils.cpp
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o ip/posix/UdpSocket.o ip/posix/UdpSocket.cpp
    ip/posix/UdpSocket.cpp: In member function ‘void SocketReceiveMultiplexer::Implementation::Run()’:
    ip/posix/UdpSocket.cpp:431: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result
    ip/posix/UdpSocket.cpp: In member function ‘void SocketReceiveMultiplexer::Implementation::AsynchronousBreak()’:
    ip/posix/UdpSocket.cpp:481: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o ip/IpEndpointName.o ip/IpEndpointName.cpp
    g++ -o bin/OscSendTests tests/OscSendTests.o osc/OscOutboundPacketStream.o osc/OscTypes.o ip/posix/NetworkingUtils.o ip/posix/UdpSocket.o ip/IpEndpointName.o
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o tests/OscReceiveTest.o tests/OscReceiveTest.cpp
    g++ -o bin/OscReceiveTest tests/OscReceiveTest.o osc/OscTypes.o osc/OscReceivedElements.o osc/OscPrintReceivedElements.o ip/posix/NetworkingUtils.o ip/posix/UdpSocket.o
    g++ -Wall -O3 -I./ -DOSC_HOST_LITTLE_ENDIAN -c -o examples/OscDump.o examples/OscDump.cpp
    g++ -o bin/OscDump examples/OscDump.o osc/OscTypes.o osc/OscReceivedElements.o osc/OscPrintReceivedElements.o ip/posix/NetworkingUtils.o ip/posix/UdpSocket.o

    :~/oscpack$ sudo make install
    g++ -shared -Wl,-soname,liboscpack.so -o liboscpack.so.1.0.2 ./ip/IpEndpointName.o ./ip/posix/NetworkingUtils.o ./ip/posix/UdpSocket.o ./osc/OscOutboundPacketStream.o ./osc/OscPrintReceivedElements.o ./osc/OscReceivedElements.o ./osc/OscTypes.o -lc
    /usr/bin/ld: ./ip/IpEndpointName.o: relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
    ./ip/IpEndpointName.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make: *** [liboscpack.so.1.0.2] Error 1

Leave a Reply

Your email address will not be published. Required fields are marked *