PDA

View Full Version : /etc/pointercal problem



hvreddy1110
26th September 2006, 14:21
Hi All,
I cross compiled qt/Embedded for my ARM11 board using ltib.
It has compiled fine.
Even i cross compiled a small helloworld application for ARM11.
When i run my application it is giving following error message.

1.My programm.


#include <qapplication.h>
#include <qlabel.h>

int main( int argc, char* argv[] )
{
QApplication myapp( argc, argv );

QLabel* mylabel = new QLabel( "Hello world", 0 );

myapp.setMainWidget( mylabel );
mylabel->show();
return myapp.exec();
}

I crosscompiled using

arm-linux-g++ -Wall -I/home/harsha/Desktop/IMX_INSTALL2/ltib-imx31ads-20060709/rootfs/usr/include -L/home/harsha/Desktop/IMX_INSTALL2/ltib-imx31ads-20060709/rootfs/usr/lib -lqte -ljpeg -o hello main.cpp

When i run
./hello -qws on target system it is giving following error

could not read calibration : /etc/pointercal
segmentation fault.

Infact i made QTDIR and LD_LIBRARY_PATH to point qtdirectory and qtlibs respectively.
Any thing i need to do before running my application.


Thanks in advance,

Regards,
Harsha

jacek
26th September 2006, 15:34
could not read calibration : /etc/pointercal
Does this file exist?

hvreddy1110
26th September 2006, 16:20
Hi Thanks for ur reply.
No.there is no etc/pointercal file .
How can i generate it?

Thanks and regards,
Harsha

jacek
26th September 2006, 16:39
How can i generate it?
Google says something about ts_calibrate and tslib, but if you know the magic numbers your can write it yourself.

hvreddy1110
26th September 2006, 17:05
Hi,
As per i know tslib and ts_calibrate are used when we are using touch screen
But i am not using touch screen feature.

Thanks in advance,
Regards,
Harsha

jacek
26th September 2006, 17:16
As per i know tslib and ts_calibrate are used when we are using touch screen
But i am not using touch screen feature.
It looks like Qt/Embedded thinks you have a touch screen. Maybe you should reconfigure it then?

sar_van81
12th February 2007, 07:37
hi ,

i had cross compiled qt/embedded for Blackfin board(bf537) with mouse support.its working fine. but now i had connected Micro touch screen to the board. can anyone say me how to use the touch screen with the qt applicaitons ? from the above posts it seems first i should compile tslib package and then i should link that to qt/embedded while configuring..? are these steps correct ? or is there any other way ?if so please let me know?

thanks in advance,
saravanan

ardvark
7th December 2010, 16:26
The format of pointer cal is as follows,
xscale xymix xoffset yxmix yscale yoffset scaler

After these seven numbers, I have a null and two other values which I don't know what they do. The pointercal is only used for module linear (/etc/ts.conf). You can see the source here,

https://github.com/kergoth/tslib/blob/a362845b3ca6d32ff1fe1dec333606916c71cfde/plugins/linear.c

Here is another formula without array values,

Xs -> x screen value, Xt -> x touch value, Ys, Yt similar.

Xs = (Xt*xscale + Yt*xymix + xoffset)/scaler
Ys = (Xt*yxmix + Yt*yscale + yoffset)/scaler

This is an affine transform (or subset as the 'Xt*Yt' is not used). If your touch is capacitive it may be quite linear. Resistive touch screens usually need individual calibration, may drift over time/temperature and are likely to need re-calibration at some point.

The format of pointer cal is as follows,
xscale xymix xoffset yxmix yscale yoffset scaler

After these seven numbers, I have a null and two other values which I don't know what they do. The pointercal is only used for module linear (/etc/ts.conf). You can see the source here,

https://github.com/kergoth/tslib/blob/a362845b3ca6d32ff1fe1dec333606916c71cfde/plugins/linear.c

Here is another formula without array values,

Xs -> x screen value, Xt -> x touch value, Ys, Yt similar.

Xs = (Xt*xscale + Yt*xymix + xoffset)/scaler
Ys = (Xt*yxmix + Yt*yscale + yoffset)/scaler

This is an affine transform (or subset as the 'Xt*Yt' is not used). If your touch is capacitive it may be quite linear. Resistive touch screens usually need individual calibration, may drift over time/temperature and are likely to need re-calibration at some point.

Added after 5 minutes:


Can anyone say me how to use the touch screen with the qt applicaitons?

Those are good steps. You may need to set these variable,

export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export QWS_MOUSE_PROTO=tslib

The first five are needed by 'tslib'. Your mouse device might be different than '/dev/input/event1'. I hope you have a frame buffer... If so set TSLIB_FBDEVICE and you should have the 'tslib' utility 'ts_calibrate'. Run that and touch the five points. If it is not working, ts_print_raw can be used to debug drivers, hardware.