User Tools

Site Tools


doc:crazyflie:dev:host:android:index

This page has deprecated and will be archived. Please go to https://www.bitcraze.io/.

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:

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
    • battery level
  • Show an artificial horizon like the Crazyflie python client
  • Show console messages
  • Set parameters
    • Enable/disable hover
    • Set LED pixel ring effect
  • Update Crazyflie firmware directly from the Android client
doc/crazyflie/dev/host/android/index.txt · Last modified: 2021-06-24 16:59 by kimberly