Top Banner
US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis
40

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

Dec 25, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

US First Kickoff 2012Software Programming

(And Control System)

Daniel Kohn

University of Memphis

Page 2: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

What will be presented……

Veteran Teams• Changes from Last Yea

r

Rookie Teams• General intro

programming options

For Everyone• Classmate Updates / Install

Page 3: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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!

Page 4: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Classmate PC• See handout “Updating the CTL Classmate

PC” for how to load up the software from the USB Thumb Drive provided in the KOP

• Note: Make sure you get the right USB Thumb Drive for your Classmate (E09 For Veteran Teams E11 for Rookie Teams)

Page 5: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

VETERAN TEAMS

Page 6: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

New with LabVIEW in 2012

Page 7: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

New Version Of LabVIEW• Upgrading from LabVIEW 8.6 to LabVIEW

2011• New Features

VI Snippets Probe Window Changes to Begin.vi Kinect driving code

Page 8: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

VI Snippets

• A built-in screenshot capture in LabVIEW.• Highlight section, then go to Edit>Create VI

Snippet from Selection.• File saves as .png.• Dragging picture into

block diagram will paste

the code.

Page 9: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Probe Window• A window that lists every open probe.• Creating a probe normally will open the

window and apply future probes to the window.

Page 10: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Changes to Begin.vi

• Modules are now numbered by instance of that module.

• In a typical setup of 1 Digital, 1 Analog, and 1 Solenoid, each module is known as the 1st of its kind.

Page 11: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Basic Kinect Driving Code• Kinect treats your arms as two joysticks, and

is configured for basic tank drive.• Your left arm maps to axis 2, and your right

arm maps to axis 4.• While testing, remember to

limit your motor output.

Page 12: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Driver Station

• New E-Stop• # Diagnostics Tab• Kinect Skeleton

Page 13: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

New E-Stop

• No physical E-stop button needed for testing.• Spacebar now acts as E-stop, disabling robot

and requiring a manual reboot.• Enter is the new disable button.

Page 14: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

# Diagnostics Tab

• New Driver Station tab.• Collects data from robot and graphs.• Adjustable graph (information, color, graph-

line type)• Graphs Packet loss, packet trip time, robot

voltage, and robot CPU.

Page 15: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Kinect Skeleton

• New tab for viewing Kinect data.• Shows joints, as well as x, y, z coordinates of

arms.

Page 16: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Hardware• cRIO–II• 2012 Jaguar

Page 17: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

cRIO-II• 4 module slots, 1 Ethernet port, 1 serial I/O port.• Cameras now plug in through the gaming

adapter.• DIP switches now activate through the Imaging

Utility.

Page 18: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

2012 Black Jaguar• Same model, different firmware.• Optional built-in ramp mode (524 steps per

millisecond, 0.125 seconds from -1 to +1)• Available by aligning jumper pins horizontally

(opposite of picture)

Page 19: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

cRIO Imaging Utility• Now displays model of cRIO currently

connected.• DIP switches can be toggled here.• Shows installed location of modules.• Only accepts modules in specific order

(1-Digital, 2-Analog, 3-Solenoid, 4-Any module)

• A cRIO-I is seen as two cRIO-II’s glued together.

Page 20: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Kinect• Will only run on computers with Windows 7.• Both the Windows Kinect SDK and Microsoft

Visual Express are required on the Driver Station.

• KinectServer.exe runs in the background of the Driver Station, converting Kinect data to Driver Station data.

Page 21: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Kinect Driving Positions• Neutral (both arms at 0)

• Full Forward (left arm at 1, right arm at 1)

• Full Reverse (left arm at -1, right arm at -1)

Page 22: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Other Notes • Programming in C++ and Java pretty much

the same as last year• WPILib only modified slightly (mostly to do

with 4 or 8 slot cRIO)• Sorry – could not find anything on how the Kinect is

integrated to C++ or Java

Page 23: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Making Connections-Network

CANoptional

CAN optional

Pit tethering

BothFRC IIFRC IOptional

Page 24: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Making Connections - Power

Optional 24v

Page 25: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

ROOKIE TEAMS

Page 26: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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

Page 27: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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 build in documentation (help on every

VI)

Page 28: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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 (better in 2011)• Programmers (those who know standard

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

Page 29: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Sample LabVIEW Code

Page 30: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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

Page 31: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

C/C++ Disadvantages• In the past there has been Licensing issues!

Page 32: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Sample C/C++ Code

Page 33: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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.

Page 34: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Java Disadvantages• Newest Language (only the 3rd year offered)• Least amount of help/info available

Page 35: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Sample Java Code

Page 36: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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)

Page 37: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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

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

often.

Page 38: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

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)

Page 39: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Thanks to…..• The Fighting PI (Team 1718)

http://www.fightingpi.org/first-robotics-competition/

• Hauppauge Robotic Eagles (Team 358)• Bill’s Blog

http://frcdirector.blogspot.com/

• FRC Website http://www.usfirst.org/Default.aspx

Page 40: US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.

Presentation• This presentation will be posted at:

http://memphisfirstteams.org/