FIRST Tech Challenge New Technology Introduction: MIT App Inventor Peter Klein 12 September 2015
Overview Hardware introduction MIT App Inventor Software installation Additional setup steps Creating an op mode Loading a program Turning a motor Moving a servo Reading a sensor Complete teleop
Hardware Introduction Next Gen platform Android based USB interconnect (1) www.modernroboticsinc.com (2) FTC Training Manual (Tomas Eng)
MIT App Inventor MIT App Inventor is a blocks-based programming tool that enables everyone, even novices, to learn programming and build fully functional apps for Android devices. In 2015 the MIT App Inventor community of nearly 3 million users representing users in 195 countries. More than 100 thousand active weekly users have built more than 7 million android apps! Special FTC blocks have been added to incorporate the Next Gen platform hardware Browser based Requires local virtual machine to host FTC functionality (1) http://appinventor.mit.edu/explore/about-us.html
Virtual Machine? Run another OS (Linux) inside your existing OS Host operating system (Windows) Web Browser PowerPoint Mine sweeper Arduino Guest operating System (Linux) Web server App Inventor server Mines virtual appliance virtual machine (VM) guest operating system
App Inventor System Requirements Host operating system https://www.virtualbox.org/manual/ch01.html#hostossupport Windows Vista SP1 to Windows 8.1 Mac OS X 10.8 to 10.10 (Yosemite) Linux kernel 2.6 or 3.x (installation difficulty may vary) Browser Mozilla Firefox 3.6 or higher Apple Safari 5.0 or higher Google Chrome 4.0 or higher Virtual machine 6-8 GB hard drive, including saved project files 512 MB RAM (4 GB recommended for you host operating system)
Documentation FIRST and Intelitek have worked very hard to provide detailed step-by-step guides! FTC documents http://frc-events.usfirst.org/2015/ftcimages https://github.com/ftctechnh/ftc_app/tree/master/doc/tutorial Official documents to set up phones, install software, write code Intelitek http://ftc.edu.intelitek.com/ Slides and interactive tutorials on setting up phone, pairing, writing code Requires a free account FTC forum http://ftcforum.usfirst.org/forumdisplay.php?156-ftc-technology User experiences, links to official documents
Documentation App Inventor (AI) Install Guide App Inventor (AI) Training Manual Android Studio (AS) Training Manual https://github.com/ftctechnh/ftc_app/blob/ master/doc/tutorial/ FTCTraining_Manual.pdf
MIT App Inventor Setup AI Install guide p. 3-19 Download and install Google Chrome and VirtualBox Download virtual appliance and import into VirtualBox Configure virtual appliance network settings Booting up your virtual appliance Accessing App Inventor AI Training manual p. 83-93 Configuring new phones (Same as AS) (1) App Inventor install guide
Additional Setup (Same as AS) AI Training manual p. 5-8 Installing FTC Driver Station AI Training manual p. 55-56 Configuring gamepads AI Training manual p. 31-34 Pairing phones AS Training manual p. 42-50 Install phone drivers (1) App Inventor training manual
Creating an op mode What is an op mode? Preprogrammed robot behaviors Selectable on driver station Think autonomous vs. teleop Hello world! opelapsed that shows elapsed time AI training guide p. 13-31
opelapsed Designer
opelapsed Blocks
Build App
Delete Old App Must be done each time! (1) App Inventor training manual
(1) App Inventor install guide Transfer & Install New App
Run App Must create configuration file first time
Configuration Files Maps robot hardware to code Code can t scan for dumb components Flexible configuration can be changed without re-compile Give components useful names Servo controller 1 Port 1 Port 2 clawup touchfront Port 1 Port 2 Port 3 Sensor module 1 driver Port 1 drivel Port 2 Motor controller 1 (1) Android studio training guide
opelapsed Running Driver station Robot controller
Turning a Motor New op mode Add a motor Add a gamepad Show motor speed telemetry AI training guide p. 38-58
oponemotor Designer
oponemotor Blocks
oponemotor Running Driver station Robot controller
Moving a Servo New op mode Add a servo Show servo position telemetry AI training guide p. 58-63
oponeservo Designer
oponeservo Blocks
Reading a Sensor Modify oponemotor Add a pushbutton Do not allow further motion if button is pressed
opmotorlimit Designer
opmotorlimit Blocks
Full Teleop Multiple Motors Servos Sensors Gamepad inputs
optele Designer
optele Blocks
optele Running
Questions?
Tips & Tricks 1 Make a virtual appliance available to everyone on your local network Change VirtualBox adapter 1 to bridged mode Inside VirtualBox terminal, check ifconfig eth0 inet addr use this in Chrome Streamline the app uninstall/install process In a terminal or windows command promt with adb installed Adb shell pm list packages grep appinventor should list a package Adb shell pm uninstall <package_name> (ex. Appinventor.ai_test.Kickoff) Adb install <new_package>.apk Delete or move <new_package>.apk so that next build/download from App Inventor has the same filename
Tips & Tricks 2 Wireless adb Works with the above uninstall/install process The configuration file generated in the robot controller can be downloaded as an xml file On the phone at: /storage/emulated/0/first/<name>.xml Can be edited manually. Contains the serial numbers of modules