View Single Post
  #2   Spotlight this post!  
Unread 30-03-2007, 03:25
theycallhimtom theycallhimtom is offline
Registered User
AKA: Tom Conerly
FRC #1540 (The Flaming Chickens)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Lake Oswego, Oregon
Posts: 52
theycallhimtom has a spectacular aura abouttheycallhimtom has a spectacular aura abouttheycallhimtom has a spectacular aura about
Send a message via AIM to theycallhimtom Send a message via MSN to theycallhimtom
Re: Simple dead-reckoning autonomous

Good post. I think that many teams could put just a little work into a simple autonomous mode and get some benefit. As he said something as simple as driving forward and blocking an area can be helpful.

There is one thing I would like to point out. From my experience calculating RPMs has not worked. In theory it should work, but it doesn't. For simply going straight there is still the issue of getting up to speed and slowing back down. Attempting to calculate the desired motor values to any reasonable degree of accuracy is impossible. Turning creates even more significant error. There really is no good way to calculate how far the robot should go based on motor values from the code.

The easiest way to go forward some distance or rotate some angle (without sensors, encoders or a gyro would make it a lot easier) is just trial and error. Try driving forward for 2 seconds, if that is too far then try 1.5 seconds and keep on narrowing it down until your happy with it. An example would be:

Code:
void autonomousFunction(void){
    static int timer = 0;//Note: this function is called ~38 times a second
                              //So divide timer by 38 to get time in seconds
    if(timer < 38*2){ //go forward for 2 seconds change this depending on how 
                           // far the robot goes
        LEFTMOTOR=RIGHTMOTOR=255;
    }else{
        LEFTMOTOR=RIGHTMOTOR=127;
    }
    timer++;
}
There is a small bonus for autonomous even with dead reckoning. You can get closer to the rack, get to the far side of the field to play defense, or block someone with a scoring autonomous. Heck even using dead reckoning to score works occasionally, and it is a lot easier than working with the camera.
__________________
rankmaniac
2007 San Diego Motorola Quality Award
2007 Pacific Northwest Chairmans Award
2007 Pacific Northwest Finalist (2nd Seeded Team)