Calibration of inputdevices

An embedded and charset-unspecified text was scrubbed…
Name: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031120/bc2450db/attachment.asc

If you are using only the joystick device (joydev module & /dev/js*)
then you can use the jscal program to calibrate and restore the
settings.

If your kernel uses event devices (evdev module & /dev/input/event*)
which is the 1st choice in SDL then you can’t calibrate the joystick.
It is supposed to autocalibrate joysticks.

Hopefully, there will be a calibration method for event devices in the
future.

I have a prolem with my Saitek Cyborg 3D, the axes go from -29000 to
20000 instead of -32767 to 32767. Using jscal fixes the range but
screws the rest/centre point to -5000. So I made a spreadsheet and
combined the calibrated min and max with uncalibrated centre and
deadzone…On Thu, 2003-11-20 at 21:54, Anders Folkesson wrote:

Hello!
I just got myself an usb joypad. It works fine except it is a bit miscalibrated under linux. If i calibrate it under windows it is okay in win. But when testing it with .i.e SDLJoytest one clearly sees that it is a bit upp/left.
My quetion is now, how does one calibrate an input device in linux…or rather, is this something that each program should take care of or is it something for the usb device drivers?

Sorry if this is a bit off topic but i have to start somewhere :wink:


Alan.

“One must never be purposelessnessnesslessness.”
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031120/7d630f22/attachment.pgp

can you send me some screen shots and some more details on your joystick, and
I’ll see what I can do for calibration towards that,

Also give SDLJoytest-GL a try as it has many bug fixes.

right now the range for the axes in SDLJoytest are hardcoded at 65534, w/ a
zero for middle (-32767 -> 0 -> 32767) and there may be a problem w/ this.
(it was something I was worried about, but I’ve only got 3 joysticks/pads to
test w/ so…)

The next release will include user config file and a global config file.

but hey! I’m glad to see people giving my stuff a try! thanks a bunch!
Samuel E. BrayOn Thursday 20 November 2003 1:54 pm, Anders Folkesson wrote:

Hello!
I just got myself an usb joypad. It works fine except it is a bit
miscalibrated under linux. If i calibrate it under windows it is okay in
win. But when testing it with .i.e SDLJoytest one clearly sees that it is a
bit upp/left. My quetion is now, how does one calibrate an input device in
linux…or rather, is this something that each program should take care of
or is it something for the usb device drivers?

Sorry if this is a bit off topic but i have to start somewhere :wink:

–Anders Folkesson


Get your free web-based e-mail account from http://www.Math.net
Your online tourguide of Mathematics, with books, links, news,
message boards, and much more!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety. "
–Benjamin Franklin

great, I’m just trying to make the most robust code I can, the more feedback
the better.

After this I plan on adding calibration to the program, (jscal style)

here’s what the Linux kernel documentation has to say about it.

(only an excerpt about calibration from
/usr/src/linux/Documentation/input/joystick.txt )

*** Begin Paste ***

2.6. Calibration~~~~~~~~~~~~~~~~
For most joysticks you won’t need any manual calibration, since the
joystick should be autocalibrated by the driver automagically. However, with
some analog joysticks, that either do not use linear resistors, or if you
want better precision, you can use the jscal program

    jscal -c /dev/js0

included in the joystick package to set better correction coefficients than
what the driver would choose itself.

After calibrating the joystick you can verify if you like the new
calibration using the jstest command, and if you do, you then can save the
correction coefficients into a file

    jscal -p /dev/js0 > /etc/joystick.cal

And add a line to your rc script executing that file

    source /etc/joystick.cal

This way, after the next reboot your joystick will remain calibrated. You
can also add the jscal -p line to your shutdown script.

*** End Paste ***

On Friday 21 November 2003 12:58 am, you wrote:

Hi!
Thanks for your reply.
There is nothing wrong with your program actually, at least not in my case.
The joypad is just not calibrated good enaough.
I like the program though :slight_smile:

–Anders Folkesson

— Samuel <@Samuel_E_Bray> wrote:
can you send me some screen shots and some more details on your joystick,
and I’ll see what I can do for calibration towards that,

Also give SDLJoytest-GL a try as it has many bug fixes.

right now the range for the axes in SDLJoytest are hardcoded at 65534, w/ a
zero for middle (-32767 -> 0 -> 32767) and there may be a problem w/ this.
(it was something I was worried about, but I’ve only got 3 joysticks/pads
to test w/ so…)

The next release will include user config file and a global config file.

but hey! I’m glad to see people giving my stuff a try! thanks a bunch!
Samuel E. Bray

On Thursday 20 November 2003 1:54 pm, Anders Folkesson wrote:

Hello!
I just got myself an usb joypad. It works fine except it is a bit
miscalibrated under linux. If i calibrate it under windows it is okay in
win. But when testing it with .i.e SDLJoytest one clearly sees that it is
a bit upp/left. My quetion is now, how does one calibrate an input device
in linux…or rather, is this something that each program should take
care of or is it something for the usb device drivers?

Sorry if this is a bit off topic but i have to start somewhere :wink:

–Anders Folkesson


Get your free web-based e-mail account from http://www.Math.net
Your online tourguide of Mathematics, with books, links, news,
message boards, and much more!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety. "
–Benjamin Franklin