Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to SDL2 for Joystick Handling #4110

Merged
merged 10 commits into from
Oct 10, 2016
Merged

Conversation

rjehangir
Copy link
Contributor

This PR updates the Simple DirectMedia Layer (SDL) library from 1.2 to 2.0.4. SDL is used for cross-platform joystick handling in QGroundControl and upgrading to SDL2 adds new and improved functionality.

It enables the following features to be implemented:

  • Stick/button consistency across OSes (already implemented)
  • With the stick/button consistency, we can eventually get rid of the need for a calibration process entirely and you can just choose Mode 1-4 instead
  • Hotplugging of joystick devices so you can plug in after starting QGC or if your Xbox controller disconnects you don't have to restart QGC entirely. This will also stop the MANUAL_CONTROL messages from continuing when the joystick is unplugged.
  • Battery monitoring for wireless game controllers

There are a few important consequences of this update as well:

  • On all OSes, the joystick and button mappings will change, requiring the user to recalibrate. I've included code to check and require a recalibration if the user has upgraded from an earlier SDL version.

This is a relatively simple PR that shifts over the current functionality, and we will implement the other features in the future.

This has been tested on Mac OSX, Ubuntu 14.04, and Windows 10.

Also note that this update uses the SDL_GameControllerDB source, which is copied into the resources folder. This code uses the exact same license as SDL itself and the license text is included in that folder, per license requirements.

Please let me know if you have any questions, comments, or concerns about this PR.

-Rusty

@DonLakeFlyer
Copy link
Contributor

Thanks a ton Rusty.

@DonLakeFlyer DonLakeFlyer merged commit 24596a5 into mavlink:master Oct 10, 2016
@rjehangir rjehangir deleted the sdl2 branch October 10, 2016 19:32
@rjehangir
Copy link
Contributor Author

Thanks, Don!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants