Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Record Robot Actions (http://www.chiefdelphi.com/forums/showthread.php?t=116736)

notmattlythgoe 08-05-2013 16:47

Re: Record Robot Actions
 
Quote:

Originally Posted by thetimemachine (Post 1273402)
Because there is theoretically more support for LabVIEW and because its supposed to be "easier" because its visual.....I fail to see the easy part:/ But I don't think we can switch to anything else because I know more [even though its just a little] LabVIEW than Java or C++ or something like that...

Now would be the time to switch if you wanted to try a text based language. A great off season project if you wanted to learn one of the other languages is to reprogram the robot in another language. If you would like, once we finish the code rewrite I can send you all of our robot code so you can see what the code for a robot would look like.

Greg McKaskle 08-05-2013 22:37

Re: Record Robot Actions
 
2 Attachment(s)
The first attached image shows one way to record all data from one joystick every 20ms until the Done button is pressed. It then optionally saves it to a file. This code would fit well into periodic tasks.

The second image shows how to read all of the data from file and play it back at the same rate.

You probably don't need all six axes of the joystick, and you may want to record more than one. If that is the case, modify the data that goes into the cluster.

If you want to record the motor values and solenoid/relay values instead, that is an easy alternative and can be output from the Drive Robot function, accumulated, and logged.

If you decide to store sensor values and add control loops to the playback, that is indeed harder, and I'd recommend instead that you put that code into Drive Robot and store the set points.

If you are worried about memory usage, you most likely don't need more than 50 elements per second for no more than 15 seconds, or 750 elements in the array. The full joystick data is 50 bytes per element. Even if you store lots more values, for 1KByte per record, you still haven't used a megabyte, so you shouldn't have any memory issues. If you want to optimize for memory, you can move the file I/O inside the loop to avoid the largish array, scale the values from doubles to smaller values, use timestamps to compress the data, or do all sorts of other fun things.

As for switching to a different language, or practicing the language your team used this year, the off season is a great time to do it. I don't know of anything in command based programming that would make this any easier. Personally, I'd encourage you to become familiar with several of the languages as they each have unique features and values.

Greg McKaskle

notmattlythgoe 09-05-2013 08:14

Re: Record Robot Actions
 
Quote:

Originally Posted by Greg McKaskle (Post 1273501)
The first attached image shows one way to record all data from one joystick every 20ms until the Done button is pressed. It then optionally saves it to a file. This code would fit well into periodic tasks.

The second image shows how to read all of the data from file and play it back at the same rate.

You probably don't need all six axes of the joystick, and you may want to record more than one. If that is the case, modify the data that goes into the cluster.

If you want to record the motor values and solenoid/relay values instead, that is an easy alternative and can be output from the Drive Robot function, accumulated, and logged.

If you decide to store sensor values and add control loops to the playback, that is indeed harder, and I'd recommend instead that you put that code into Drive Robot and store the set points.

If you are worried about memory usage, you most likely don't need more than 50 elements per second for no more than 15 seconds, or 750 elements in the array. The full joystick data is 50 bytes per element. Even if you store lots more values, for 1KByte per record, you still haven't used a megabyte, so you shouldn't have any memory issues. If you want to optimize for memory, you can move the file I/O inside the loop to avoid the largish array, scale the values from doubles to smaller values, use timestamps to compress the data, or do all sorts of other fun things.

As for switching to a different language, or practicing the language your team used this year, the off season is a great time to do it. I don't know of anything in command based programming that would make this any easier. Personally, I'd encourage you to become familiar with several of the languages as they each have unique features and values.

Greg McKaskle

I agree completely Greg. No one language is better than another, and it is a great tool to have knowledge of several different languages.

sarah_storer 09-05-2013 10:30

Re: Record Robot Actions
 
Thank you so much for the pictures that should help a lot!

I will probably look into C++ in the off season..but this and vision processing in LabVIEW will come first... [Our team is also working on making an encyclopedia for everything in FRC so that'll take some time too...]

I'll bring this up to our coach and we'll try it out:)

Greg McKaskle 09-05-2013 20:27

Re: Record Robot Actions
 
Be sure to fix my misspelling in the path.

Greg McKaskle

MathMaven 09-05-2013 23:04

Re: Record Robot Actions
 
I couldn't help thinking of The New Cool when I saw the title.


All times are GMT -5. The time now is 21:01.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi