I am currently making a 2 wheeled SLAM robot that will use an array of either ultrasonic or sharp IR sensors with a particle filter. I also have a MPU-6050 and GY-271 and i am looking to turn it into an AHRS. However, considering that the map is going to be on a 2-D plane, do i really need a full AHRS? Can i not just use a magnetometer to create a compass for rotation readings?
AHRS will yield roll, pitch and yaw values. In your case, you would only need the yaw reading.
You could use just the magnetometer for yaw or rotation headings, but I would not recommend it. This is because the magnetometer is susceptible to magnetic interference. If the sensor is mounted on a chassis nearby ferrous metal, this also could be a source of problem. In this case, you would have to cover it with a magnetic shielding material.
For your information, there are algorithms like complementary filter, EKF and DCM that you could use to obtain the yaw value.
$\begingroup$ Would calibration help reduce the issues caused by nearby ferrous metals or would it be a constant problem? $\endgroup$– DwoAug 6, 2017 at 14:52
$\begingroup$ Final question (i promise :) ), the robot will have an Arduino and Raspberry Pi on board. The Arduino will be collecting the sensor data and the Pi will be executing the SLAM algorithms. Would i implement the filter for the magnetometer on the Arduino or the Pi as part of the SLAM algorithm? Can i not use a standard Kalman filter as i will only be estimating one variable? $\endgroup$– DwoAug 6, 2017 at 15:03
$\begingroup$ Make sure not to completely shield the sensor from the earth magnetic field when you use the magnetic shielding material. Then you will not be able to use the magnetometer to obtain the heading signals at all. Yup, standard kalman filter will do too. $\endgroup$– goddarAug 6, 2017 at 15:11
$\begingroup$ I haven't explored how things would work out when integrating Rpi and Arduino. Previously, when I developed the AHRS system, II collected all sensors as well as ran the DCM algorithm using Arduino and it worked well. Therefore, I would recommend using Arduino as it is better equipped at handling real-time applications. Not so much the case with RPi $\endgroup$– goddarAug 6, 2017 at 15:38