Board index FlightGear Support Hardware

Joystick xml binding power decimal?

Joysticks, pedals, monitors.

Joystick xml binding power decimal?

Postby mathieugouin » Fri Mar 08, 2019 2:51 am

Hello,

I'm tweaking my joystick xml and I stumbled on what seems contradictory references.

I would like to know if I can put something like this (notice power = 1.5):

Code: Select all
    <axis n="0">
        <desc>Aileron</desc>
        <dead-band type="double">0.0</dead-band>
        <binding>
            <command>property-scale</command>
            <property>/controls/flight/aileron</property>
            <offset type="double">0.0</offset>
            <factor type="double">0.6</factor>
            <power type="double">1.5</power>
        </binding>
    </axis>


From: http://wiki.flightgear.org/Writing_Joys ... de:_Part_1 (seems to be decimal)
<power ...... : Sometimes the axes are too sensitive - a slight touch on aileron makes the plane barrel-roll. You can reduce this sensitivity by making the value of power more than 1. (It is a decimal number, so you can make small adjustments, but small adjustments are usually not enough to be noticible.) Never mind the maths, but the larger the value of power the less sensitive the aircraft will be to axis movement.


From: http://wiki.flightgear.org/Bindings#property-scale (seems to be integer only)
power: the resulting value will be taken to the power of this integer value (overrides squared).


Thanks!
Mathieu
mathieugouin
 
Posts: 36
Joined: Thu Jan 06, 2011 3:37 am
Location: CYHU
Callsign: MGOUIN
Version: V2018.1.1
OS: Lubuntu 18.04

Re: Joystick xml binding power decimal?

Postby mathieugouin » Mon Mar 11, 2019 2:21 am

Based on some more tests, it seems to only allow for integer (a rounding seems to occur), but I would have liked to have developer confirmation on this...
Mathieu
mathieugouin
 
Posts: 36
Joined: Thu Jan 06, 2011 3:37 am
Location: CYHU
Callsign: MGOUIN
Version: V2018.1.1
OS: Lubuntu 18.04

Re: Joystick xml binding power decimal?

Postby wkitty42 » Fri Mar 15, 2019 2:47 pm

i'm not a developer but i will state the following:
  • decimal numbers are base 10.
  • integers are decimal numbers which are whole numbers.
  • decimal numbers use a decimal point if they are fractional numbers.
i write the above because it seems that you are confusing a decimal number with one requiring a decimal point... yes, it would be better/clearer if the "writing joystick code" wiki link used the term "integer" instead of "decimal number" but i can understand it being written that way so as to distinguish between decimal, hexadecimal and octal numbering schemes...

another possible clue that it is an integer may be because it is used as a power since it overrides the square power seemingly indicated by the comment in the "bindings#propertyscale" quote...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5328
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Joystick xml binding power decimal?

Postby mathieugouin » Sun Mar 17, 2019 8:11 pm

Thanks for the response, however, a power is perfectly valid "mathematically" to be fractional (or even irrational ;) ). Reference: http://mathworld.wolfram.com/Power.html

My question was in hoping I could have put a power of something like 1.5 because I find that linear (power = 1) is too sensitive in the middle, vs square (power = 2) is too steep at the end.

Could this be added as a suggestion? The c pow function (I assume this is the one used in the code, I did not look) supports that: http://pubs.opengroup.org/onlinepubs/00 ... s/pow.html

Thanks anyway :)
Mathieu
mathieugouin
 
Posts: 36
Joined: Thu Jan 06, 2011 3:37 am
Location: CYHU
Callsign: MGOUIN
Version: V2018.1.1
OS: Lubuntu 18.04

Re: Joystick xml binding power decimal?

Postby wkitty42 » Mon Mar 18, 2019 3:05 pm

you are correct about power values...

what happens when you test with 1.5??
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5328
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Joystick xml binding power decimal?

Postby mathieugouin » Mon Mar 18, 2019 11:10 pm

It seems to behave like power = 1 (linear). A floor operation seems to be done. I even tried 1.99.

Thanks!
Mathieu
mathieugouin
 
Posts: 36
Joined: Thu Jan 06, 2011 3:37 am
Location: CYHU
Callsign: MGOUIN
Version: V2018.1.1
OS: Lubuntu 18.04

Re: Joystick xml binding power decimal?

Postby Johan G » Sat Jun 01, 2019 4:42 pm

I have unsuccessfully tried to find the code that read the joystick configuration file, looking for what data type it for sure is, but the closest I get is flightgear/src/Input/FGJoystickInput.cxx which is not the right place.

Not being a programmer and not having looked around in the code base for two years does not really help either. :roll:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5414
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit


Return to Hardware

Who is online

Users browsing this forum: No registered users and 1 guest