Hello everyone,
I'm starting a new project branch for the ArduPilot, and I hope it will thrive. For an experiment run the DroidPlannerv0.1b.apk file on an Android Tablet (needs android v4) . Here it's a mere screenshot:
I know this it's not the first phone/tablet GCS to show up on this community (for example Bart copter-gcs, this closed-source copy, the Apple GCS by Zachary), but I'm thinking in a different approach. This is what I want to do:
- Develop a GCS for android devices, mainly to setup missions before flights.
- And to analyze logs on the field afterward flights.
- Increase the App to add in flight telemetry.
- And PID adjustment controls.
- Keep supporting the system.
- Make this easy to use and functional, so that you won't need to turn on a computer to fly.
Some great things are helping on this project:
- Google Maps Android API v2 - Which makes using Google maps in android applications more easily, and a lot faster. I also should point out that there is a nice cache function that makes it work offline (to some extent of course). But there is also the option of using a custom source of imagery.
- Cheap Android Tablets with USB host capability's.
Screenshots:
Before getting into how I think this should evolve let me show to you what I have already done. Bellow is a screenshot of the home screen where the mission planning is made. On the left there is a list of waypoints altitudes, on the center a map with the home position. On the top left a menu to change the screen and on the right some commands relative to this screen.
On the next picture there are show some of the actions on the menu, and more waypoints where added (with a different altitude). Using the "open file" action to open a real flight get's us back to the first picture in the post. (Files are loaded from a folder named waypoints on the sdcard, you can copy files generated with mission planner to this folder)
Edit: I added one more screen to the DroidPlanner App, is the Ground Control Point (GCP) screen. It's function is aid in the positioning of control points on the field for photogrammetry applications.
The operation is simple:
- Load a KMZ or KML file from Google Earth with Placemarks where the control points should be.
- Lockup your location at the blue dot.
- Go to a GCP location at a Red dot
- Drop a GCP marker on the ground
- Click on the red dot of the GCP to turn it blue, to show that that place has been marked.
- If there are more red GCP then go back to step 2.
Here is a screenshot of the GCP screen with a KMZ file just loaded.
And this is after some GCP have been placed on the field and have been marked;
How it think it should evolve:
The part I'm procrastinating is the communication interface (mainly because Bart has made it already). I want to implement first a wifi-UDP communication system redirected by some main GCS, this way the development will be easier (the USB port will be free for the programmer) and a nice mobile GCS will be left behind. Next the USB-serial-Xbee communication, I have some working demos to receive data from the serial port but these need more study.
How to develop:
First get a clone from my branch "DroidPlanner_Stable" at this link. Next download the ADT Bundle for the google SDK and eclipse. Download and import the Google Play library into Eclipse as explained here. Now you should be able to import the DroidPlanner project/compile/ and run on a android device (needs Android v4).
Edit: About the USB connection to 3DR radios, some tablets have USB host capabilities and the drivers needed to communicate to a FTDI CDC IC.This means the device can supply power via USB and Acess USB devices, for me all it takes is an USB microB to USB type A cable (like the one in the picture).
To decrease the doubts about this here is a screenshot of my tablet connected to an APM1 board accessing the APM terminal. I used a terminal app called "Android USB Serial Monitor".
As I pointed out at the start there is this file: DroidPlannerv0.1b.apk, that can be run on a android v4 phone or tablet.
Edit: I only have one Chinese 7 inch Tablet, so I don't know how it will behave on other devices but it's worth a try. Some has run the App on a Nexus7. I had some doubts because of the API key need to access Google maps data was a debug one.
About android v2.x.x devices:
Edit: There seams to be a lot of questions about v2 android devices, these will not be supported. At least not on the initial releases. Because with android 2.X there would be some problems with the Google Maps API v2, and the communication drivers (since USB host mode is supported only on version>v3 devices). I know it would be great to support everyone but that is a lot of work. I think at least for the start just focus on android 3.1 or higher. this way we can use the latest version of the maps API and have USB support.
And an android v4 Tablet is very cheap now, and that's what I think should be targeted.
Any questions or suggestions post bellow. Any problems downloading or compiling the source contact me with a message on this post.
Thanks.
--
Arthur Benemann
Comments
I imagine it would be a relatively simple modification of the "Follow me" code, where it works "in reverse".
Ok, I've not had my full morning's compliment of coffee, so I get to ask a dumb question....
...Can I use Droidplanner for a "RTQ" (return to quad) or "RTP" (return to plane) function?
I'm thinking that if you bin your aircraft (or it simply "vanishes"), you can switch droidplanner to a "RTQ/RTP" screen, and use the last recorded telemetry to pinpoint the last known GPS position of the quad/plane, with an OSD-style "distance to quad/plane", and direction. Google maps overlay would be nice too. If the quad is completely wrecked, you'll still be pretty close to the crash site. If it's just upside down in a tree, even better - it will still be transmitting it's GPS co-ords via mavlink.
Of course, if it already has this feature, I'm officially a dumbass for not checking (apologies - on iphone today; the galaxy note is away to samsung for warranty work, so can't answer this myself).
@Antonio Alfaro:
Supporting different units hasn't been our priority, but since we are starting to reach a more stable point in development we may look into it.
You are welcome to help if you feel like it.
Hi Arthur ,
Thanks a lot for this great app. I've been running it successfully on my ASUS transformer TF-101 for at least one month and I really like it. My flight sessions will be more comfortable if in Flight Data screen I can see AS and GS info in Km/h as well as Altitude relative to ground instead of absolute.
Regards AA
The new versions with have this "Home" problem fixed.
Hello,
one more Question. Is it possible to set the Home-Start position from 0,0 to my Home-Start position 8,49?
Hi, thats is it. Now its running. You can add teh Archos 80 g9 an 101 g9 to the device list.
great
You are missing "Google Play Service". This is needed for the Map. Check if you can DL it somewhere. Else have a look at gapps, maybe there you can DL the whole google apps package. Should include Google Play Service.
Hi, tihs is the LogCat from the Archos 101 G9:
09-06 09:04:05.734: I/TextToSpeech(2839): Sucessfully bound to com.google.android.tts
09-06 09:04:05.750: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x2 a=-1}
09-06 09:04:05.750: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0xa a=-1}
09-06 09:04:05.750: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x2 a=-1}
09-06 09:04:05.757: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x2 a=-1}
09-06 09:04:05.757: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x3 a=-1}
09-06 09:04:05.757: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x32 a=-1}
09-06 09:04:05.757: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x64 a=-1}
09-06 09:04:05.757: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x64 a=-1}
09-06 09:04:05.765: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0xe100 a=-1}
09-06 09:04:05.765: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0xe100 a=-1}
09-06 09:04:05.765: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x2621 a=-1}
09-06 09:04:05.765: W/Resources(2839): Converting to string: TypedValue{t=0x10/d=0x38d6 a=-1}
09-06 09:04:05.820: D/dalvikvm(2839): GC_CONCURRENT freed 276K, 5% free 6763K/7111K, paused 2ms+1ms
09-06 09:04:05.828: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.828: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.828: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.828: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.835: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.835: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.835: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.835: W/GooglePlayServicesUtil(2839): Google Play services is missing.
09-06 09:04:05.843: D/AndroidRuntime(2839): Shutting down VM
09-06 09:04:05.843: W/dalvikvm(2839): threadid=1: thread exiting with uncaught exception (group=0x40aae1f8)
09-06 09:04:05.843: E/AndroidRuntime(2839): FATAL EXCEPTION: main
09-06 09:04:05.843: E/AndroidRuntime(2839): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.droidplanner/com.droidplanner.activitys.FlightDataActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class fragment
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.ActivityThread.access$600(ActivityThread.java:123)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.os.Handler.dispatchMessage(Handler.java:99)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.os.Looper.loop(Looper.java:137)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.ActivityThread.main(ActivityThread.java:4424)
09-06 09:04:05.843: E/AndroidRuntime(2839): at java.lang.reflect.Method.invokeNative(Native Method)
09-06 09:04:05.843: E/AndroidRuntime(2839): at java.lang.reflect.Method.invoke(Method.java:511)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-06 09:04:05.843: E/AndroidRuntime(2839): at dalvik.system.NativeStart.main(Native Method)
09-06 09:04:05.843: E/AndroidRuntime(2839): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class fragment
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:258)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.Activity.setContentView(Activity.java:1835)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.activitys.FlightDataActivity.onCreate(FlightDataActivity.java:24)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.Activity.performCreate(Activity.java:4465)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
09-06 09:04:05.843: E/AndroidRuntime(2839): ... 11 more
09-06 09:04:05.843: E/AndroidRuntime(2839): Caused by: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.google.android.gms.internal.x.b(Unknown Source)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.google.android.gms.maps.model.BitmapDescriptorFactory.aW(Unknown Source)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.google.android.gms.maps.model.BitmapDescriptorFactory.fromBitmap(Unknown Source)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.fragments.markers.DroneBitmaps.generateIcon(DroneBitmaps.java:41)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.fragments.markers.DroneBitmaps.buildBitmaps(DroneBitmaps.java:33)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.fragments.markers.DroneBitmaps.<init>(DroneBitmaps.java:21)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.fragments.markers.DroneMarker.buildBitmaps(DroneMarker.java:61)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.fragments.markers.DroneMarker.updateDroneMarkers(DroneMarker.java:49)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.fragments.markers.DroneMarker.<init>(DroneMarker.java:17)
09-06 09:04:05.843: E/AndroidRuntime(2839): at com.droidplanner.fragments.FlightMapFragment.onCreateView(FlightMapFragment.java:55)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:806)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1010)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1108)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.app.Activity.onCreateView(Activity.java:4243)
09-06 09:04:05.843: E/AndroidRuntime(2839): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:673)
09-06 09:04:05.843: E/AndroidRuntime(2839): ... 21 more
@abcd efgh : I hardly think the the problem has something to do with the resolution of your screen.
If you could get a LogCat output of your system it would be helpful.