User Tools

Site Tools


doc:crazyflie:dev:host:android:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
doc:crazyflie:dev:host:android:index [2015-04-11 17:52]
fred created
doc:crazyflie:dev:host:android:index [2021-06-24 16:59] (current)
kimberly
Line 1: Line 1:
 +<WRAP center round important 60%>
 +This page has deprecated and will be archived. Please go to [[https://www.bitcraze.io/]].
 +</WRAP>
 +====== Android client architecture ======
 +
 +This should give a rough overview over the current state of the Android client architecture and also an outlook on what's planned in future versions.
 +
 +===== Current architecture =====
 +
 +==== Main screen ====
 +
 +As in every Android application there is a ''MainActivity'' class. It is the heart of the application.
 +It defines the main screen which is used when controlling the Crazyflie.
 +
 +The main screen currently consists of two parts:
 +  * a top row that displays the flight data (''FlightDataView'')
 +  * the touch controls (''DualJoystickView'')
 +    * it's based on the mobile-anarchy-widgets project (https://code.google.com/p/mobile-anarchy-widgets/)
 +
 +==== Preferences ====
 +
 +The preferences (''PreferencesActivity'') can be accessed from the main screen.
 +
 +It has the following structure:
 +
 +  * Connection settings
 +    * Crazyradio settings
 +    * Bluetooth settings
 +  * Flight control settings
 +    * Advanced flight control preferences
 +  * Controller settings
 +    * Gamepad axis and button mapping
 +  * App settings
 +
 +==== Controls ====
 +
 +The ''IController'' interface defines the basic methods that every controller implementation should support like
 +getting values for thrust, roll, pitch, yaw and enabling/disabling the controller.
 +
 +Currently the following controllers are implemented:
 +
 +  * Touch controller
 +    * Gyroscope controller
 +  * Gamepad controller
 +
 +The touch controller (''TouchController'') uses the onscreen controls. Unfortunately it is the most difficult way to control the Crazyflie because there is no haptic feedback.
 +
 +The gyroscope controller (''GyroscopeController'') is a subclass of the touch controller. It uses the gyroscope/accelerometer sensors to control roll and pitch values.\\
 +It would be possible to also control yaw and thrust with the sensors, but it is not really a senseful and reliable way to control the Crazyflie.
 +
 +The gamepad controller (''GamepadController'') deals with gamepads or joysticks (like a PS3 or XBox controller).
 +The mapping of the axes and buttons can be changed in the preferences (Controller settings -> Gamepad axis and button mapping).
 +
 +==== Crazyflie library ====
 +
 +One of the main goals of the design is to separate the UI from the Crazyflie library.
 +Currently the crazyflielib (''se.bitcraze.crazyflielib'' package) is still included in the Android client.\\
 +In the future, a standalone Java library, that does not contain any Android specific code, should be used instead.
 +
 +===== Future plans =====
 +
 +  * Separate Crazyflie lib from Android client
 +  * Show more stats from the Crazyflie
 +    * <del>battery level</del>
 +    * ...
 +  * Show an artificial horizon like the Crazyflie python client
 +  * Show console messages
 +  * Set parameters
 +    * <del>Enable/disable hover</del>
 +    * <del>Set LED pixel ring effect</del>
 +    * ...
 +  * <del>Update Crazyflie firmware directly from the Android client</del>