Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Just checked one I made for school. Two motors, motor controllers, Arduino, 4x20 display, distance sensor, ply frame and associated wheels, screws etc. Total weight 400g. And the commercial Zumo robots that we use come in at 300g complete with 4 AA batteries. So, I consider a 2kg limit very generous - assuming this is a school project. I also consider mercury to be a small planet.
A stepper motor has steps in it's windings e,g, 200 steps. The controller 'steps' 200 times for one rotation.
A servo motor, is a DC motor, and has feedback e,g, a disc with 200 divisions, which counts again e,g, 200/rotation.
Your control program either (stepper motor) sends out steps to each motor, or (servo motor) turns on the current and counts from the disc.
Unless you can place anything else in the room, such as a light to follow, I agree with the earlier suggestion, of a compass module.
An alternative is a tricycle undercarriage. One front wheel driven by any motor and two back wheels. As long as it's built accurately it will have no choice but to go in a straight line. A stepper will still give you more control over acceleration and distance.
If you get to use an arduino, use a gyroscope shield. Easy, easy, easy.
You should be able to stay within one degre over the 10 Onda née o o 15meters with a simple two motor robot. Just use a slider pin (small carriage bolt or plastic rod) for the third support. A caster or wheel is too complicated and creates errors.
If it's just got to go in a straight line in the direction it starts off, then you can drive it without any direction feedback - your only concern is wheel slip. In that case, think about building it with tracks not wheels - they're really good at going in straight lines, and will have less tendency to slip.
If you do need directional feedback then I like Pommie's idea of a (solid state) gyro. Although I don't see that you'd need any programming - you can get gyros with PWM outputs, so you could do all the processing analogue if you like.
Maybe you could fit a real (big, heavy) gyro to a steerable wheel and have it navigate itself mechanically, like those things that they use to sail boats (whatever they call them). That'd be interesting!