Creating Flexible, Script-Controlled Autonomous Software Example Explanation.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Clicking on the link for the.tns file gives you will get the following screen: Select Save File and click OK.
Grade Cam Dustin Foster 2/4/13 Please open Chrome & Login to Skyward.
Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
Computer Basics Hit List of Items to Talk About ● What and when to use left, right, middle, double and triple click? What and when to use left, right,
Session Objectives: Review basic math for single swerve module
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Add and Use a Sensor & Autonomous For FIRST Robotics
V EX C OACHES ' T RAINING October 12, Agenda for Today 9 – 10 AM : Tina Reeves and the Engineering Notebook 10 – Noon : Finish Building, Basic Robot.
Using Excel to Analyze OSAT Results Download OSAT results from the internet Analyze results with formulae Create blank calculation pages Filter and copy.
Welcome to E-Prime E-Prime refers to the Experimenter’s Prime (best) development studio for the creation of computerized behavioral research. E-Prime is.
Building Web Pages With Microsoft Office. Introduction This tutorial is for the beginning web builder. It utilizes software that you already have, Microsoft.
Bug Session Two. Session description In this session the use of algorithms is reinforced to help pupils plan out what they will need to program on their.
ExitTOC Run & Route Directions 2003 Editing Run and Route Directions Edulog.nt v9.2 Use the buttons to navigate the training package First PagePreviousNextLast.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
How to Use This Training Deck
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Lesson 3 Text Basics Adapted From Source:
Creating a Web Page HTML, FrontPage, Word, Composer.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
I Can… Define basic file management and related terms Identify levels of a file system Identify and explain ways to view files in Windows OS Explain the.
Tips and Tricks to Speed LabVIEW Development Useful Nuggets to Save You Time ni.com/labviewzone.
Power Point EDU 271 Microsoft PowerPoint is a powerful tool to create professional looking presentations and slide shows. PowerPoint allows you to construct.
LabView Basics The Fighting Pi Controls Group. About LabView LabView is a highly adaptable programming GUI (Graphic User Interface) LabView compiles the.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Installing the SAFARIODBC.EXE For use with Excel May 3, 2002.
Week 11 Practical: Microsoft Word Theory: Midterm situations.
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
Coding for the FIRST Tech Challenge: RobotC
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
PowerPoint 1 The Basics 1. Save this file to your Apps Folder as YourLastName_PP1 2. Read each slide. 3. Complete each set of numbered directions.
Thank you for your decision to try vTreePro Practice Tree Software! Your satisfaction is very important to us. Please feel free to send us an if.
LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
FRC Robot Framework Labview Made Easy (er) For FIRST Robotics 1.
1 IE in the Classroom The Internet Explorer Web Browser EDW647 Internet for Educators Roger Webster, Ph.D. Millersville University Department of Computer.
CAD3D Project. SketchUp - Project Create a new SketchUp project called InitialsXX where the XX are your first and last initial. Use the Rectangle tool.
Booting Ubuntu Linux Live CSCI 130 – Fall 2008 Action Lab Dr. W. Jones.
2010 Control System Writing and Reading the cRio Presented By: Frank Larkin Lansdale Catholic Robotics, Team 272 First 2010 Kickoff, Jan
Getting Started With AutoCAD ENGR 2 Week #1 Laboratory.
Downloading and Installing Autodesk Revit 2016
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Change in your CAD Project File - it happens all the time in robotics.
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
FRC Robot Programming 1.PID Continued 2.Downloading and Deploying Code 3.Program a 2012 Robot from Spec Basic code For FIRST Robotics.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
Workflow: Content (write) Acquisition (record) Produce (edit) Author (compress/export as mp3) Add meta data (ID3 tags) Distribute (ftp to moodle)
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
High Speed Digital Systems Lab. Agenda  High Level Architecture.  Part A.  DSP Overview. Matrix Inverse. SCD  Verification Methods. Verification Methods.
CS320n –Visual Programming More LabVIEW Foundations.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Click on the running man to start the experiment (this will take longer than the Stroop task you ran last week)
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
Vex Robotics program three: using motors and sensors together.
VAFIRST LabVIEW Workshop 11/19/11 Presenters: Marin Kobin & Patrick Foley.
Get your software working before putting it on the robot!
Creating Flexible, Script-Controlled Autonomous Software.
Get your software working before putting it on the robot! Example Explanation.
June 17, 2009 Office 2007 Tips & Tricks.
Practical Office 2007 Chapter 10
Welcome to E-Prime E-Prime refers to the Experimenter’s Prime (best) development studio for the creation of computerized behavioral research. E-Prime is.
Advanced LabVIEW
Getting started – Example 1
creating a ecosystems model in net logo
Getting started with LEGO EV3 Mindstorms software
Tutorial 8 Sharing, Integrating, and Analyzing Data
Presentation transcript:

Creating Flexible, Script-Controlled Autonomous Software Example Explanation

 Do this first...  Running the autonomous simulator  The example autonomous code  Example autonomous script template  Blank auton.vi  Integrating your autonomous vi into your robot cRIO project  Other stuff to make it work on the robot  Where to go from here

1. Create a new folder on your hard drive 2. Save autonExamples.zip to the folder you created in step 1 and unzip 3. The autonomous simulator, example autonomous software, example cRIO project, and some other useful files will be in the folder you created 4. Autonomous simulator and example autonomous software will be in \autoSim 5. Example cRIO project will be in \exampleRobotCode

 The autonomous simulator is probably the most important tool for understanding the examples – spend some time working with it  To run the simulator, open “autonSim.vi” in LabVIEW.  From the autonSim front panel, click the Run button on the tool bar (upper left).

 From the dialog that opens, open the file “LeftScore2.csv” (example 2 tube auton)  The simulation should now be running. If you look at the front panel, you should be seeing the robot’s X and Y coordinate as well as the heading changing in real-time.  When the simulation is finished, it will ask you to save the robot path data to a file. Type “out.csv” in the dialog and press OK.  The path of the robot will now be plotted on the field.

 If you want, you can open out.csv in Excel (or Matlab, etc.) to analyze the path data.  Now that you have it running, you can create your own autonomous scripts or new code and test it out. You should find the simulator to be extremely helpful in debugging your code.  You can find the autonomous code (autonSample.vi) in the block diagram of autonSim.vi.

 If you are interested in how the simulator works, I would suggest reading my other presentation on Software Testing via Simulation (see CD media papers area).  Opening robotModel.vi shows that the robot model is actually two simple first-order models.  Think of the model as “inverse arcade drive”  The speed is modelled with a first order filter and the turning is modelled with another first order filter  The speed and turning are coupled together with a little trigonometry (like inverse odometry).

 Open autonSample.vi  This is the autonomous software that was developed during the conference presentation, with the following additions: 1. Added the code to reset the time (see Tzero) when the primitive exits 2. Added code to keep track of the encoder distance at the exit of each primitive 3. Added new primitive: drive straight with gradual approach (could be used as “hold position” if exit condition is changed to time). 4. Added output for desired arm position using the last parameter of the script. I didn’t clean it up or make it pretty – sorry for the crossed wires, etc.

 A script template file is a good idea to document how the autonomous scripts are supposed to be written.  autonTemplate.xls is provided as an example script template.  Note that the script template attempts to explain everything needed to write a script, including how to do it and how to get it to the cRIO.

Recall primitive IDs: 0 = Delay/Coast; 1 = Straight; 2 = Turn In Place; 3 = Straight with Gradual Approach. Column / Meaning: 1.Initial position: X=410, Y=225 (start of line leading to left rack) 2.Straight Gradual Approach, Heading = 0 deg, 210 inches, 0.8 power 3.Delay/Coast, 1500 msec. 4.Straight Gradual Approach, Heading = 0 deg, -195 inches, 0.8 power 5.Turn In Place to heading of -80 degrees, 0.8 power 6.Straight Gradual Approach, Heading = -90 deg, 30 inches, 0.8 power 7.Turn In Place to heading of 0 degrees, 0.8 power 8.Straight Gradual Approach, Heading = 0 deg, 195 inches, 0.8 power 9.Delay/Coast 1500 msec. 10.Delay msec (10 seconds – guarantees autonomous mode ends before script ends).

 A blank autonomous vi (blankAuton.vi) was included to give you a template as a starting point for your coding  All you have to do is add more cases to the structure if needed, and add more outputs to unpackAutonArray.vi if needed.

 An example cRIO project was provided and is in /exampleRobotCode  The example project is called wof2011.lvproj  AutonomousIndependent.vi in the sample cRIO project shows how your autonomous vi should be integrated.  Step by step instructions for integration (the example shows this already completed): 1. Open AutonomousIndependent.vi 2. Use “Select a vi” to add your autonomous vi that you developed using the simulation tool. 3. Wrap a “while” loop around your auton vi. 4. Hook up the inputs and outputs. 5. Voila. You’re done.

 Note: I did not test the cRIO project, so it may contain a bug or two.  IMPORTANT: Before running on the real robot, check that 1) motors go in expected direction, 2) sensor polarity is correct.  What happens if a sensor or motor goes in the opposite direction of what you expect? (Answer: it will go in the opposite direction at full power, most likely breaking something!)

 Question: Now that I have the autonomous software working in simulation and integrated into my robot project, how do I modify my robot code to read the script files?  Answer: everything you need is in the example cRIO project. See the following:  Begin.vi (bottom of block diagram):  Code that looks in the “auton” folder of the cRIO, determines how many files are in the folder, and reads all of the file names into a string array.  After getting all of the file names, the code reads the first file (see readAutonCSV.vi).  Also, encoders are opened in Begin.vi so the autonomous software has sensors for feedback.

 Disabled.vi:  Open selectAutonMode.vi  The code reads two buttons on the driver’s joystick – one button cycles UP the file list, the other button cycles DOWN the file list.  If the driver exceeds one end of the file list, the code wraps back to the other end of the list.  After a button press, the newly selected file is read using readAutonCSV.vi.  The starting position is updated from the first column of the CSV file.  All sensors are reset to 0.

 PeriodicTasks.vi:  There is a lot of code here for controlling an elevator and arm. Feel free to ignore it (or use it if you want to).  The code needed for autonomous is at the bottom of the fast loop:  The left and right drive encoders are read.  The average of the two encoders is used as distance feedback (how far the robot has driven).  The difference between the two encoders (along with some math) gives the heading of the robot.  The distance and heading can be used to calculate the robot’s X,Y position on the field (see CalcXY.vi).  Note: this two-encoder setup can be replaced with a single encoder and a gyro for the heading.

 Where to put the files on the cRIO?  The example code is set up to use a folder called “auton” that is created in the root of the cRIO drive. To do this:  Open FileZilla (or your favorite FTP program) and connect to the cRIO.  To connect to the cRIO, in the “Host:” box, type: “10.xx.yy.2” and click the “Quickconnect” button. (Note: xx.yy is your team number. For example, team 51 would be Team 2112 would be , etc.)  The left half of the FileZilla window will be your computer. The right half is the cRIO.  On the cRIO side in the box where you see “Filename”, right click and select “Create directory”.  You will see a new folder – name it “auton”

 How to get the files to the cRIO?  Connect using FileZilla or other FTP program.  In the cRIO side (right side in FileZilla), navigate to the “auton” folder you created.  In the left side, navigate to your.csv autonomous scripts.  Drag from the left side, drop in the right side. Your files will be copied to the cRIO.  What if I want to delete files from the cRIO?  FileZilla is just like Windows Explorer.  In the cRIO side (right side in FileZilla), navigate to the “auton” folder, select the files you want to delete, then press the delete key. It’s as simple as that.

 Try creating some simple scripts for the example autonomous software that was provided. Get them to run in the simulator and make sure they do what you want.  Once you get a feel for the scripts, use the simulation tool to develop your own autonomous software.  Try creating a few primitives on your own and get them working in simulation.  Use the example code to get it working on your robot – you may need to add some encoders and/or a gyro to your robot.

 Try expanding the number of parameters the primitives need (currently there are 5 rows to the script file – row one is the ID, so that leaves 4 parameters).  If you expand to use more parameters, you will need to make the following changes: 1. readAutonCSV.vi – change “number of rows” constant into ReadFromSpreadsheetFile.vi. Don’t forget to do this in autoSimRun.vi as well. 2. unpackAutonArray.vi – expand to unpack more rows from AutonArray.

 Create a primitive that actively holds the robot’s position on the field. This is useful when using an appendage to score (especially in games where defense is allowed during autonomous mode).  Create a primitive that uses the arm position as an exit condition. You’ll need to add an arm model to the robot model to make the simulation work.  Create a “Go to XY coordinate” primitive.  Create a “drive an arc” primitive.  If you can think it, you can create it. Have fun.