Log in

View Full Version : need last years programs


Edourdo
04-10-2006, 21:59
If any one who was able to make there autonomous mode work with there camera I would like to have a copy, and if anyone knows how to help me along with making a difference engine I would be more than happy thank you. :)

AdamHeard
05-10-2006, 00:59
What exactly do you mean? It sounds like you're having more problems aiming than anything.

We consisantly made 4-7 of 8 in autonomous (our shooter was slightly innacurate due to wobbling, but the aim was dead on) by driving to postion, aiming our turret based on the camera with a PID loop. And then waiting until we had the turret in the right position and had more than 1/4 of a second of lock on from the camera. From this we know our turret is in postition, the camera is for sure locked on (not just noise) and we're ready to shoot; then we enable our feeder to shoot.

So, It took all that for one autonomous mode so I'm not sure what part you need help with. Could you be more detailed with what you want, what you have done, what you were results were and your robots capabilities.

chris31
05-10-2006, 06:56
Code for one robot isnt going to work on another nessisarily. We would have to know more about your design. If you want just the logic i can tell you. But for code you will need to post where you have your motors, PWMs, etc.

JamesBrown
05-10-2006, 14:59
Even alot of the logic varies based on robot desigs, some teams did pan and tilt, some teams used gyros to correct, some used encoders. Let us know what you are looking to do and what you habve to work with.

As a note, my code is no commented very well and it calls alot of functions rather than writing the whole autonomous code in the area where ifi says to do it. It would be very difficult for you to read through all of our code and understand it.

If you dont know what I mean about calling functions rather than typing out all the code look at this, it is 237's 2005 autonomous mode, they capped the vision tetra(If I remember correctly)

while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */

/* Make sure compressor is full. */
Check_Compressor();
printf("Cam tilt: %f", cam.tilt_servo);

/* Get vision tetra and cap it. */
if(Have_Tetra_Flag == 0)
{
Get_Vision_Tetra();
}
else if(All_Done == 0)
{
Cap_Tetra();
}
else
Finish_Auto();

Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}

turns out all you have to do to cap in auto is to see if you have a tetra, if you dont go get one and pick it up, pretty simple huh (note sarchasm in reference to simplicity) Any way, back to my point our code wont work for you. Besides it is alot more fun for us to help you with an algorithm than to have you copy ours.

James