Mouse Sensor

Hey, Im working on a simple robot that needs to avoid a 5 inch by 12 in obstacle and then return to its lane. Im using an ultrasonic to detect the obstacle. It works well but the robot dosent know when to return to its lane. I thought a mouse laser sensor would work perfectly as it would tell me the displacement. But from what I've researched it looks really hard to hack a mouse, and buying an optics flow sensor is too expensive. It seems like it should be really easy to use a mouse on Arduino, just a usb to serial adapter?
Any thoughts?
Advice?

Thanks,
Joe

You have a robot going down a lane.

It uses a front sensor to detect when an object is ahead.

It changes position to avoid object.

I would then use a side sensor to determine that the avoidance was successful and it was time to return. Or put the front sensor on a servo and rotate it 90 degrees.

Or make an assumption that obstacles take x amount of time to go by, wait that amount of time, and return blind.

Thankyou for you reply,
Yes, the robot is going down a two lane road 16.75 inches wide. Checking that the avoidance was successful would be useful, but I need to avoid the mistake not know that it just made one. Using a timer to know when to turn back was my first bet, but It's proven far more inaccurate than I suspected. The batteries, and wheel traction change considerable each time, resulting in far too much inaccuracy. I either need a feedback loop for my motors or I need to have displacement sensor. So far the best I found is using a ps2 mouse to calculate the displacement. This might be ok because my terrain(plywood) is relatively flat but its somewhat risky. Any other thoughts?

I have no idea what you are talking about when you talk about displacement. These are boats?

I don't know why a side sensor won't work for you. If you can detect the object ahead, you can detect when it is no longer beside you and it is safe to move back, regardless of batteries and wheel traction and such. You only need look at the side sensor once you have initiated an object pass.

Thanks for you reply I'm sorry for my unclarity. No thease are not boats, they are little 10in robots. Im not worried about if im past the obstacle but if my angle to avoid it was sufficent.For example, Once the robot detects the obstacle, it turns about 45 degrees to get into the other lane. My problem is is that sometimes the 45 degree turn is only 15 degress or 80 degrees resulting in a crash into the obstacle/otherlane. I think this is due to randomness because of traction/battery power.

Are there side walls? Maybe you could have two side sensors one- one on each side. Maybe that helps you "see" the track and correct the turn.