32
US First Kickoff 2013 Software Programming (And Control System) Daniel Kohn University of Memphis

US First Kickoff 2013 Software Programming (And Control System) Daniel Kohn University of Memphis

Embed Size (px)

Citation preview

US First Kickoff 2013Software Programming

(And Control System)

Daniel Kohn

University of Memphis

What will be presented……

Veteran Teams• Changes from Last

year

Rookie Teams• General intro

programming options

For Everyone• Classmate Updates / Install

This is NOT intended to TEACH you how to program, just give you an overview of the control system and programming changes from last year and to show the various programming options teams have.

Classmate PC• Rookie Teams

There will probably be NO Software loaded on the Classmate when you get it.

• Veteran Teams Classmates (driver station NetBook) will be re-

imaged. – BACKUP FIRST!

Classmate PC (Rookie Teams)• See handout, but start at the section

“Applying the Image” on page 9 for how to load up the software from the USB Thumb Drive provided in the KOP.

Classmate PC (Veteran Teams)• You will have to follow the Handout from Page 1. It

steps you though: Downloading 7zip and RMprepUSB (software

you need to create the image) Selecting and downloading the image Creating the USB Thumb drive to install from The installation process

• you need a 8Gbyte USB Thumb Drive or larger

VETERAN TEAMS

New with LabVIEW in 2013

LabVIEW• Still LabVIEW 2011• New Features

More options when starting a new robot project– Arcade drive, Mecanum Drive, Arcade Drive with Arm– Simulation Available (BUT….)– [DEMO]

Easier to add information to Driver Station Dashboard– New “Dashboard” Library

LabVIEW• New Features

Debugging– Project Performance Measure

> TOOLS | Profiles | Profile Performance and Memory

– Log Viewer Installed to startup menu (hidden last year)

– Elapsed Times VI (help debug timing issues)> Place anywhere to measure time to run code.> Use control space shortcut then look for “Elapsed Times.VI”

NOT “Elapsed Time”

– Drive Safety can be disabled (and also adjust timeout)

LabVIEW• Help | Explain Error

Lets you type in an error code and get more info

LabVIEW Seminar• NI is sending out trainers to Quick Builds to

do LabVIEW for FRC Training• NI is coming to the Memphis Quick Build

next week (Jan 12). All teams are welcome to attend the seminar.

Java and C++• Biggest change is Robot BUILDER (Java or C)

Wizard that lets you define robot systems and builds system code for you.

http://wpilib.screenstepslive.com/s/3120/m/7882/l/88538-overview-of-robotbuilder

Generates I/O Wiring table for you Will keep your code intact even if changes are made via

Robot Builder – so long is code is placed outside of comments “Begin Autogenerated Code” and

“End Audogenerated Code”

Smart Dashboard – lets you test sub systems (great for in PIT testing)

C/C++Install• Unlike Java who’s install is straight forward,

C/C++ has issues Make sure to read the instructions carefully

when installing. 2 Disk install – if you answer questions

incorrectly during the install of the first disk, C will not function properly and you will have to uninstall and start again!

Hardware• Radio

All teams getting a D-Link DAP 1522 Rev B WARNING – This looks very similar to the old radio used

last year, but you MUST USE THIS RADIO

12v to 5v Power Converter STILL NEEDED

Hardware• Talon Motor Controller • Victor 888

Victor 884 still legal

ROOKIE TEAMS

Programming Options• LabVIEW• C/C++• Java

LabVIEW - Advantages• Made By National Instruments (NI)

Makers of the cRIO Control system• Graphical Programming Language• Lots of support on line in forums and from NI

NI is a huge supporter of FRC and FIRST• Lots of built in documentation (help on every VI,

examples for every sensor/system)• Now includes a robot simulation tool for off robot

testing

LabVIEW - Disadvantages• Many windows need to be opened to do

anything (hard to do on the Classmate)• Hard to find things the first time you need

them.• Programmers (those who know standard

programming languages) have a hard time with the graphical nature of LabVIEW

Sample LabVIEW Code

C/C++ Advantages• Common programming language

Mentors and students might be more comfortable with C/C++ if they programmed in C before

• Many books on C/C++ (but NOT the specifics for FRC teams)

• Mentors and students who know C/C++ will have a shorter learning curve

C/C++ Disadvantages• Licensing issues!• Installation issues (discussed previously)• Rumor has it C/C++ support might end in

2015

Sample C/C++ Code

Java Advantages• Uses NetBeans (commonly used by

programmers)• Mentors and students who know Java

already will have a very short learning curve.• All public domain – no licensing issues in off

season and no registration required.

Java Disadvantages• Newest Language (only the 4rd year offered)

Sample Java Code

Robot Builder• With the introduction of Robot Builder, Java

and C/C++ will be easier to use for teams who have programming mentors who know those languages (in the past many mentors could not get over the issues of defining robot hardware, this is now done in Robot Builder)

Where to Start• Basic code

Each language has basic robot code or templates available

Don’t be afraid to search the internet, some teams post code from previous years!

• HINT: the basic code usually uses the standard wiring (don’t deviate from the standard wiring or code will not work)

Keep Current• A common rookie mistake is not to keep the

software up to date.• Check the 2013 software update website

often.

Other Comments• If you are NOT using LabVIEW, you will need some

of the files included with the LabVIEW Install

• You will probably want to do your programming on a computer with a bigger screen (laptop)

• If you plan to use the Robot Simulator in LabVIEW, you will need a Laptop with higher specifications

Thanks to…..• FRC Blog

http://www.usfirst.org/roboticsprograms/frc/blog

• FRC Website http://www.usfirst.org/roboticsprograms/frc

• National Instruments https://decibel.ni.com/content/community/first

• WPI http://wpilib.screenstepslive.com/s/3120

Presentation• This presentation will be posted at:

http://memphisfirstteams.org/