Prototypes‎ > ‎ROFI‎ > ‎Programs‎ > ‎

Arduino Static Walk


Type:
Language:
Target :
Device:
Arduino Program
C++
Arduino 1.0.1
Arduino Mega 2560
Source Code:
version 1.0
11-11-2012

Software License:
Creative Commons License
Description :

Allows ROFI to walk statically directly from the Arduino Mega without a computer or Android tablet.  When the robot is powered on it will start playing back the action in an endless loop.  To get this to work properly with your ROFI you will need to insert your custom calibration into the source code.  Without a custom calibration your ROFI  will most likely just fall over ... and in general look very unimpressive to your friends.  To get your custom ROFI calibration into the program do the following : 
  1. calibrate your ROFI <TODO add link>
  2. export your calibration from the Robot Poser application (select calibration only, don't check the "precompute calibration" option)
  3. copy the servo calibrations array from the exported file 
  4. open the Arduino_Static_Walk.ino file with the Arduino integrated development enviorment
  5. overwrite the servoCalibrations array with your custom calibration array
 


The statically balanced walking cycle for ROFI is composed of 14 key frames.  Each key frame is statically balanced meaning that if the robot stopped it wouldn't fall over.  Note that this program was created by the Robot Poser, and you can create your own custom actions and export them as a stand alone Arduino program too.

Setup :

Wired Setup Option:
  • Plug in a power adapter to ROFI to power the servos (no greater than 12v and at least 1.5 Amps)
  • Flip on the servo power switch on the side of ROFI (otherwise no power will go to the servos)
<TODO add diagram>

Autonomous Setup Option:
  • Use a USB A to micro cable to connect the servo shield on the Arduino Mega to the Android device 
  • Use a volt meter to make sure the LIPO battery has at least 7 volts (never discharge the battery beloy 6.6 volts)
  • Plug in the LIPO battery to the Arduino Mega board (don't forget to unplug it when you're done!)
  • Flip on the servo power switch on the side of ROFI (otherwise no power will go to the servos)
<TODO add diagram>

Code Overview :

Classes
  • Action : this holds information about the action and how to play it back.
    • modify the playbackSpeed member inside of the constructor (line 62) to change how fast the action is played back.
General
  • The individual joint positions for each frame are stored in the frames array (line 118)
    • To avoid floating point values which take more space the joint positions are stored as integers with positions that are degrees * 100
    • The joint positions are stored without any corrections, so they should work the same for any calibrated ROFI
  • The calibration for ROFI is stored in the servoCalibrations array (line 205)
    • The one in the file is for the original ROFI ... not your ROFI, so follow the calibrations instructions to get your own

Installation :
  1. Setup the Arduino development environment on your computer.
  2. Download the source file for this program.
  3. Open the Arduino development environment application on your computer.
  4. Open the source for this program ( from the main menu : File/Open...).
  5. Connect the computer to the Arduino Mega with a USB A to B connector (do not connect to the servo shield)
  6. Upload the program to the Arduino Mega (from the main menu : File/Upload)
  7. Disconnect the Arduino Mega from the the computer (unplug the USB A to B cable)
  8. Setup ROFI as detailed above.
Comments