Quote:
|
Originally Posted by Abwehr
Servos are position-commanded. A pwm value of 127 is center, 0 is one extreme, 254 is another.
Motors are velocity-commanded. Pwm 127 is neutral, 0 is full reverse, 254 is full forward.
You have to translate between the two. Using an encoder or pot and a feedback loop is one way.
|
Better yet.. read back the "wanted" pan servo rate from the camera, convert that into an angle relative to the bot in radians, and either
a) Turn the bot until the pan servo reads 127 (0 degrees)
b) Use a gyro (It would be a shame if a team skimped out on using one of these, seeing as we got a pretty nice one in the kit!) and turn to the calculated angle.
c) Use a combination of both: Lock onto the target.. get the relative angle.. turn UBER fast using the gyro to slow down.. and reposition yourself by using choice A.