how to drive robot straight...

You have two identical wheels and do the same things to both, but the path isn't straight? Welcome to the real world!

The frictional condition on the ground varies between the wheels so they will never go straight even with encoders saying they've spun the same amounts. When you started your motors, did you apply full power right on, or did you ramp up power from low to high? Same goes with stopping. Also you should slow down overall speed to make sure you always have traction. If you can do the above, you will get straighter. To get it really straight, you need external feedback on the straightness of the path or smart grid in space to tell you where you are at and which way you head.

Ever seen GPS-controlled combines working fields? Me not, but I know they go very straight :wink:
Ever driven a car along a straight stretch of highway? Me, a lot, and I know I always need to keep my hands on the steering wheel and eyes on the road (follow straight lines).

Those were examples of external feedback (road lines) and smart grid (GPS). Many robots can follow lines drawn on the floor, FYI.