Sample Apps Source Code

Micro Rover Sample Apps Source Code

Please follow these instructions after downloading and extracting the contents of the "Micro Rover Sample Apps Source" file to setup and build Follow Target and Navigator apps.

Note: <SDR_SRC_ROOT> refers to the root folder where the <micro-rover-source.zip> is extracted.

  1. Download and configure Eclipse & Android SDK
    1. Download the adt bundle
      1. Follow the instructions to install the package
        1. Note: <adt_bundle_folder> refers to the root folder where the package is installed
      2. Download the Google API 19 add-on
        1. Start Eclipse ( <adt_bundle_folder>/eclipse/eclipse)
        2. Click "Window"->"Android SDK Manager"
        3. Click on "Deselect All" at the bottom of the window
        4. Find "Android 4.4.2(API 19)"
          1. Under this search for "Google APIs(ARM System Image)" and Select it
          2. Click "Install 1 package"
  2. Download and configure vuforia 3.0.9 package
    1. Download the vuforia 3.0.9 package
      1. Note: This will require you to create a user account if you do not have one.
    2. Extract contents of the vuforia package the following folder: <SDR_SRC_ROOT>/ThirdpartyExternal/Vuforia/
    3. Copy Vuforia.jar file
      1. FROM: <SDR_SRC_ROOT>/ThirdpartyExternal/Vuforia/build/java/vuforia/Vuforia.jar
      2. TO: <SDR_SRC_ROOT>/SmartRover/lib/SensorVuforiaLib/libs
    4. Copy Vuforia.so file
      1. FROM: <SDR_SRC_ROOT>/ThirdpartyExternal/Vuforia/build/lib/armeabi-v7a/libVuforia.so
      2. TO: <SDR_SRC_ROOT>/SmartRover/lib/SensorVuforiaLib/libs/areabi-v7a
  3. Download and configure the IOIO package
    1. Download the IOIO App 0504 package
      1. TO : <SDR_SRC_ROOT>/ThirdpartyExternal/IOIO/src/software/
        1. Helper command for linux ubuntu( this assumes that wget is installed )
        2. %>cd <SDR_SRC_ROOT>/ThirdpartyExternal/IOIO/src/software/ </SDR_SRC_ROOT>
          %>wget https://github.com/ytai/ioio/raw/master/release/software/App-IOIO0504.zip
      2. Extract the .zip file under <SDR_SRC_ROOT>/ThirdpartyExternal/IOIO/src/software/
        1. Helper command for linux Ubuntu:
        2. %> cd <SDR_SRC_ROOT>/ThirdpartyExternal/IOIO/src/software/</SDR_SRC_ROOT>
          %> unzip App-IOIO0504.zip
  4. Download and configure MobileAnarchy package
    NOTE: This step needs svn tool. If not present, please install it on your platform.
    1. Download the MobileAnarchy code from:
      1. FROM: http://mobile-anarchy-widgets.googlecode.com/svn/trunk/Widgets/@r31
      2. TO: <SDR_SRC_ROOT>/ThirdpartyExternal/MobileAnarchy/src/
        1. SVN commands( for Ubuntu Linux )
          cd <SDR_SRC_ROOT>/ThirdpartyExternal/MobileAnarchy/src
          svn checkout http://mobile-anarchy-widgets.googlecode.com/svn/trunk/Widgets@r31 ./
    2. Remove the WidgetsDemo folder
      1. Remove the <SDR_SRC_ROOT>/ThirdpartyExternal/MobileAnarchy/src/src/com/MobileAnarchy/Android/WigetsDemo
        1. Helper command:
          rm -rf <SDR_SRC_ROOT>/ThirdpartyExternal/MobileAnarchy/src/src/com/MobileAnarchy/Android/WigetsDemo
    3. Update the "default.properties"file located at: <SDR_SRC_ROOT>/ThirdpartyExternal/MobileAnarchy/src/
      1. Change the line:
        1. FROM: "android.library=false"
        2. TO: "android.library=true"
  5. Using Eclipse to load and build Smart Rover Applications
    1. The Steps 1 through 4 should be completed to start this process. Note the steps 1-4 should be executed once.
    2. Start Eclipse from ( <adt_bundle_folder>/eclipse/eclipse )
    3. Select a new workspace name
    4. Click File --> Import
    5. Under "Select an import source" click "Android->Existing Android Code into Workspace" and click "Next"
    6. Click "Browse"
    7. Got the "<SDR_SRC_ROOT>" folder and click "ok"
    8. In the list of Projects shown deselect the following projects:
      1. HelloIOIOService
      2. HelloIOIO
      3. IOIOSimpleApp
      4. IOIOLibAndroidDevice
    9. Click "Finish"
      1. "Copy projects into workspace" should be unchecked
      2. "Add project to working sets" should be unchecked
    10. Wait for few min for all the apps to complete the compilation
      1. The following are the list of projects that should have been loaded:
        1. IOIOLibAccessory
        2. IOIOLibAndroid
        3. IOIOLibBT
        4. MDRFollowTargetActivity
        5. MDRNavigatorActivity
        6. RobotCore
        7. SensorVuforiaLib
        8. Widgets
    11. Follow the instructions to load and run the application using eclipse
      1. The following are the micro rover apps:
        1. MDRFollowTargetActivity ==> For micro rover tracking a vuforia target
        2. MDRNavigatorActivity ==> Provides the joystick based navigation for micro rover
    12. In case the step 4.3 is not done you will get compilation errors. To fix the issue follow the steps below:
      1. Select the "MDRNavigatorActivity" project and right click and select "delete"
        Note: Make sure that the "Delete project contents on disk(cannot be undone)" is not checked
      2. Select the "Widgets" project and right-click and select "Properties"
      3. Select "Android" and check the "Is Library" option and click "Apply"
      4. From Eclipse, select "File-->Import"
      5. Under "Select an import source" click "Android->Existing Android Code into Workspace" and click "Next"
      6. Click "Browse"
      7. Got the "<SDR_SRC_ROOT>/SmartRover/app/MDRSimpleNavigator" folder and click "ok"
      8. Click "Finish"
        1. "Copy projects into workspace" should be unchecked
        2. "Add project to working sets" should be unchecked
      9. Now the code should compile successfully.

License Agreement

Copyright © 2013-2014 Qualcomm Technologies, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Qualcomm Technologies, Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@Override
public void setup() throws ConnectionLostException {
   try
   {
      pwmForklift = ioio_.openPwmOutput(4, 50);
      pwmDriveRight = ioio_.openPwmOutput(3, 50);
      pwmDriveLeft = ioio_.openPwmOutput(2, 50);
      pwmCameraPan = ioio_.openPwmOutput(1, 50);
   }
   catch (ConnectionLostException e)
   {
      Log.e(TAG, "Connection to the controller is unavailable.");
      e.printStackTrace();
   } 
}
public void driveMDRRight()
{
   pwmDriveRight.setPulseWidth( 1200 );
   pwmDriveLeft.setPulseWidth( 1600 );
}