|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Record Robot Actions
Quote:
|
|
#2
|
|||||
|
|||||
|
Re: Record Robot Actions
Quote:
You can see the recording used in this video to hang on the lower bar. Our driver lines up under the bar and pushes a button and the robot drives backwards and drives forward. This was recorded on the practice field at the competition when we realized that our hanging mechanism was very sensitive to the speed that you hit the bar at. After the recording was done it was an extremely reliable mechanism. http://www.youtube.com/watch?feature...NufVQ#t=12 1s Last edited by notmattlythgoe : 08-05-2013 at 16:45. |
|
#3
|
|||||
|
|||||
|
Re: Record Robot Actions
Quote:
|
|
#4
|
|||||
|
|||||
|
Re: Record Robot Actions
Quote:
|
|
#5
|
|||
|
|||
|
Re: Record Robot Actions
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 |
|
#6
|
|||||
|
|||||
|
Re: Record Robot Actions
Quote:
|
|
#7
|
|||||
|
|||||
|
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 ![]() |
|
#8
|
|||
|
|||
|
Re: Record Robot Actions
Be sure to fix my misspelling in the path.
Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|