The strategy sub-team on my team is really adamant about being able to accurately hit the goal while the robot is moving at non-trivial speeds, either toward (and away from) the target or side-to-side, or both. The first case is fairly easy, due to the flatness of the trajectory of our balls, but the last two require you to know your velocity relative to the target in order to lead (or actually lag) it.
I was planning on using the gyro + accelerometers to get this information, and while the gyro is working great, it is difficult to get anything meaningful from the accelerometers. Is KW’s code coming to rescue me? Are others making strong headway (is see mixed response here on CD)? Or am I going in the wrong direction?
What are people doing to hit the target while moving without using accelerometers? Or is the dual-axis accelerometer the way to go?
the simplist way to get speed is to do time trials with your robot at different PWM outputs to the motors. Time the robot as it runs across two lines about 10 feet apart, and calculate the velocity for each PWM setting
this will give you a rough idea how fast the robot is moving. Of course the real speed will change based on battery charge level, tire wear, drive-train break-in…
The solution to this problem was a state secret during WW2. Essentially you are trying to solve the gunsite problem. WW2 era anti-aircraft gunsite had mechanical computers inside that would point the bullets not where the planes are, but where they would be in when the bullets arrived.
I don’t want to discourage you, but it is a tough nut to crack.