Trying to correct the measurement what I am getting from 1260MB. When i measured I found out that the sonar was giving 36cm against a distance from ground of one meter. Guide me if this function is responsible for range calculation in AP_RangeFinder_SharpGP2Y.h


int convert_raw_to_distance(int _raw_value)
     if( _raw_value == 0 )
         return max_distance;
         return 14500/_raw_value;


If it is so then what is 14500 thing how did it come. If I can find out this then I can apply the correction to get the real value.


While measuring this I am just using CLI and APM is not connected to any motor.

Views: 685

Reply to This

Replies to This Discussion

I didn't mention this at the time, but I would focus even more on the 20-30cm range to get a more accurate reading there, then test that out to 700cm or so. I'm not sure if you will find 1.4 as ideal. There are a range of other formulas which might be more accurate, but I suppose you only need it just so accurate...


As I said in the other thread on this, I wanted to do more testing, especially in the 20-30 cm range, but haven't found the time. So many wonderful things to work on. But I hope this discussion was helpful...


I've done some analysis of why this compensation is required

read more here



DIY Drones Monthly


Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2016   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service