Here are some gyro issues you still have to contend with.
- Lag. The gyro reading lags behind the actual movement. If, for example, you are spinning and waiting for a reading of 90 degrees before stopping the movement, you will be beyond 90 degrees after you stop, unless you are moving very slowly.
- Accuracy. They gyro only reads in increments of 1 degree and it's also not terribly accurate (repeatable).
- "Offset". As your gyro algorithm does it's processing, the steering correction will restore the heading, but you may no longer be on the same linear path. Let's say your robot has a left bias. As it turns off course to the left and the gyro algorithm corrects back to the right, you may be back on the correct heading, but your path is now slightly to the left of where you started. You will zig-zag like this all the way there.
If you can deal with those issues, your algorithm idea is solid. But you may find that Move Steer and Move Tank are more accurate. It really depends on the situation.
I have written blocks that use the gyro to set the heading for movement, but not for in-place turns. In-place turns are made very difficult by the lag issue unless you are willing to do all your turns at the same speed and use a simple offset value to compensate (i.e., stop motors at 86 degrees, usually comes to rest at 90).
With my "Move Gyro" block, I don't even need to execute an explicit turn motion, I can say "move 10 inches at heading of 0 degrees, then 10 inches at heading 90 degrees, the gyro algorithm makes the turn automatically (and rather quickly) as it moves forward. It will be close, but the result will not be exactly 10 inches in both directions.
EDIT
After re-reading your question, I may be a little off the mark, or just not clear on what you are asking. Your use of Move-Steer or Move-Tank depends on what you are trying to do.
To turn without driving forward, you could use either Move-Tank or Move-Steer until you reach your desired gyro angle. Move-Tank should pivot mostly in-place around the midpoint between the drive wheels. A Move-Steer turn without driving forward would require maximum turning input which should keep one wheel un-powered. This is called a pivot turn and is probably better executed by operating the 2 motors independently. Turn one motor off and apply the brake, then power the other motor until your desired turn is made. You can probably do this just as accurately without the gyro. In a pivot turn, one wheel moves along an arc. The length of this arc for a given turn angle can be calculated based on the distance between your drive wheels (wheel track) and the circumference of your wheels. Thus, lock one motor, drive the other motor the necessary distance to travel along the arc. If you aren't into geometry, post a new question for the math on that.
To drive forward along a gyro heading, your algorithm idea is a good one, except for my point in item 3 above. But if your robot tracks well, that offset should be minor.
Not the Tank Move block power settings because the robot will stall at power levels near zero, so the robot will not want to reach the desired direction.
The Gyro works, but using it is not always obvious. First you'll need to solve the reset and drift issues.
– dfrevert Dec 18 '15 at 19:20