FTC New Platform Programming Workshop in Android Studio

FTC New Platform Programming Workshop in Android Studio
Slide Note
Embed
Share

This presentation by FTC Team 6022 Rockwell Automation introduces a new Android-based control platform for robotics, replacing the NXT/Samantha systems. The workshop covers programming robots through Android app development in Java using Android Studio. It discusses setting up Android Studio, types of operation modes, defining and using motors, and joysticks in robot programming. The session teaches participants how to leverage the capabilities of Android technology for enhanced robot control and functionality.

  • Robotics
  • Android Studio
  • Programming Workshop
  • Java Development
  • FTC Team

Uploaded on Feb 16, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. FTC New Platform Programming Workshop in Android Studio A Presentation by FTC Team 6022 Rockwell Automation Kickoff September 12th, 2015

  2. Whats New? Android-Based Control Platform with Cell Phones Replaces NXT/Samantha Control System Robot Controller Phone is Mounted to Robot and Connected to Core Module Driver Station Phone Connects to Two Joysticks Utilizes Wi-Fi Direct Technology Replaces Central FCS Utilizes Sports Start to Begin Match Play Controllers are USB-Based Replaces I2C Protocol for Sensors and Controllers

  3. Whats New? Robot is Programmed through Android App Development in Java Uses Android Studio, a Full Android IDE (Integrated Development Environment) MIT App Inventor is Available as a Scratch-Like and Drag-and-Drop Interface Java Information Object-Oriented Language Programmed through Editing Instances of the OpMode() Class Will Be Discussed In-Detail Later

  4. Android Studio Setup (Should Be Completed) Android Studio IDE http://developer.android.com/sdk/index.html FTC Robot App Template (GitHub) https://github.com/ftctechnh/ftc_app Project Configuration Requires SDK Version 19 (KitKat)

  5. Types of Operation Modes Looping Op Mode Defined as a Class Motors, Sensors, Etc. are Referenced as Attributes in the Class The init() Method Runs One Time The loop() Method Runs Continuously Until Stop Linear Op Mode Defined as a Class Motors, Sensors, Etc. are Referenced as Attributes in the Class The runOpMode() Method Runs One Time

  6. Defining and Using Motors Description of Process First, we must create a variable to reference an instance of a motor object. Second, we must reference the robot hardware map. Third, we can set the power of the motor. Powers are a value between 0 and 1. Code Syntax as an Example Op Class public DcMotor testMotor; @Override public void init() { testMotor = hardwareMap.dcMotor.get( nameHere ); } @Override public void loop() { testMotor.setPower(0.75); }

  7. Defining and Using The Joystick Description of Process This code assumes that we have already defined a motor as described in the previous slide. The joysticks are already inherited into the op mode classes as gampad1 and gamepad2. In the code to the right, the loop reads the y-axis of the leftmost analog stick on joystick 1 to allow a user to drive the motor. Code Syntax as an Example Op Class public DcMotor testMotor; @Override public void init() { testMotor = hardwareMap.dcMotor.get( nameHere ); } @Override public void loop() { testMotor.setPower(gamepad1.left_stick_y); }

  8. Other Useful Things Telemetry Data Allows for Robot Data to be Displayed on Driver Station Example: telemetry.addData( Title , Detail/Value ); Sensors SDK Includes Many ModernRobotics and Lego Sensor Classes and Objects Example: public TouchSensor button; button = hardwareMap.touchSensor.get( sensorName ); telemetry.addData( Button/Touch , button.isPressed());

  9. Where to Find More Information The SDK provides Javadocs that outlines how to interact with different methods, classes, and objects. Javadocs can be found in the doc folder of the SDK. Read through example op mode classes in order to get a feel for the code flow and see different uses of programming techniques.

  10. Challenge #1 Read Axis Values from a Joystick Set Motor to Joystick Values to Create a Basic Teleop Mode

  11. Challenge #2 Drive Forwards for 2.5 Seconds Wait 1 Second Drive Backwards for 2.5 Seconds

  12. Challenge #3 Drive Forwards until Touch Sensor Pressed Drive Backwards for 2 Seconds

More Related Content