current running through a wire creates a magnetic field.
to get the most accurate readings, halt your motors and any other non essential systems before you take measurements.
also try to locate the compass as far away from motors or power wires as possible.
obviously you need to power the compass it's self but try to isolate it from all other devices.
i've seen people put their compass on top of a mast for this reason. (eg
http://www.geology.smu.edu/~dpa-www/robo/jbot/)
but what if my compass is always moving with these motors? would the difference between angles differ? if only the angle differ its not a problem to me , i just wanna know if the difference between two angles differ, thanks folks for any feedback
i don't know for sure. i haven't actually started using my compass in my SLAM calculations.
my hunch would say that the proximity of the motors and wires would weaken the relative effect of the magnetic north pole.
my experience working out magnetic deviation on boats would also suggest this.
like on a boat though you could make a deviation chart. this is a chart of known amounts of error at each heading.
so, i'd be reasonably confident you could work out your heading accurately using a lookup table and making sure you stop your motors before you take your readings.
until you drive near your fridge that is. or any other metal object....
let us know if you decide to go the compass route. i'd be interested to hear how it works out in practice.
dunk.