Android Action Playback

Type:

Language:

Target :

Device:

Android Application

Java

Android 2.2 (API level 8)

Archos 28 tablet

Source Code:

ROFI_ActionPlayback.zip

version 1.1

11-14-2012

Software License:

Description :

Allows ROFI to play back an action from the Android tablet that was created with the Robot Poser application by sending a stream of servo positions to the Arduino Mega board. The Android tablet provides a graphical user interface (GUI) with adjustable speed and playback controls. The default playback speed is at 75% of real time, but can be adjusted from 1% to 200%. The action set in the code is a simple static walking cycle. The action will loop back to the beginning once it has finished until the playback is paused. The action frames are embedded into the source code, so to use your own action do the following :

  1. export your action from the Robot Poser application (select Android as the target platform)

  2. copy the servo positions array from the exported file

  3. in the ROFI_ActionPlaybackActivity.java file overwrite the servoPositions array

  4. copy the servo calibrations array from the exported file

  5. in the ROFI_ActionPlaybackActivity.java file overwrite the servoCalibrations array

User Interface :

Code Overview :

Packages

  • org.microbridge.server : the collection of code that allows the Android tablet to communicate with the Arduino Mega.

  • rofi.projectbiped.com : the collection of code that contains the user interface and playback logic.

Files

ROFI_ActionPlaybackActivity.java

    • Specifies the action through the servoPositions array

    • Specifies the servo calibrations through the servoCalibrations array

    • Ownes the server object that does bidrectional communication with the Arduino device

    • Extends Activity class, so it can define the GUI

    • Implements the Runnable interface so that it can control the playback flow (see the run method)

AndroidManifest.xml

  • Specifies that ROFI_ActionPlaybackActivity is the activity that should be run once the application starts up

  • Requests permission to use the internet (android.permission.INTERNET) which allows communication with the Arduino Mega board

Dependencies :

  • Requires that the Android Remote Control application is loaded on the Arduino Mega board.

  • Requires that the Arduino Mega board is connected via USB cable to the Archos 28.

Installation :

  1. Setup the Android development environment on your computer.

  2. Download the source folder for this application.

  3. Open Eclipse on your computer.

  4. Add this application to your work space.

    1. From the main menu : File / Import / Android / Existing Android Code Into Workspace

    2. Select the folder you downloaded that has the source code for this application.

  5. Make sure all of the dependencies have been met.

Updates :

Version 1.1 (11-14-2012)

    • Fixed a bug where the frame number would sometimes be equal to the number of frames (caused a crash).

    • Updated the status display to accurately reflect when the Arduino device was connected.

    • Replaced the walking cycle with a more stable static cycle.

    • Changed the default playback speed to 75% which should be the most stable speed for the new walking cycle.