evoggy / crazyflie-pc-client

Other
0 stars 1 forks source link

Axis/button ID has bad value in input mapping file #53

Open evoggy opened 10 years ago

evoggy commented 10 years ago

This was found by @hsanjuan in pull request #9.

The axis id should only be integers as represented by PyGame. Looking at this config file it looks like the wrong thing is written into the ID field (looks like the internal ID for the JoystickReader...).

The input device used was: Saitek PLC SP550 Pad and Joystick Combo

The procedure to reproduce (according to report):

I was using latest trunk in Linux. I copied one of the input config files with a new name, went to configure device mapping, selected joystick, clicked on configured, selected the new file, clicked on load so the save button would enable, configure the stuff, click on save.

#!
{
  "inputconfig": {
    "inputdevice": {
      "updateperiod": 10, 
      "name": "saitek", 
      "axis": [
        {
          "scale": -1.0, 
          "type": "Input.AXIS", 
          "name": "thrust", 
          "key": "thrust", 
          "id": 2
        }, 
        {
          "scale": 1.0, 
          "type": "Input.AXIS", 
          "name": "yaw", 
          "key": "yaw", 
          "id": "Input.AXIS-0"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.AXIS", 
          "name": "roll", 
          "key": "roll", 
          "id": 0
        }, 
        {
          "scale": -1.0, 
          "type": "Input.AXIS", 
          "name": "pitch", 
          "key": "pitch", 
          "id": 1
        }, 
        {
          "scale": -1.0, 
          "type": "Input.BUTTON", 
          "id": 2, 
          "key": "pitchcal", 
          "name": "pitchNeg"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": 3, 
          "key": "pitchcal", 
          "name": "pitchPos"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": "Input.BUTTON-Input.BUTTON-14", 
          "key": "estop", 
          "name": "killswitch"
        }, 
        {
          "scale": -1.0, 
          "type": "Input.BUTTON", 
          "id": 7, 
          "key": "rollcal", 
          "name": "rollNeg"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": 4, 
          "key": "rollcal", 
          "name": "rollPos"
        }, 
        {
          "scale": 1.0, 
          "type": "Input.BUTTON", 
          "id": "Input.BUTTON-Input.BUTTON-12", 
          "key": "exit", 
          "name": "exitapp"
        }
      ]
    }
  }
}