Mapping using an optical mouse

Hi,

Here's my dilemma:
I hope to end up with an autonomous hovercraft at the end of this exercise. The mechanical bits are done. What i want to achieve (or try and get close to) is map its path (roughly) using an optical mouse sensor (or 2). I have got the mouse interfaced with my arduino and I am getting x and y output from the mouse. Now i have hit a roadblock with figuring out how to interpret this data. The issue is that the sensor would be strapped on to the hovercraft and so when it turn the sensor turns with it, meaning it will not pick up the rotation and my map will basically end up being a jagged straight line (you get what i mean). Any ideas on how I should go about this?

Have optical mouse sensors been used for navigation and mapping on robots? Anybody with some info please do reply.

(I know I could use other sensors such a gyro to help it along but i want to try and do this with just the mice. I'm kinda strapped for cash)

Any help would be greatly appreciated. Thanks!

The issue is that the sensor would be strapped on to the hovercraft and so when it turn the sensor turns with it, meaning it will not pick up the rotation and my map will basically end up being a jagged straight line (you get what i mean). Any ideas on how I should go about this?

You don't say where you have the sensor located on the robot, but based on your description of the data, I am going to assume it is somewhere forward of the center of rotation. Thus, when you rotate, what the mouse sensor sees is a left-right translation (on the x-axis), and when the robot is moving forward-back, you see that translation in the data (on the y-axis). Correct?

If this is so, then you already have one needed measurement; that from the y-axis to know how far along a vector you have moved. What you need, is to convert the x-axis translation into a vector heading; that is, convert the value that is output into an angle (ideally in radians - but you might want another unit).

You are going to need a bit of trigonometry here to solve this; at one time, I could probably help you further, but it has been so long since I have touched such math, that I would probably botch it nowadays! However, what you are looking for is akin to a "cartesian to polar transform"; if that sounds greek to you, then you have a bit of a learning curve ahead of you, I'm afraid.

You might be able to "fake" it, by noting the amount you move (positive or negative) in the x-axis direction, and add/subtract from the angle heading accordingly; it might be accurate enough...

There is only one problem with this system: Your platform is a hovercraft. If, for some reason (maybe the platform is bumped on the side?), the platform moves sideways (ie, moves along its "local" x-axis, with no rotation), then this method (either the fake method or the cartesian transform) will think the platform is rotating, instead of translating.

Perhaps one method to get around this would be to use two or more mouse sensors - but that will make things even more complex...

You might want to invest in a compass heading sensor (so you -know- what angle you really are facing), and use the mouse sensor for translation only measurements (both along the x and y-axis)...

:slight_smile: