Re: Contribue joystick mappings
Posted: Thu May 23, 2013 5:56 pm
Why's that?beat wrote: For thrust only the upper half of the stick range can be used.
Why's that?beat wrote: For thrust only the upper half of the stick range can be used.
The controller reports values between about 0x20 (right/up) and 0xE0 (left/down) on all axes. With a scale of -1 this works perfectly for pitch, roll, and yaw. For thrust, it seems the PC client does the same mapping to a signed value as for the other axes, but then only considers positive numbers as valid. All numbers reported for the lower half of the stick range (0x80 - 0xE0) are mapped to zero.allynbauer wrote:Why's that?beat wrote: For thrust only the upper half of the stick range can be used.
Code: Select all
{
"inputconfig": {
"inputdevice": {
"updateperiod": 10,
"name": "Generic_OS_X",
"axis": [
{
"scale": 1.0,
"type": "Input.AXIS",
"name": "yaw",
"key": "yaw",
"id": 0
},
{
"scale": 1.0,
"type": "Input.AXIS",
"name": "thrust",
"key": "thrust",
"id": 1
},
{
"scale": 0.5,
"type": "Input.AXIS",
"name": "roll",
"key": "roll",
"id": 2
},
{
"scale": -0.5,
"type": "Input.AXIS",
"name": "pitch",
"key": "pitch",
"id": 3
},
{
"scale": -1.0,
"type": "Input.BUTTON",
"id": 2,
"key": "pitchcal",
"name": "pitchNeg"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 0,
"key": "pitchcal",
"name": "pitchPos"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 9,
"key": "estop",
"name": "killswitch"
},
{
"scale": -1.0,
"type": "Input.BUTTON",
"id": 3,
"key": "rollcal",
"name": "rollNeg"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 1,
"key": "rollcal",
"name": "rollPos"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 8,
"key": "exit",
"name": "exitapp"
}
]
}
}
}
Indeed. The existing client assumes several things. One is that axis values will be in the range -1 to 1. Another is that the user will be using a controller which has joysticks that 'reset' to neutral/0. Since negative thrust doesn't make much sense, it is thrown out.beat wrote:For thrust, it seems the PC client does the same mapping to a signed value as for the other axes, but then only considers positive numbers as valid.
So you are saying your controller returns axis values in the (decimal) range 32-224?beat wrote:The controller reports values between about 0x20 (right/up) and 0xE0 (left/down) on all axes.
Yes.allynbauer wrote:So you are saying your controller returns axis values in the (decimal) range 32-224?
Code: Select all
{
"inputconfig": {
"inputdevice": {
"updateperiod": 10,
"name": "Logitech_F310",
"axis": [
{
"scale": -1.0,
"type": "Input.AXIS",
"name": "thrust",
"key": "thrust",
"id": 1
},
{
"scale": 1.0,
"type": "Input.AXIS",
"name": "yaw",
"key": "yaw",
"id": 0
},
{
"scale": 1.0,
"type": "Input.AXIS",
"name": "roll",
"key": "roll",
"id": 3
},
{
"scale": -1.0,
"type": "Input.AXIS",
"name": "pitch",
"key": "pitch",
"id": 4
},
{
"scale": -1.0,
"type": "Input.BUTTON",
"id": 0,
"key": "pitchcal",
"name": "pitchNeg"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 3,
"key": "pitchcal",
"name": "pitchPos"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 6,
"key": "estop",
"name": "killswitch"
},
{
"scale": -1.0,
"type": "Input.BUTTON",
"id": 2,
"key": "rollcal",
"name": "rollNeg"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 1,
"key": "rollcal",
"name": "rollPos"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 7,
"key": "exit",
"name": "exitapp"
}
]
}
}
}
This is something we have also been asking. I think the problem is the gamepad driver layer which doesn't always have rumble support. Would be great to have though.Would it be possible to turn on the vibration of the controller as soon as the red LED indicates the battery is empty? This could be very useful when flying outdoors.