2059A Innovate Video

Literally only decided to actually do a video today.

Enjoy!

I would greatly appreciate it, if you posted your code of the rerun and gave a small explanation of the code, so others and I could have a chance to learn this. I’ve been researching this for a long time now and I could never really find anything on replaying driver control. I also know it must of taken a long time to develop and thanks again!

  • Casey

No can do, sorry. I’ve agreed not to post any rerun code on the forums.

Casey, If you understand how to use Encoders, they you should be able to do this. Our team uses time to record our autonomi, and then log the controls, and certain Amount of time that they have been engaged for

I understand how to use encoders and I know recording the movements has to do something with using the debug stream but other than that I couldn’t get any rerunning to work with even some basic methods I’ve tried. Could you give me some pointers?

0x2A47B63D
0x4B789DC3

Sorry couldn’t resist :smiley:

What methods HAVE you tried?

I have tried individually driving my bot to a location and then writing down that encoder value and write the code myself based on that value ( and this worked fine ), also I’ve tried doing the same with the potentiometers on my lift, but I could never figure out how to play back these methods in autonomous. Also are you using RobotC or EasyC?

He uses robotc. The code is the same concept as writing it down just the robot writes it down.

Nice robot, looking forward to meet you at worlds! =)

OMG. OMG. I have seen this on facebook and I keep wondering how this is done. Yes we can uss encoders and record each piece of action separately. But this… did you record the function between the current output and time??? Or did you record the joystick input and converted it to autonomous coding? We all wanna know please…

Read the video description.

^

The video description actually does explain how the code works. Sort of.

Hey I was poking around the Internet and found this, I am going to do some testing with this myself but thought you might want to take a look at it. It is by jpearman he’s a very good programmer and if you ever need any tips just ask him, and I also think this is where 2059A got a decent bit of their code for the rerun task

https://vexforum.com/t/robotc-file-system/25007/1

-Casey

I will just say right now that that is NOT what he used at all; it’s simpler than you think it is.

All my rerun code is 100% written by me, and like Eli said, it’s a lot simpler than that.

My take:
You’re measuring encoder values every X millisecs and outputting to the Debug stream something like this:


[encoderLeft],[encoderRight],[time],

so for example,


1840,1250,6000,

After like 2 seconds of running the debug stream might look like this (time bolded):


0,0,**0**,60,80,**500**,200,120,**1000**,600,700,**1500**,900,950,**2000**,

After that you copy the stuff from the debug stream, put it into an array.

When replaying it, the program takes each set of data (3 array entries) and uses PID to accurately move to that position.

I haven’t worked much with encoders or the debug stream though so I don’t know if this is plausible. I’m probably dead wrong lol. this is the simplest solution that matches your description that I can think of right now

You’re extremely close.

And it’s even simpler than that.

Hmm simpler? I’d guess take off the time from the array since you can assume what time it’s at if you know there’s X millisecs in between each record.

Maybe even put it into a 2d array, that would make it easier to get the values from the array.
Debug stream should then output this per one entry:


{[encoderLeft],[encoderRight]},

so for example after running it after a bit


{0,0},{60,80},{200,120},{600,700},{900,950},

Then it would be easier to get encoder values because all you have to do is:

arrayName[0][0]; // left encoder value for 1st record
arrayName[0][1]; // right encoder value for 1st record

Did you use the encoder to read motor speed along with the encoder value? So that you change the motor output along with the encoder value change