Modified FreeFlight 2.4.10 APK with game controller support

iOS Apps and Games for the AR.Drone. General Android discussions.

What should be the X button "secret feature"?

absolute control toggle
3
14%
return home
10
48%
map view
0
No votes
flat trim
0
No votes
emergency
7
33%
other (post your suggestion below)
1
5%
 
Total votes: 21

User avatar
krfanning
Ready for take off
Posts: 32
Joined: 22 Jul 2015, 08:29
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with full controller supp

Post by krfanning » 29 Apr 2016, 23:57

Darklo wrote:Hey Eric, I'm glad you like it :D

Regarding ps3 controller, I don't own one, so I can't say for sure. I remember reading somewhere that your device needs to be rooted, but that information might be outdated. Basically, if your controller works in other apps or games natively (i.e., without emulating touchscreen), it should work. (It would work with touchscreen emulation too, but then the official app would work just as well).

Making control smoother is at the top of my list. I'm thinking of using getFlat() method to determine deadzone instead of using a hardcoded value and making the output non-linear. It should improve precision and smoothness at low speeds.
This picture should explain it better:
joystick_curves.gif
Figure 1: joystick response as implemented by Parrot
Figure 2: what it should look like
I am using this app, and a PS3 controller, and most of the functions are enabled. It flies well...maybe an update for programming the controller our way? Thanks for the app...GREAT JOB!!
One day I will own a REAL drone...

User avatar
krfanning
Ready for take off
Posts: 32
Joined: 22 Jul 2015, 08:29
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by krfanning » 30 Apr 2016, 00:02

Forgot to tell you, the PS3 controller has to be connected to Android via USB to go cable. Go here:
http://buy.thegameklip.com/
Comes with the cable, abd a clip that fastens to the PS3 controller, so you can attach your phone together with the controller easily. Hope this helps,
K
One day I will own a REAL drone...

webvan
Ready for take off
Posts: 27
Joined: 01 Aug 2013, 23:46
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by webvan » 10 Jun 2016, 14:35

Ah yes I was wondering if there was an accessory to hold a smartphone. Not cheap at $20 though, might as well by a Mad Catz and have an extra controller...

webvan
Ready for take off
Posts: 27
Joined: 01 Aug 2013, 23:46
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by webvan » 11 Jun 2016, 11:04

Been flying a bit more, any chance of the X allowing for the toggle of the "Asbolute" mode ? Could come in handy in case you lose the plot !

l3fty999
Newcomer
Posts: 1
Joined: 20 May 2016, 06:31
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by l3fty999 » 13 Jun 2016, 21:49

krfanning wrote:Forgot to tell you, the PS3 controller has to be connected to Android via USB to go cable. Go here:
http://buy.thegameklip.com/
Comes with the cable, abd a clip that fastens to the PS3 controller, so you can attach your phone together with the controller easily. Hope this helps,
K

I have a bluetooth PS3 controller that works just great without the cord using the sixaxis controller app. The only thing I needed the cable for was the initial pairing and recharging. And yes, I had to root my tablet to make the controller and sixaxis work.

rikm1
Newcomer
Posts: 2
Joined: 20 Jun 2016, 13:27
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by rikm1 » 21 Jun 2016, 07:27

Just want to say a big thankyou for this update. It works great with the Ipega 9023 gamepad and z3 compact tablet.
The whole experience with my ar.drone 2.0 has gone up by 50%.

For those reading this forum for this first time the home +x button is used to connect to your tablet.

thanks again

webvan
Ready for take off
Posts: 27
Joined: 01 Aug 2013, 23:46
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by webvan » 21 Jun 2016, 08:02

Great modified app indeed but I've found a few issues :
- sometimes stays stuck on the "loading" screen (before you get the video feed), can't figure out why
- the ARDrone has a "rough" behaviour, especially in "hover on" mode when you let go of the stick. I thought that was normal until I tried the AR.Pro app that offers much smoother flying for some reason. Both apps running on default settings.

CmdrPsyco
Newcomer
Posts: 1
Joined: 11 Aug 2016, 07:49
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by CmdrPsyco » 11 Aug 2016, 07:55

A great feature would be - now that the hands are free - a sbs view of the video stream.
I think it should be possible to set up a button for SBS on/off in the preferences in order to use the drone with cardboard or similar.
What do you think about this?

rael81
Newcomer
Posts: 1
Joined: 13 Oct 2016, 17:21
Drone Type: AR.Drone

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by rael81 » 13 Oct 2016, 18:08

Hey Darklo, this is great work. I have some questions, because i want to modify an apk with an existing controller support, just changing the controller configuration. Could you send me an email to gw82@arcor.de ?

Thank you so much...

DEMasar
Newcomer
Posts: 1
Joined: 20 Mar 2017, 01:12
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by DEMasar » 20 Mar 2017, 01:22

I was wondering if someone could post a link for the app? Dropbox link isn't working for me. Thanks in advance.

Mazllus
Ready for take off
Posts: 10
Joined: 29 Mar 2017, 10:32
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by Mazllus » 29 Mar 2017, 10:44

Darklo wrote:TL/DR version:
FreeFlight 2.4.10 app modified with controller support and hover lock toggle, plus several fixes.


Get the APK here: https://db.tt/3dLyJPHi

(updated 12/03/2015)



The only reason Parrot keeps selling ARD 2.0 at this late stage in its lifecycle is because it fills the price gap between the Bebop and Rolling Spider.
It should be pretty obvious that there aren't going to be any more updates, neither firmware nor an app.
Director Mode on Android has been "coming soon" for what, 16 months now? At this point it should be rather "not coming, ever", and the FreeFlight app is now more or less in abandonware territory. But even though there are a number of excellent alternatives, if it could be improved, it could offer a lot of value.

So I thought it would be a good idea for the community to take over the development of the FreeFlight app and fix some of the longstanding bugs and introduce a couple of new features. Thanks to the amazing tools — smali and apktool — we're now able to freely modify the app and do (almost) anything. Editing smali code is very different from normal Java programming, and is a lot like assembly — you deal with registers instead of variables and control flow is affected by goto's and if-zero or if-not-zero jumps. But you can learn a lot about internal workings of Dalvik VM, and I actually had a lot of fun breaking the app apart and modifying it to my liking.
  • One feature that is an absolute must is hardware controller support (see controller mapping below). As it turns out, FreeFlight fully supports game controllers, as long as it runs on Nvidia Shield. There is literally a function isNvidiaShield() that is called every time a joystick or button event is processed:

    Code: Select all

        private boolean isNvidiaShield() {
            return Build.MODEL.equals("SHIELD") ? true : false;
        }
    As you probably guessed, if your device doesn't happen to be Shield, joystick movements and button presses are simply ignored. Well, that is simply ridiculous and our device choices should not be limited by Parrot's exclusive partnerships.
    Fortunately, it's also ridiculously easy to patch. The easy way, of course, would be to write "return true", but that wouldn't be very interesting. Better solution is to detect whether controller is plugged in when app is launched. Even better is to watch for hardware changes at runtime and modify the return value when controller is connected.
    As two added bonuses, you get a different splash screen if you start the app with controller; the touch screen controls react to controller presence and disappear as necessary (it's only a transparency change, so it's still possible to fly using touchscreen with controller connected).
  • Even if you have a Shield, you've probably noticed that joystick deadzone is very large (0.3 out of 1). If you push the stick slightly, nothing happens. If you push more, the drone suddenly lurches forward. As a result, controlling the drone becomes more difficult than it should be.
    Again, this is easy to patch. In this version hardcoded deadzone is removed, and the code relies on the value provided by Android. In addition, joystick response curves are now non-linear, improving precision at low speeds.
  • Another issue that also affects Shield owners is that the left stick is disabled in accelerometer mode (when you press and hold the shoulder button). This is correct if pitch/roll stick is on the left, but in left-handed mode this prevents you from controlling yaw and altitude, so this artificial limitation is also patched out.
  • Unlike touchscreen controls, where you can keep the finger on the roll/pitch button as the drone flies level, there is no equivalent for hardware controller. Well, here is a first: FreeFlight app with hover lock toggle! Click the pitch/roll thumbstick (left or right, depending on your settings) and the drone will no longer overcorrect as you release the stick, instead it will continue to glide smoothly. Click the stick again to turn hover lock back on. You'll see a brief message "Hover ON" (or "OFF"), so it's easy to tell which mode is active.

Here is a complete list of changes:
  1. increased max zoom in map downloader from 16x to 19x
  2. reduced joystick dead zone from 0.3 to 0.075
  3. increased param:video:codec_fps from 25 to 30 and param:video:max_bitrate from 1500 to 4000
  4. keep gas/yaw stick active in accelerometer mode (when shoulder button is pressed, in left-handed mode)
  5. added listener to detect controller presence and toggle controller mode (isNvidiaShield()) at runtime
  6. restored data collection opt-out setting
  7. added hover toggle to pitch/roll thumb stick
New in 20150312 version:
  1. fixed blurry photos in the photo/video viewer
  2. improvements to no hover mode
  3. fixed controller not working after being disconnected and reconnected again
  4. better handling of left-handed mode
  5. despaghettification of joystick code
  6. nonlinear joystick response curves
  7. removed hardcoded joystick deadzone, now the code uses only the value provided by Android
  8. added combined yaw toggle to gas/yaw thumb stick
  9. fixed restarting of com.parrot.freeflight.academy.services.restoremedia.RestoreFlightMediaService when exiting the app using back button

Controller mapping:
Since the Shield controller uses standard gamepad layout, every compatible controller should work. I tested with a Wikipad.
nvidia-shield-mapping copy.jpg

Please note that if you use "left-handed mode" (equivalent to RC Mode 2), both sticks and shoulder buttons are swapped. In that case, L1 (left shoulder) switches cameras and R1 (right shoulder) enables accelerometer. The easier way to think is that whatever stick you use to pitch/roll your drone, the shoulder button on the same side switches accelerometer control.
Triggers are unaffected, LT is video and RT is photo.

You may notice in the above image that Parrot labeled the X button as a "secret feature" in their original blog post. Well, the Shield owners have discovered that the button does in fact nothing. And now after decompiling the code, I can conclusively say that there is indeed no secret feature.
Although it's a small thing, Parrot lied to the customers. The good thing is that we can implement whatever we like, so I invite everyone to vote what the secret feature should be!


Patch notes:
As I don't have access to Parrot's private key, the APK is signed with the key from official SDK. As a result, instead of replacing the official app with patched version, you'll have to uninstall the official app first.

If you want to patch the APK yourself and make sure that I didn't bundle any malware, you can. The attached zip contains the shell script that does decompilation, patching, rebuilding and signing the APK. You should place the original named com.parrot.freeflight.apk in the same folder.

Requirements:
  • Linux or OS X (Windows users will need to get patch.exe from diffutils and translate the shell script to a .bat file)
  • Oracle JDK (JRE won't work)
  • apktool 2.0.0rc4
  • zipalign tool from Android SDK (not strictly necessary, but recommended by Google)
The url stops working, the file is not in the dropbox. Can you resubmit it?

Mazllus
Ready for take off
Posts: 10
Joined: 29 Mar 2017, 10:32
Drone Type: AR.Drone 2

PLS Help AR.FreeFlight ps3 gamepad

Post by Mazllus » 02 Apr 2017, 10:37

HELLO!!!!

I need your help, the modified application to control the dron with the gamepad of ps3 is no longer available in the dropbox in the topic of this forum. Could someone upload it to some page in order to download it?
Last edited by AR.Tommy on 02 Apr 2017, 13:49, edited 1 time in total.
Reason: Moved your post into the thread. Please do not create new topics. Thank you.

User avatar
AR.Tommy
Charged up again
Posts: 1017
Joined: 07 Oct 2010, 07:59
Drone Type: Bebop
Contact:

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by AR.Tommy » 02 Apr 2017, 14:11

The poster of this thread explains the patch in his first post. The needed files to patch the app yourself are uploaded to the forum and the download still works. You can create a patched version of the app by yourself.
http://www.digitalsirup.com

Sweet and delicious apps for your drones.

Mazllus
Ready for take off
Posts: 10
Joined: 29 Mar 2017, 10:32
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by Mazllus » 02 Apr 2017, 16:07

AR.Tommy wrote:The poster of this thread explains the patch in his first post. The needed files to patch the app yourself are uploaded to the forum and the download still works. You can create a patched version of the app by yourself.
Yes, but my English is bad and I do not understand much.

If someone would be so kind to upload the application modifies

Mazllus
Ready for take off
Posts: 10
Joined: 29 Mar 2017, 10:32
Drone Type: AR.Drone 2

Re: Modified FreeFlight 2.4.10 APK with game controller support

Post by Mazllus » 04 Apr 2017, 13:48

I tried to do it myself but when I run the .sh file I do not know what happens that does not work

I enter the terminal, enter the folder where all these files.

I get root permissions

I run the command sh freeflight_apktool.sh

And there I'm stuck. I gave you a photo and the files

http://oi63.tinypic.com/359wdjs.jpg

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests