Forum

Full Version: eGalax touchscreen calibration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
(9th Jul, 2013 10:02 PM)bboyandru Wrote: [ -> ]
(9th Jul, 2013 09:31 PM)Markamc Wrote: [ -> ]Hi Andrei,

Nice one, I'll try it later.

How do you do the calibration, is it using a program?
It would be possible to script and inject gestures too in python at the event level, although I don't intend on doing it! (need life back!)

The reason I tried a different way was the click_confines was to small for my finger size on a 7" screen, can you change this externally, say in the calib file so I could alter the sensitivity of a touch? Saves me recompiling.

Brantje, I'm sure the calibration should'nt be off, I think the clue was the resolution of your pi, xres 1240. The 'lag' I noticed was probably due to the python error
Hi Mark!

I did my calibration in Xserver using xinput_calibrator program(you can see how I did this on my blog post at the calibration part). I am sure that this can be done as well with ts_calibrate. If you want to disable my calibration you just have to put the values from the calibration file like this:
calib_x_d=<your screen resolution width> e.g. calib_x_d=1280
calib_y_d=<your screen resolution height> e.g. calib_y_d=720
calib_x_fact=-1
calib_y_fact=-1
My projection is like this:
pointer.x = screen_width - value_read.x * calib_x_fact - calib_x_d;
pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d;
and the original code is like this:
pointer.x = value_read.x;
pointer.y = value_read.y;
I will modify the patches and add click_confines value to the calibration file this evening.

Andrei

Yep, I did it like this too , would be good to use ts_calibrate then you could call it from a xbmc plug-in, the values are easy to translate.

Your patch is also on xbian at the moment, but with the single-click disabled, I was using the calib files until I tried a different way.

I meant, I force touch events and BTN_right events outside XBMC with uimapper, if your patch is permanent then I would have conflicting events for uimapper and your hard-coded patch. Would be nice, for me anyway, to choose which way? by some a 'flag' in the calib file, maybe?
(9th Jul, 2013 10:23 PM)Markamc Wrote: [ -> ]
(9th Jul, 2013 10:02 PM)bboyandru Wrote: [ -> ]
(9th Jul, 2013 09:31 PM)Markamc Wrote: [ -> ]Hi Andrei,

Nice one, I'll try it later.

How do you do the calibration, is it using a program?
It would be possible to script and inject gestures too in python at the event level, although I don't intend on doing it! (need life back!)

The reason I tried a different way was the click_confines was to small for my finger size on a 7" screen, can you change this externally, say in the calib file so I could alter the sensitivity of a touch? Saves me recompiling.

Brantje, I'm sure the calibration should'nt be off, I think the clue was the resolution of your pi, xres 1240. The 'lag' I noticed was probably due to the python error
Hi Mark!

I did my calibration in Xserver using xinput_calibrator program(you can see how I did this on my blog post at the calibration part). I am sure that this can be done as well with ts_calibrate. If you want to disable my calibration you just have to put the values from the calibration file like this:
calib_x_d=<your screen resolution width> e.g. calib_x_d=1280
calib_y_d=<your screen resolution height> e.g. calib_y_d=720
calib_x_fact=-1
calib_y_fact=-1
My projection is like this:
pointer.x = screen_width - value_read.x * calib_x_fact - calib_x_d;
pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d;
and the original code is like this:
pointer.x = value_read.x;
pointer.y = value_read.y;
I will modify the patches and add click_confines value to the calibration file this evening.

Andrei

Yep, I did it like this too , would be good to use ts_calibrate then you could call it from a xbmc plug-in, the values are easy to translate.

Your patch is also on xbian at the moment, but with the single-click disabled, I was using the calib files until I tried a different way.

I meant, I force touch events and BTN_right events outside XBMC with uimapper, if your patch is permanent then I would have conflicting events for uimapper and your hard-coded patch. Would be nice, for me anyway, to choose which way? by some a 'flag' in the calib file, maybe?

I don't think my patch will affect forcing other inputs using uimapper. My code just skips the first point received by XBMC and use it as the previous point for distance calculation. For example, at one touch on the touchscreen, XBMC gets more than 5 events, so ignoring the first one wouldn't be a problem.
Please have a look at my description from the blog post:
Quote:After I have successfully calibrated the touchscreen I have discovered that single click was not possible from the touchscreen, just double click. After digging through the code, I have found that this was caused by drag action which was triggered because the previous values of the touch were far(more than 5 pixels) from a new press. For example, at the start of the program, cursor is set at 0,0 coordinates; if user is trying to press a button, let's say at 100, 300, the program(XBMC) will calculate the distance between these two points and will find out that this is greater than 5.
Pythagorean theory:
(100-0)x(100-0) + (300 - 0)x(300-0) is greater than 5x5 so XBMC will treat this as a drag event.

This drag issue is not caused when you double click, because the previous point in the second click action is very close to the second click point. This also works for mouses, because the previous value of the pointer is always very close to the new value of the pointer(because mouse's pointer drags on the screen and it doesn't jump - so each new value is very close to the previous one).

Andrei
Done: https://github.com/brantje/xbian-touch

Read the read me *duh* and follow instructions

This uses Markamc's method.
Nice work, thanks Brantje for your help. It's good to see all this development on this forum and be part of it!

cheers

mark

(9th Jul, 2013 11:07 PM)bboyandru Wrote: [ -> ]
(9th Jul, 2013 10:23 PM)Markamc Wrote: [ -> ]
(9th Jul, 2013 10:02 PM)bboyandru Wrote: [ -> ]
(9th Jul, 2013 09:31 PM)Markamc Wrote: [ -> ]Hi Andrei,

Nice one, I'll try it later.

How do you do the calibration, is it using a program?
It would be possible to script and inject gestures too in python at the event level, although I don't intend on doing it! (need life back!)

The reason I tried a different way was the click_confines was to small for my finger size on a 7" screen, can you change this externally, say in the calib file so I could alter the sensitivity of a touch? Saves me recompiling.

Brantje, I'm sure the calibration should'nt be off, I think the clue was the resolution of your pi, xres 1240. The 'lag' I noticed was probably due to the python error
Hi Mark!

I did my calibration in Xserver using xinput_calibrator program(you can see how I did this on my blog post at the calibration part). I am sure that this can be done as well with ts_calibrate. If you want to disable my calibration you just have to put the values from the calibration file like this:
calib_x_d=<your screen resolution width> e.g. calib_x_d=1280
calib_y_d=<your screen resolution height> e.g. calib_y_d=720
calib_x_fact=-1
calib_y_fact=-1
My projection is like this:
pointer.x = screen_width - value_read.x * calib_x_fact - calib_x_d;
pointer.y = screen_height - value_read.y * calib_y_fact - calib_y_d;
and the original code is like this:
pointer.x = value_read.x;
pointer.y = value_read.y;
I will modify the patches and add click_confines value to the calibration file this evening.

Andrei

Yep, I did it like this too , would be good to use ts_calibrate then you could call it from a xbmc plug-in, the values are easy to translate.

Your patch is also on xbian at the moment, but with the single-click disabled, I was using the calib files until I tried a different way.

I meant, I force touch events and BTN_right events outside XBMC with uimapper, if your patch is permanent then I would have conflicting events for uimapper and your hard-coded patch. Would be nice, for me anyway, to choose which way? by some a 'flag' in the calib file, maybe?

I don't think my patch will affect forcing other inputs using uimapper. My code just skips the first point received by XBMC and use it as the previous point for distance calculation. For example, at one touch on the touchscreen, XBMC gets more than 5 events, so ignoring the first one wouldn't be a problem.
Please have a look at my description from the blog post:
Quote:After I have successfully calibrated the touchscreen I have discovered that single click was not possible from the touchscreen, just double click. After digging through the code, I have found that this was caused by drag action which was triggered because the previous values of the touch were far(more than 5 pixels) from a new press. For example, at the start of the program, cursor is set at 0,0 coordinates; if user is trying to press a button, let's say at 100, 300, the program(XBMC) will calculate the distance between these two points and will find out that this is greater than 5.
Pythagorean theory:
(100-0)x(100-0) + (300 - 0)x(300-0) is greater than 5x5 so XBMC will treat this as a drag event.

This drag issue is not caused when you double click, because the previous point in the second click action is very close to the second click point. This also works for mouses, because the previous value of the pointer is always very close to the new value of the pointer(because mouse's pointer drags on the screen and it doesn't jump - so each new value is very close to the previous one).

Andrei

Ok, Andrei, I understand completely , I've been using it for a while, I was just a bit worried that my forced events may affect your code too. If I stop uimapper, then i use your hard-coded calibration routine and calib-file. Uimapper does the translations at event level for a user-generated input-device using the /etc/pointercal file generated, after ts_calibrate is executed. ts_calibrate also uses a component of x and y in both x and y compensations to allow for linear mis-alignment of touchscreen, although I haven't implemented use yet, but you could very easily, in your code , if you wish.
Hi!

I have added click_confines to the calibration file and I have created a single patch for all fixes. I can confirm that a value of 8 for cick_confines makes the touch verry sensitive, although I have a film over the touch screen the touch behaves verry close to a capacitive one. I will make a video soon.
You can download the patch from here

Best Regards,
Andrei
I spoke with Koenkk, and a patch for xbmc would be the best option.
Do we still have a right click then?


Updates xbian skin also abit more for touch
Also, if users wants mark's method then they should have an option to use it.
Hi!

Check out my new video with XBMC12.2 and my new skin(designed for use in cars), which is work in progress.

https://www.youtube.com/watch?v=d7uRCweGXP0

Best Regards,
Andrei
Good effort , really nice interface..

I'll give yours a try, have you got an img file to test (latest) or should I compile with patches? or is it in xbian yet?

cheers
mark
(13th Jul, 2013 03:05 AM)Markamc Wrote: [ -> ]Good effort , really nice interface..

I'll give yours a try, have you got an img file to test (latest) or should I compile with patches? or is it in xbian yet?

cheers
mark

Hi

I have uploaded my image at https://drive.google.com/uc?id=0B__Rs5JF53-kU09ENm5aSm1kc1U&export=download

Andrei
Many thanks Andrei, i'll give it a go now and give some feedback

Been looking into swipe? looking for an event type to inject at kernel level...not sure at this stage whether possible for 12.2 maybe better suited to gotham. New to all this still

atb
mark
Hi Andrei,

Interface looks good. I tried my old touchscreen_calib file and it didn't work, I check against yours and can see that you have changed the transformation equations. No problem I can set them right. I tried to install ts_calibrate to see if i could get the swap etc and some feedback once exiting from xbmc but the screen was black.

I think you have a good solution and if I can help you in anyway let me know.
I think it would be good if you use the tslib to generate your calib file, then it is more automatic, I can help you if you like, only by showing you how I managed

What I will try to do, this weekend is recompile your patches into XBMC (xbian) maybe? and see if I can get it to work, for me of course..or maybe Brantje could too.

Another idea I was looking at was Opengalax, the guy had a serial comms touchscreen and wrote a user-input driver, I couldn't convert it, but with your knowledge it would be a piece of cake
HI all!! Are there any news about the project? There are a definitive patch or method?
brantje the skin is very good!! are there update about this?
(13th Jul, 2013 02:33 AM)bboyandru Wrote: [ -> ]Hi!

Check out my new video with XBMC12.2 and my new skin(designed for use in cars), which is work in progress.

https://www.youtube.com/watch?v=d7uRCweGXP0

Best Regards,
Andrei
Can you put the skin on github?

(28th Jul, 2013 09:47 PM)raspuca Wrote: [ -> ]HI all!! Are there any news about the project? There are a definitive patch or method?
brantje the skin is very good!! are there update about this?
The xbian skin?
I talk about this Smile
http://puu.sh/3AsSY.jpg
That is the xbian skin =)
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Reference URL's