Allows user to control RC plane through Wi-Fi. You need USC-16 servo controller, Android Lollipop enabled smartphone, laptop or another smartphone running QGroundControl, and analog gamepad. Latest build of the app can be downloaded here: PhoneUAV-debug.apk. For MAVLink support see also: MAVLink UDP Android Example. Please keep in mind that the recommended way of implementing MAVLink support in Android applications is MAVSDK. Feel free to use pieces of code from this project for:
-
Reading and saving preferences (MainActivity.java, SettingsActivity.java)
-
Displaying network and Wi-Fi information (NetworkInformation.java)
-
Handling sensor input (Accelerometer.java, Gravity.java, Barometer.java, Magnetometer.java)
-
Taking pictures and recording videos (CameraAPI.java, Camera2API.java)
-
Sending e-mails (GMail.java, SendMailTask.java)
-
Getting GPS location and saving travelled path to a GPX file (Location.java, LogGPX.java)
-
Moving servos with USB servo controller (CH340comm.java)
-
Moving servos with RS232 servo controller using FTDI Android host module (FT311UARTInterface.java, SK18comm.java)
-
Receiving joystick or gamepad input through UDP socket (Input.java)
-
Receiving input and waypoints from QGroundControl using MAVLink (mavlink_udp.c, MAVLinkClass.java)
After cloning or downloading the project you have to do a few things before you build:
- Open
local.properties
and editsdk.dir
andndk.dir
properties (paths to your Android SDK and NDK):
ndk.dir=~/Library/Android/android-sdk-linux/ndk-bundle
sdk.dir=~/Library/Android/android-sdk-linux
-
Download: c_library_v2 or generate: generate_libraries MAVLink headers.
-
Open
/PhoneUAV/src/main/cpp/Android.mk
and editLOCAL_CFLAGS
variable so that it points to the folder where you keep the headers.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -I ~/mavlink/generated/include
LOCAL_MODULE := mavlink_udp
LOCAL_SRC_FILES := mavlink_udp.c
include $(BUILD_SHARED_LIBRARY)
- If you're having trouble building the project (
The system cannot find the file specified
) - try downloading older NDK version.
Accesory mode hardware laid out:
Moving control surfaces using gamepad:
Walkaround:
First flight: