1 / 35

Programming your cRIO

Note put together by: Jim Wright Team 949 FRC season 2010 - 2011. Programming your cRIO. The Map. Installing things C++ Java LabView Deploying You Robot Sensors. Installing Things. Getting your development system built will be the hardest thing you do as a programmer.

les
Télécharger la présentation

Programming your cRIO

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Note put together by: Jim Wright Team 949 FRC season 2010 - 2011 Programming your cRIO

  2. The Map • Installing things • C++ • Java • LabView • Deploying You Robot • Sensors

  3. Installing Things • Getting your development system built will be the hardest thing you do as a programmer. • You need to be a network engineer a bit • You need the disks and many downloads

  4. Network Topography

  5. Installing Software • I've installed the software twice before I installed it for this presentation. • I still had trouble. • A bunch of websites involved to get what you need. • It's just like real world embedded engineering. • Different for Java, C++, and LabView. • However you need LabView on you machine.

  6. Get LabView installed • Your goal is to get the FRC cRIO Imaging Tool working. • This is the tool that puts your 'operating system' on to your cRIO • You don't need the Full LabView on your machine for this. • From the usfirst.org site you will find that you need a FRC update. • This will point you to the NI.com site to get the file from: FRCLabVIEWUpdate2.1for2010.zip.

  7. The cRIO Imaging tool • Get the tool installed • Connect both the cRIO and the laptop to the router by wires! • Run the tool.

  8. The tool Most important tool for the cRIO. Free on the web as an update from usfirst.org, which will point you to NI

  9. The Map • Installing things • Java • C++ • LabView • Sensors

  10. Java • I choose Java first due to the tools are all free. • WPI (first.wpi.edu) has a good document called: Getting Started with Java for FRC • Follow it.

  11. Setting your team number • Tools|Options

  12. Write your program • I can't tell you how. • We are just going to take the example code from the WPI paper. • Compile and run the project.

  13. Running • [cRIO] Welcome to LabVIEW Real-Time 8.6.1f2 • [cRIO] • [cRIO] NI-VISA Server 4.5 started successfully. • [cRIO] task 0xe62f58 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1) • [cRIO] • [cRIO] [Squawk VM] Version: 2010 FRC, Feb 15 2010, 16:46:10 • [cRIO] FPGA Hardware GUID: 0xad9a5591cc64e4df756d77d1b57a549e • [cRIO] FPGA Software GUID: 0xad9a5591cc64e4df756d77d1b57a549e • [cRIO] Information: No user-supplied robotMain()

  14. We are running? • Since we don't have a full robot nothing really happens. • We need to see some debugging information. • Two debugging tools • The debugging from the IDE • Good ol' System.out.println

  15. IDE Debugging • Instead of the Start Button hit the Start Debugging button. • [cRIO] [Squawk VM] Version: 2010 FRC, Feb 15 2010, 16:46:10 • [cRIO] [Squawk VM] File SQUAWK_DEBUG_ENABLED found, starting squawk in debug mode... • Failed to establish connection with VM: Connection refused: connect - trying again in 5 seconds... • [cRIO] Listening for connection from proxy on serversocket://:2800 • Trying to connect to VM on socket://10.9.49.2:2800 • Established connection to VM (handshake took 10ms) • [cRIO] FPGA Hardware GUID: 0xad9a5591cc64e4df756d77d1b57a549e • [cRIO] FPGA Software GUID: 0xad9a5591cc64e4df756d77d1b57a549e • Waiting for connection from debugger on serversocket://:2900

  16. IDE Debbuging • Set some break points. • Now attach the debugger to the cRIO. • Hit run on the DS • Break point should be hit

  17. Good ol' println • Adding a line like: System.out.println("Oper"); • Display on the output screen when run. • A lot easier than IDE debbugging but it will slow things down if you use a lot of it.

  18. The Map • Installing things • Java • C++ • LabView • Deploying You Robot • Sensors

  19. C++ • WindRiver is a great company, VxWorks is a great product, several cool companies use it (HP printers) • VxWorks is really tightly controlled • It was very hard to work with. • C++ is really really close to Java • WPI made both the C++ and Java library so they are identical.

  20. The Map • Installing things • Java • C++ • LabView • Deploying You Robot • Sensors

  21. LabView • Jim Wright's note: I really don't like presenting things I can't get my hands on and test drive. • I've been working on and off getting a un-expired version of the FRC LabView package on a machine I can play with. • I was unsuccessful at doing this. • So I'm taking notes from someone else for this part of the presentation. • http://decibel.ni.com/content/docs/DOC-2631

  22. LabView Creating a new FRC package. By the way I could get this working on my machine but could not get passed this screen.

  23. LabView You should get a window like the one on the left.

  24. LabView Basic Robot Main.vi

  25. LabView To test this code hit the run button on the basic robot main.vi. It will start by putting your code down on the cRIO. When your doing this, you have all the LabView tools at your disposal. However your code is not 'deployed' on the cRIO. It's just in RAM.

  26. LabView You have to deploy the code. Jim Wright again: I'm not going to even get close to telling you how to do this. There is a section in the document I'm going by that tells you. It's a lot of steps that I can't execute. P.S. This is called 'punting' in presentation language. I'm punting at this point.

  27. The Map • Installing things • Java • C++ • LabView • Deploying You Robot • Sensors

  28. Deploying You Robot No matter what lanuage you used. No matter how you programming team is set up. You need to test the robot under two conditions: Tethered Untethered You have to see if you robot boots up without anything attached to it. You need to see how you will work on your robot in the pits without your programmer in the pits.

  29. The Map • Installing things • Java • C++ • LabView • Deploying You Robot • Sensors

  30. Sensors • The sensors you can connect to the robot are amazing. • For a summer program a bunch of east Lake Washington teams built a little test robot. • It had: a quadrature encoder, a compass, three distance sensors, and the camera on the pan/tilt frame.

  31. Sensors • The compass was the Lego Hi-tech compass plugged into the digital sidecar's Lego port. • The camera was the camera that is included in the kit. • The distance sensors where the Devntech SRF04, plugged into the digital side car. • The quadrature sensor was a sensor with the standard quad A/B channels also plugged into the digital sidecar.

  32. Sensors All of the code for all of these sensors were in the documentation. We were using C++ at the time, however the documentation for all three languages have these sensors in them. Basically all of them were plug and play. The documentation was on the spot (very good).

  33. Gyro and Compass are the same plug http://team358.org/files/programming/ControlSystem2009-/LabVIEW/

  34. C++ and the Distance sensor Ultrasonic (DigitalOutput *pingChannel, DigitalInput *echoChannel) Ultrasonic (unsigned pingChannel, unsigned echoChannel) Ultrasonic (unsigned pingSlot, unsigned pingChannel, unsigned echoSlot, unsigned echoChannel) ~Ultrasonic (void) void Ping (void) bool IsRangeValid (void) void SetAutomaticMode (bool enabling) unsigned long GetRangeInches (void) unsigned long GetRangeMM (void)

  35. Fin' Every language will work for you robot. Every language is used in industry! Don't let Jim Wright steer you into Java! Every language has a powerful library that you as a programmer can learn BEFORE January. Remember, the syntax of a language is the easy part, the hard part of programming is finding good to code steal.

More Related