![]() |
2220's Play/Record Macro for Autonomous
Hey all-
Team 2220 implemented this at the Central Illinois Regional when Team 4009 DNA told us about a super useful tool they wrote to code autonomous programs. They had their robot programmed in Python, so we spent the night transferring the code into Java and making it work with our setup. https://github.com/DennisMelamed/FRC-Play-Record-Macro Here's the gist: you press a button in teleop while you're practicing that records any motions you make into a .csv file stored on the roboRio. Then during autonomous, you have it read back that file, outputting the exact same values to your motors/other things. Easy to setup, create, and change autonomous programs quickly and without a lot of planning. Thoughts/improvements? Big thanks to Team 4009 for the idea and their code in python (you can find the link to their code in the github readme) |
Re: 2220's Play/Record Macro for Autonomous
Sounds cool.
Question: Is it easy to go back and clean up some of the commands? Say the driver didn't go forward enough on the first try and had to bump it a little. Is it easy to adjust for one smooth motion instead of two? |
Re: 2220's Play/Record Macro for Autonomous
This sounds pretty neat and would be very useful. Nice work. Have you used this in competition? How has it gone?
|
Re: 2220's Play/Record Macro for Autonomous
We attempted this also, but could not get playback to work.
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
What does the BTStorage class do? Is it important? It isn't in the repository.
|
Re: 2220's Play/Record Macro for Autonomous
Is there a version in labview?
|
Re: 2220's Play/Record Macro for Autonomous
Yes 2252 made a 3 tote auto using the same system in labview and was successful 11 out of 14 times
|
Re: 2220's Play/Record Macro for Autonomous
That's amazing!
Funny coincidence, too - the FLL team that I coached last year built pretty much exactly this, but it ran on an EV3 that was controlled via Bluetooth by another EV3. They ended up winning the Software Award at the Oregon State Championship, and you guys deserve to win something for this - it's a great piece of work. |
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Going to talk to our lead programmer about this. Being programming is our strong suit and next year we are losing him we need to explore different things before we lose him.
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
https://drive.google.com/file/d/0B-Q...ew?usp=sharing Using recording and open office to edit the file we were able to develop our 3 tote auto in just a little over two hours. |
Re: 2220's Play/Record Macro for Autonomous
Cool stuff, glad to hear a python team did it first.. :D
In 2003, the first year that FIRST had autonomous modes, I was a senior in high school and I implemented this exact same type of thing that year in PBASIC. Only had 22k of flash memory to write to though... but it worked like a champ! |
Re: 2220's Play/Record Macro for Autonomous
Hey, take this to worlds with ya, ok? :D
|
Re: 2220's Play/Record Macro for Autonomous
Just an update for those still interested in this- after some debugging, the entire setup should be much more stable now, hope that the changes will help.
|
Thank you and Team DNA for this awesomeness. Do you mind if i work on making a universal version of this?
|
Re: 2220's Play/Record Macro for Autonomous
One of the most clever things I've seen yet. Nice work.
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
In most cases, I am terrible at writing an autonomous sequence, but it is in this case that I believe I can get a firm grasp of the concept. |
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
I wrote something like this a while ago, and I've got a little bit of advice.
During a competition, any periodic functions aren't exactly constant. Their timing may change, especially on a field, as it waits for data from the Driver Station. To remedy this, use something like a 'heartbeat' thread, that triggers on a constant rate, all the time (for us, we use 50hz). This means you don't get the next data point at an inconsistent rate, which causes jerking in driving and/or any other mechanisms. Other than that, it looks good :). Good luck in Autonomous! |
Re: 2220's Play/Record Macro for Autonomous
Jaci - Did you just use a timer in your thread to pace the reads and writes, or some other triggering mechanism? Thanks!
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
EDIT: Whoops, i misunderstood. We do reads and writes as we go along. Since the RIO non-volatile storage is flash, we've tested that just reading from a BufferedReader is fast enough to not cause hickups |
Re: 2220's Play/Record Macro for Autonomous
Thank you!
|
Re: 2220's Play/Record Macro for Autonomous
We did this last year, but wound up not using it due to inconsistency of the motor values due to battery charge. Since a motor running at a speed of, lets say, 0.8 runs at different speeds depending on the charge of the battery. This causes the autonomous, depending on the battery charge, to look right, but wind up not driving/turning the correct distance. How did you guys tackle this problem? Do you incorporate encoders and/or a gyroscope?
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
Has anyone done this for C++?
|
Re: 2220's Play/Record Macro for Autonomous
Quote:
EDIT: The battery voltage problem was something we noticed in the first day, which is why we switched to PID. This is what I'm warning the creators of this macro about :P |
Re: 2220's Play/Record Macro for Autonomous
Quote:
That's just my opinion though, I still think record/play is very effective, especially for games like 2015. For 2016 though, I can see the defenses causing issues. |
Re: 2220's Play/Record Macro for Autonomous
Quote:
|
Re: 2220's Play/Record Macro for Autonomous
We were able to accomplish this in C++ by representing the input in a struct:
Code:
Code:
Code:
This feature has helped our team for more than just autonomous. For example: since we store the recording in a buffer (and a file), we can use it as a circular buffer, allowing us to loop over driver input while we PID tune without having to touch the controller. |
| All times are GMT -5. The time now is 01:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi