public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Enrico Mattea <ocirne94@gmail.com>
To: el es <el.es.cr@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: HID device calibration - how to override mapping?
Date: Fri, 13 Jan 2012 23:19:45 +0100	[thread overview]
Message-ID: <4F10AE01.4090707@gmail.com> (raw)
In-Reply-To: <loom.20120113T175122-168@post.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]

Hi el es, thank you for your answer.

Il 13/01/2012 18:09, el es ha scritto:
>
> released - halfway - pressed
> 0 - (-32767)<->  (32767) - 0
> but does it happen in reverse order when releasing pedal ?

Yes, it does - perfect reverse order.
> seems the interpretation of this is up to the application really,
> but /if/ the -32767 to 32767 change happens all around the 'halfway'
> spot, maybe it is (in the app. engine) interpreted as 'change'
> and it's effect applied to 'car engine' not directly, but integrated
> (time-integral function applied) first ?
I don't think that the change is interpreted, because the clutch value 
seems to be computed directly, i.e. applying the app. calibration value 
on the the axis value received from the kernel;
even if I'm not completely familiar with the app.'s code, the attached 
code snippet is the interested part of the clutch handler of the app, 
and it doesn't seem to have any other function applied.
> I'd say, for the clutch simulation it's the /change-in-time/ that
> matters, not the /exact/ value; so no 'static' calibration is
> ever going to be relevant (bar maybe the device telling us when the
> pedal is fully pressed or fully released - in case app is not tracking
> it)
I agree, but trying to calibrate the axis produces the 'jump' effect 
also on the clutch value, so that either the first half of the axis 
isn't taken into account, or it produces full clutch already at halfway, 
and then value 0 after the halfway spot.

Thank you for your support,
Ocirne

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: clutch.cpp --]
[-- Type: text/x-c++src; name="clutch.cpp", Size: 431 bytes --]

		case GFCTRL_TYPE_JOY_AXIS:
			clutch = joyInfo->ax[cmd[CMD_CLUTCH].val];
			if (clutch > cmd[CMD_CLUTCH].max) {
				clutch = cmd[CMD_CLUTCH].max;
			} else if (clutch < cmd[CMD_CLUTCH].min) {
				clutch = cmd[CMD_CLUTCH].min;
			}
			car->_clutchCmd = fabs(cmd[CMD_CLUTCH].pow *
						pow(fabs((clutch - cmd[CMD_CLUTCH].minVal) /
							(cmd[CMD_CLUTCH].max - cmd[CMD_CLUTCH].min)),
						1.0f / cmd[CMD_CLUTCH].sens));
			break;

  reply	other threads:[~2012-01-13 22:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 15:46 HID device calibration - how to override mapping? Enrico Mattea
2012-01-13 17:09 ` el es
2012-01-13 22:19   ` Enrico Mattea [this message]
2012-08-08 11:45     ` Tigran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F10AE01.4090707@gmail.com \
    --to=ocirne94@gmail.com \
    --cc=el.es.cr@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox