Quote:
Originally Posted by GGCO
My team, 904, went with the track the trailer and score in it method. It works pretty well. It's still a little buggy, but we can fix that easily.
I did notice at Traverse City team 2645 also was tracking and shooting. I was wondering if one of their programmers could fill the rest of us in on what their secret was?!? From what I could tell the robot drove towards the target, found it, backed up when the image percent was too large, and then lobbed a cell into the trailer. Pretty impressive.
Anyone use an ultrasonic sensor for their auto mode?
|
We built our code from the "2 color servo tracking demo". Basically we looked at the part in the code that spit out the servo angles for the x-axis servo on the gimbal. These were an angle value and so consequently ranged from 0-170. We called angles 0-85 (85 = 170 / 2) "left turn". We made a function that linearly increased power to the drive wheels as the angle got closer to 0. angles 85-170 were considered "right turn" and were scaled the same way. additionally, we told the robot not to move if the camera wasn't currently tracking a target. After all of this, our robot would turn but not drive towards a target. Next we found the part in the code that spit out the "area %" of the target on the screen. We created a function that would add an amount to the drive speed of both motors (so that the motors would drive forward) that increased linearly based on the distance (area %) that the camera saw. Additionally, we added a switch on our robot to switch between the colors that the camera is currently tracking (green/pink or pink/green).
If you do this type of programming in Labview, I suggest that every time you make a multiplier in a function you first make a knob on the front panel so that you can "tweak" the outcome of the function. Then when you are done go to the block diagram, right click on the knob or dial and select "change to constant". Doing this will ensure that the numbers you have chosen in your functions always stay the same. If you leave them as a dial they will reset themselves.
We are currently working on getting the robot to move out on to the field 3 seconds initially, and then start tracking. Ideally we would have had a "field position switch" which would allow us 3 different autonomous modes, but unfortunately a firmware update disabled this ability for us. Also unfortunate was that we already had the control panel made with the switch mounted.
I wrote a ton, but I hope that lets you in on the "secret"
