Magnetometer help needed

Trevor: If the heading remains constant in a given direction I would say you come a long way, so don’t give up! For that it sounds more like you have an offset that you need to take in to the calculation (for some reason) as you point out.

On my Sparki I get the same readings wherever I turn my Sparki and the magnometer on my phone shows a pretty decent earth magnetic force of 40-50 mikro Tesla. However from the Sparki I only get a maximum of -15 to +10 milli Gauss on any given axis. Thats with the wheels not turning, when I turn the wheels however the readings goes all over the place and far more than a couple of milli gauss, so the only conclusion I have drawn from my testing is that the motors should not turn when you do the readings from the magnometer since they will be faulty. Apart from that my readings are so small I can only assume my magnometer is not working properly, but I am hoping Joe can weave some magic with the driver code!

I have been researching digital directional calculation, and it appears this is nearly impossible to consistently calculate a heading with accuracy. I mean indoor navigation or having an autonomous robot using just magnetometer for direction. It seems that with the computing power we have at hand this project may not be do-able. I did find sailstech.com which is an indoor mapping development tool. This allows the mapping of public spaces for free, this information might some how be used to have an autonomous robot but again I do not believe there is enough on board computing power also this is designed for smart phone tech not robotics. My goal for calculating the heading was to write a sketch to navigate Sparki. I now think that this not possible having researched many papers that all say the same thing, this is a multi leveled problem requiring loads of computing and multiple types of location elements. Good luck with this goal but I am moving on to another sketch “Sparki Bowling” I will let you know how it goes. This is more my speed.

Bingo. We can work towards getting as accurate a compass reading as possible, but compasses are notorious for not being a reliable way to get direction, especially inside buildings with power wiring (i.e. electromagnetic antennas) running all over the place. We made sure to say so in the documentation as well.

Indoor navigation is one of the biggest difficulties in modern robotics, and has been studied to death for the last couple of decades. We are, however, getting somewhere now that there are things like Kinect. I’m personally super-excited for Project Tango, and how cheap it will get once it gets put in a few million phones:
google.com/atap/projecttango/