1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments...
-
Upload
nicholas-king -
Category
Documents
-
view
216 -
download
0
Transcript of 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments...
![Page 1: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/1.jpg)
1
![Page 2: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/2.jpg)
2
FRC 2010 Robot and Dashboard Projects
Doug Norman & Stephanie BriertyNational Instruments
January 8, 2010
![Page 3: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/3.jpg)
3
What You Will Learn
• How to create a Robot Project The architecture The important subVIs How to add your own code How to send data to the Dashboard
• How to create a Dashboard Project How to display data sent from the Robot
• Want to learn from the master? www.frcmastery.com
![Page 4: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/4.jpg)
4
Start from the Getting Started Window
• View>>Getting Started Window…
Project Wizards
![Page 5: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/5.jpg)
5
FRC Robot Project Wizard
• Project name• Project folder• cRIO IP Address
Team number• Click Finish
![Page 6: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/6.jpg)
6
Robot Project
• Project will be saved and open• Expand Team Code folder
Notice subVIs to edit• Open Robot Main.vi• Build Specifications
Where you build your exe to run on the robot
![Page 7: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/7.jpg)
7
Robot Main.vi
• Begin.vi• Autonomous Iterative.vi• Teleop.vi• Build Dashboard Data.vi
![Page 8: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/8.jpg)
8
Robot Main.vi
• Vision Processing.vi• Periodic Tasks.vi• Start Communication.vi• Disabled.vi• Finish.vi
![Page 9: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/9.jpg)
9
Begin.vi• This is where you initialize everything• Choose Autonomous Independent or Iterative
• Open VIs followed by RefNum Registry Set VIs
![Page 10: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/10.jpg)
10
Autonomous Independent.vi
• Open from the project or from Begin.vi diagram (double-click)
• Enable code by changing Boolean constant to T
• Edit code in the True case
![Page 11: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/11.jpg)
11
Autonomous Iterative.vi
• Does nothing if you chose Independent in Begin.vi• Otherwise its code runs iteratively like Teleop.vi• Should you use Autonomous Independent or
Iterative? Want a For Loop or While Loop? Use Independent
![Page 12: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/12.jpg)
12
Teleop.vi
• Main code for driving robot• Read joysticks, sensors, etc.• Drive motors, actuators, etc.• This is the VI you are most likely to edit
![Page 13: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/13.jpg)
13
Build Dashboard Data.vi
• Currently sends back analog, digital, relays, PWM, and solenoid data
• You could add to this data• You could remove it all and start from scratch• Notice this uses Set Low Priority Dashboard Data.vi
![Page 14: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/14.jpg)
14
Editing the Robot Code
• Suppose we want to add a gyro for direction• In Begin.vi we need to add:
Open VI Set Gain VI RefNum Registry Set VI
• In Teleop.vi we need to add: RefNum Registry Get VI Get Angle VI
![Page 15: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/15.jpg)
15
Sending Robot Data to the Dashboard• We could edit Build DashBoard Data VI
Add our new data to the Dashboard Data cluster Edit Dashboard Main VI (in Dashboard project) Uses the Set Low Priority Dashboard Data VI
• Suppose we have important Teleop data Use the Set High Priority Dashboard Data VI Send gyro data directly from Teleop VI
![Page 16: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/16.jpg)
16
FRC Dashboard Project Wizard
• Project name• Project folder• Click Finish
![Page 17: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/17.jpg)
17
Dashboard Project
• Project will be saved and open• Expand Helper VIs
Notice Receive DS Packet VI
• Open Dashboard Main.vi• Build Specifications
Where you build your exe if you want to replace DS Dashboard
![Page 18: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/18.jpg)
18
Editing the Dashboard Code
• If you edited Build DashBoard Data VI on robot Use the Low Priority User Data string from Receive DS
Packet VI on Dashboard Main VI
• If you used Set High Priority Dashboard Data VI on the robot (our Teleop VI example) Use the High Priority User Data string from Receive DS
Packet VI on Dashboard Main VI
• Either way use Unflatten From String primitive
![Page 19: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/19.jpg)
19
Editing the Dashboard Code
• Receive DS Packet VI is part of Dashboard project• Functions>>Numeric>>Data Manipulation
Flatten To String Unflatten From String
High Priority User Data
![Page 20: 1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.](https://reader035.fdocuments.in/reader035/viewer/2022062408/56649ede5503460f94beedc7/html5/thumbnails/20.jpg)
20
Conclusion• Easily create and edit a Robot Project for robot code• Quickly customize a Dashboard Project• Pass live data from Robot to Dashboard• More resources:
frcmastery.com ni.com/first
Questions?