note put together by jim wright team 949 frc season 2010 2011 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Programming your cRIO PowerPoint Presentation
Download Presentation
Programming your cRIO

Loading in 2 Seconds...

play fullscreen
1 / 35

Programming your cRIO - PowerPoint PPT Presentation


  • 415 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
the map
The Map
  • Installing things
  • C++
  • Java
  • LabView
  • Deploying You Robot
  • Sensors
installing things
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
installing software
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.
get labview installed
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.
the crio imaging tool
The cRIO Imaging tool
  • Get the tool installed
  • Connect both the cRIO and the laptop to the router by wires!
  • Run the tool.
the tool
The tool

Most important tool for the cRIO.

Free on the web as an update from usfirst.org, which will point you to NI

the map9
The Map
  • Installing things
  • Java
  • C++
  • LabView
  • Sensors
slide10
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.
write your program
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.
running
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()
we are running
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
ide debugging
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
ide debbuging
IDE Debbuging
  • Set some break points.
  • Now attach the debugger to the cRIO.
  • Hit run on the DS
  • Break point should be hit
good ol println
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.
the map18
The Map
  • Installing things
  • Java
  • C++
  • LabView
  • Deploying You Robot
  • Sensors
slide19
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.
the map20
The Map
  • Installing things
  • Java
  • C++
  • LabView
  • Deploying You Robot
  • Sensors
labview
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
labview22
LabView

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

labview23
LabView

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

labview24
LabView

Basic Robot Main.vi

labview25
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.

labview26
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.

the map27
The Map
  • Installing things
  • Java
  • C++
  • LabView
  • Deploying You Robot
  • Sensors
deploying you robot
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.

the map29
The Map
  • Installing things
  • Java
  • C++
  • LabView
  • Deploying You Robot
  • Sensors
sensors
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.
sensors31
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.
sensors32
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).

gyro and compass are the same plug
Gyro and Compass are the same plug

http://team358.org/files/programming/ControlSystem2009-/LabVIEW/

c and the distance sensor
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)

slide35
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.