• Home
  • Programs
    • FIRST LEGO League Junior
    • FIRST LEGO League
    • FIRST Tech Challenge
    • FIRST Robotics Competition
  • Calendar
  • About ORTOP
    • Why FIRST programs?
    • Impact
    • Policies
    • Open Positions
    • Media
    • Contact Us
  • Sponsorship/Donations
  • Volunteer
  • Alumni/Scholarships
    • Scholarships
  • February 23, 2019
  • Overview
  • Start a team
  • Team Resources
    • Annual challenge
    • Budget and Funding
      • FTC Team Support Awards
    • Newsfeed
    • Registration
    • Tournaments
      • FTC Event Schedule
    • Workshops and Tutorials
      • Blocks Programming Resources
      • App Inventor Resources
    • FIRST Dean’s List
  • FTC Volunteers
  • Sponsorship Information

Resources for FTC Blocks Programming

Blocks Programming is included in the FTC Robot Controller app and does not require you to install a Software Development Kit (SDK) to use it. The latest released version can be found by using Google Play Store from an Android device with Internet access and searching for FTC Robot Controller. You can install it on your Robot Controller phone and the companion FTC Driver Station app (also found on Play Store) on your Driver Station phone.

Resources from FIRST and FTC Vendors

 Software Documentation
 Support Forum
 Sample Op Modes
 FIRST YouTube Videos on Blocks Programming
 Resources for RELIC RECOVERY Season
 Sample Robots and Hardware Information
 REV Robotics Documentation
 Modern Robotics Documentation
 AndyMark Documentation
 Information about FTC Field

Resources from Oregon

 Information about Blocks Programming
 Reference Manual
 Online Instruction
 Printing a Blocks Op Mode Program
 Copying Op Modes from one Phone to Another
 Sample Programs
 Support for Blocks Programming

Resources from FIRST and FTC Vendors

Software Documentation
FIRST Programming Resources Page that includes Blocks Programming information:

  • One Page Description
  • Training Manuals

Blocks Programming Reference Materials

  • Blocks Programming Reference Manual
  • Sample Op Modes
  • Control System Wiki
  • Technology Forum

See also Resources from Oregon for Reference Manual.

Support Forum

Questions about Blocks Programming can be posted using this Blocks Programming sub-forum.  Before posting a new question please review previous posts as your question may already be answered.

Sample Op Modes

Version 3.3 and higher of the FTC Robot Controller app includes sample op modes that demonstrate how to use various features.  To view these samples, click on the “Create New Op Mode” button, specify a name for the new op mode, and in the “Sample:” drop down list, select one of the examples.   Here’s a list of the sample op modes currently available:

  • Basic POV Drive
  • Basic Tank Drive
  • ConceptDeviceInteraction
  • ConceptSmoothServo
  • ConceptTensorFlowObjectDetection
  • ConceptTensorFlowObjectDetectionWebcam
  • ConceptTextToSpeech
  • ConceptVuMarkDetection
  • ConceptVuforiaNavRoverRuckus
  • RevBlinkinLed
  • SensorDigitalTouch
  • SensorIMU
  • SensorREVColorDistance

Modern Robotics has posted a diagnostic program called Core Device Discovery that you may find useful.  It communicates directly with the Core modules using a USB port on you Windows or Mac computer.

FIRST YouTube videos on Blocks Programming

  • Installing Apps from Google Play
  • Connect to Programming Mode
  • Writing an Op Mode
  • Saving and Running an Op Mode
  • Moving Forward and Backward
  • Turning
  • Rotate Servos
  • Gamepads Using Joysticks
  • Gamepads Using Buttons
  • Gamepads Using Triggers
  • Save Early Save Often
  • Using a Color Sensor Part 1
  • Using a Color Sensor Part 2
  • Debugging Using Telemetry
  • Line Following
  • Using Motor Encoders
  • Ensuring Stop — Ensure that your robot will pass Field Inspection
  • REV IMU Introduction
  • Using REV IMU for Navigation

Resources for RELIC RECOVERY Season

  • FIRST RELIC RECOVERY Game & Season Materials
  • FTC Control System Wiki
  • Identifying Vuforia VuMarks

Sample Robots and Hardware Information

FIRST Robot Building Resources page

These include:

  • A simple K9 robot
  • a PushBot that uses the new technology
    • Getting Started
    • Building the Robot
    • OpModes and Electronics
    • Wiring the Robot

REV Robotics Documentation

  • REV Robotics Expansion Hub Guide
  • REV HD Hex Motor Encoder

Modern Robotics Documentation

  • Sensor Documentation

AndyMark Documentation

  • NeveRest 40 motors

Information about FTC Field

  • AndyMark Field Setup Guide
  • FTC Field Coordinate System (not applicable to RELIC RECOVERY season)

Resources from Oregon

Information about Blocks Programming

FIRST has provided three programming environments:

  1. Android Studio Java environment. Using this environment involves a fairly complex installation process and becoming familiar with Java line-by-line programming as well as certain aspects of Android programming libraries.
  2. OnBot Java.  This environment is similar to Android Studio Java but it “lives” on the Robot Controller phone.  If you use it instead of Android Studio, you won’t have install an software development kit on your laptop or desktop.  Instead, OnBot Java is installed on your Robot Controller phone when you install the standard Robot Controller app from Google Play Store.  Because you access OnBot Java using any HTML 5 web browser, you can use a desktop, a laptop, a Chromebook, a pad computer or even a smart phone.
  3. FTC App Inventor, which is based on MIT App Inventor. This environment is a drag-and-drop block programming environment, which has similarities to the LEGO Mindstorms NXT and EV3 programming environments. You install FTC App Inventor on your PC or Mac.  Each time you make a change to an opmode program, you download it to your robot controller phone and install it.
  4. Perhaps your first choice should be Blocks Programming.  It has more features and major advantages over App Inventor and its easier to learn than Java:
  • It does not require you to install software on your PC or Mac.  It only requires an HTML 5 web browser, such as Google Chrome.
  • When you make a change to a program and save it, it is immediately available on your robot controller phone.  No build, download and install process is required.
  • Like Onbot Java, you access Blocks using any HTML 5 web browser, you can use a desktop, a laptop, a Chromebook, a pad computer or even a smart phone.
  • If you already have op modes programmed in Android Studio Java or App Inventor you can still use them as you add new op modes programmed using Blocks.  Simply build your existing op modes with Version 3.3 or above, install the resulting APK file on your Robot Controller phone and then use a browser to log into use Blocks.  See the Blocks training manuals and YouTube videos above to get started with Blocks.  If you haven’t been using Java or App Inventor, use Google Play Store to install the standard Robot Controller app.  Again, see the training manuals and videos.

Using Java is a good option for teams that have a coach or mentor with Java expertise.  App Inventor and Blocks Programming are good choices for new teams and teams where the programming will be done by members without prior Java experience.

Reference Manual

We have created a Blocks Programming Reference Manual. (Updated  2/7/2019)

Online Instruction

  • Playlist of videos on Blocks Programming
  • Touch Sensor Tutorial by team Total Chaos

Videos by Bruce Schafer of ORTOP

  • Using FTC Blocks Programming to Recognize RELIC RECOVERY VuMarks
  • Navigating using Motor Encoders during Autonomous Period with Blocks Programming (There is a newer version of this video.)
  • Following a Line during the Autonomous Period with Blocks Programming
    Since posting this video I have done some more testing. The REV color sensor is very sensitive to its distance from the mat. Slight increases or decreases in distance from the mat will change the percentage light detected. To get a good range of readings that distinguish the mat from colored tape on the mat, you may need to adjust the sensor up or down.  (There is also a newer version of this video.)
  • Ensuring Your Robot Will Stop During Autonomous Period Using Blocks Programming (Helping your robot pass inspection and behave correctly on the field.)
  • Introduction to the REV Inertial Measurement Unit (IMU)
  • Using the REV Hub’s Built-In Gyroscope to Control a Robot’s Path
  • Introduction to Using Tensor Flow for Tracking Rover Ruckus Minerals
  • Using Tensor Flow to Find and Grab Rover Ruckus Gold Minerals

Printing a Blocks Op Mode Program

There are three ways to print an op mode program using Windows.  In all three cases you start by displaying the op mode program using your web browser.

(1) Click on “Download Image of Blocks” button toward the top.  Save the PNG image file on your computer.  If you have a Windows computer, select Paint in the Windows Accessories sub-menu.  From Paint open the PNG file.  Use File-Print-Page Setup and then use the Scaling feature to select enough pages to assure the blocks in your op mode will be large enough to read.  For instance, if your op mode is fairly long, you may need to be spread it across five pages by specifying “Fit to: 1 by 5 pages.” Then use File-Print to print the image.  If your printer is on your Local Area Network (LAN), you’ll need to disconnect the WiFi connection between your Windows computer and your phone and connect your computer to your LAN before you request the Print.

(2) If you have a printer directly connected to your computer, then print it using the browser’s print feature (usually in the File menu). If your printer is on your Local Area Network (LAN), you’ll need to disconnect the WiFi connection between your Windows computer and your phone and connect your computer to your LAN. Then print the program from your browser. If your browser doesn’t print the whole program, try clicking the zoom-out (minus) symbol in the lower right part of the browser screen to get all or most of the program on the screen and then print again.

(3) Use the PrtSc key on your keyboard to capture a screen shot. Then start the Windows Paint program. (You’ll find it under Windows Accessories in the main Windows menu.) In Paint use the Paste button from the Home menu or just press control-V to place the screen shot on the Paint canvas. Then use Paint’s File Print to print the screen shot. (Per above you may need to switch your computer from being connected to your RC phone to being connected to your LAN to do this.) If you didn’t capture the whole program in the screen shot, go back to the web browser, scroll down and repeat the process. (You probably won’t need re-connect to your RC phone to scroll the op mode already displayed by your browser.)

Copying Op Modes from one Phone to Another

You may want to move your op modes from the first Robot Controller (RC) phone to another either because you are placing a phone or you want to have a back-up phone at a competition.  If so, you can proceed as follows:

(1) Establish a WiFi connection from your computer to your RC phone.

(2) Use your web browser on your computer to access the list of op mode programs on your Robot Controller phone.

(3) Click on the box to the left each op mode that you want to copy to the second RC phone.

(4) Click on Download Selected Op Modes and wait for the downloads to complete.

(5) Instruct your computer establish a WiFi connection to the second RC phone, disconnecting from the first phone.

(6) Use the web browser on your computer to access the list of op mode programs on the second RC phone, which may be empty.

(7) Click on the Upload Op Mode button, select Choose File and browse to one of the op modes you previously downloaded to your computer. Select Open.

(8) Repeat step (6) for each of the op modes you previously downloaded.

Sample Op Mode Programs

As discussed earlier, there are over a dozen sample op modes available from a drop-down menu when you create a new op mode.  Here are some additional sample op modes. You can download them to your computer (by right clicking) and then use the Upload Op Mode button on the Blocks main menu to add them to your list of op modes.  Review the comments in each sample for information on connecting motors and sensors and setting up a matching config file. All of these op modes are intended to be used during the Autonomous period.  Display the op mode by selecting it from the list after you have uploaded it.  If it is labeled as TeleOp to the right of its name, change it to Autonomous and Save it.  This will cause it to correctly appear in the left menu on the Driver Station menu.

  • Navigate with the gyro built into REV Expansion Hub’s Inertial Measurement Unit (IMU) (Updated 12/8/17)
    Uses the gyroscope built into the REV Expansion Hub to allow an autonomous op mode to move straight and turn.  You can modify it to implement other autonomous driving sequences.
  • Use Motor Encoders to Control Autonomous Driving
    Uses motor encoders to control movement of the robot on the playing field.  Can be modified to implement other autonomous driving sequences.  Also see YouTube video on this subject.
  • Detect RELIC RECOVERY VuMark Targets Using Robot Controller Phone’s Camera and display type, relative location and direction
  • Display REV Color-Distance Sensor Readings
  • Display Modern Robotics Optical Distance Sensor Light Detected Readings
  • Display Modern Robotics Range Sensor Light Detected Readings
  • Display Modern Robotics Color Sensor Readings
  • Follow White Line Using REV Color-Distance Sensor
    Use the Display REV Color-Distance Sensor Readings op mode above to measure light values for the line and its background.  Average them and use this value to adjust threshold in the code for the op mode.
    This op mode can be adapted to other sensors by referring to the other display programs above.
  • Parallel Programming Template — an advanced technique for complex situations.
    This sample op mode does nothing but includes comments that give hints on how three functions might be executed in pseudo parallel.  This approach may be helpful if you need your robot to do two or three things at once during autonomous mode. Each function may need a state variable to help it keep track where it is in performing a sequence of tasks.  A state variable can be a numeric variable with a different integer value for each step in the sequence.  Each function can check its state variable to determine what it is currently doing and change the variable’s value if it’s time to do something different.
  • Programming your op mode for the Autonomous Period as a sequence of stages. (Template to be linked later)
    If your robot does a sequence of things in stages with each stage containing certain actions, you will probably find it easier to perform each stage in sequence rather than using the parallel approach in the template above.  You can put the code for each stage in the main op mode or put it in a Blocks function, which is called by the main op mode. Either way, you should always check isStopRequested before starting each stage and during any loops.  See the video on Ensuring Your Robot Will Stop described above.
  • Driving forward without encoders, back with encoders, checking for stop requested at each step
    This sample program combines examples of autonomous driving with good practice in monitoring stop requests so the robot will pass inspection and behave well on the field.
  • Text to Speech Demonstration. Demonstration of text-to-speech feature included in Blocks Programming.
  • Using Tensor Flow to Find and Grab Rover Ruckus Gold Minerals. Demonstrates how to use Tensor Flow during the Autonomous Period to find and pick up gold minerals. This file can also be accessed via https://tinyurl.com/SeekGoldBLK
    Here’s a link to a PDF file showing the blocks of this Op Mode that you can display or print:
    https://tinyurl.com/SeekGoldPDF

Support for Blocks Programming
If you would like to be added to an email list on Blocks Programming or have questions, send email to ftcblockshelp@ortop.org

 

Related

FIRST Tech Challenge in Oregon is sponsored by:
Google Data Center
Garmin AT
Insitu
Micro Systems Engineering

Address

ORTOP
4800 SW Griffith Drive, Suite 215
Beaverton, OR 97005

Find FLL Jr on FLL Jr
Find FLL on FLL
Find FTC on FTC
Find FRC on FRC

Newsletter Signup


By submitting this form, you are consenting to receive marketing emails from: Oregon Robotics Tournament & Outreach Program, 4800 SW Griffith Drive, Suite , Beaverton, OR, 97005, http://www.ortop.org. You can revoke your consent to receive emails at any time by using the SafeUnsubscribe® link, found at the bottom of every email. Emails are serviced by Constant Contact

(blank)

Copyright © 2019 · by Zwebify

  • FIRST LEGO League Junior
  • FIRST LEGO League
  • FIRST Tech Challenge
  • FIRST Robotics Competition