I have some results finally and I am pretty happy with it. But before I show you the results a little refresher on what I was trying to achieve and why this thread was created because there have been quite a few posts in between so it might not be clear for a new reader what I am talking about.
Alright, I am working on an application that requires tracking users trips on vehicles accurately. I was using publishing location updates on fixed time intervals but this was resulting in lot of data consumption. I then moved to distance based approach where asset tracker shield would publish a location update every 200 meters. This was much better than time based approach because now if vehicle stopped there would be no publish events. Still I felt that I am publishing more than what was needed. For example, if I just sent a location update whenever vehicle steered onto a new road I will be able to trace the trip route perfectly and with minimum location updates thus saving lots of data.
I was having trouble detecting steering angle or vehicle heading delta so that I can publish an event. I was trying to extract this information from accelerometer readings but these were not reliable and were instantaneous so being able to read the right data at right time was a challenge. Lot of different ways were discussed here, but one from @harrisonhjones seemed simple enough.
So I went ahead and added a $2 HMC5883L magnetometer to the asset tracker shield and like always there was a library from Ada Fruit already available in Particle libraries section to use it. Adding both hardware and software was very simple. The firmware is now using a mix of distance based and heading angle based approach and the results are pretty amazing. Below are some screenshots of a route I traced and visualized on an android app using Google Maps.
Blue dots represent location update on heading angle change.
Green dots represent location update after 200m from last update.
Now I get very good location update on the corners. On roundabouts as you can see it does not publish all the eligilble points. I guess this has got something to do with the way I have setup the loop() code. I am pausing for a second between every iteration and I think while on a roundabout the angle is changing continuously and I miss some updates during the wait period. I might lower that interval to something like 200 ms or so and see if it improves the granularity. Overall I think it still gives a very good idea of what path was taken. Had it been just distance based, the route line segment would have cut through the roundabout on to the next road.
I hope this is useful for others who are dealing with similar problems.
Thanks everybody for your help and valuable suggestions. Particle community rocks !!!