Author Topic: Poor Man's Digital Survey Device  (Read 3855 times)

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Poor Man's Digital Survey Device
« on: October 14, 2012, 07:06:52 pm »
I wasn't going to post about this until I had done a bit more work but since something similar has come up on another thread here goes ...

Let me start out by saying that this is not what I thought I'd end up with when I thought about trying to make a cheaper disto about a year ago. But this approach has the main advantage that it works with any Laser Measure and requires no hardware modifications.

I used a £50 Laser Distance Measure off ebay


An Android phone


and an enclosure that allows buttons on both devices to be pressed


The phone is the clever bit. It has a 3 axis magnetometer and a 3 axis accelerometer, it also has a camera. The basic process is to point the Laser, read the bearing, measure the distance and then then use the camera to OCR (optical character recognition) the Laser distance reading. All the readings are logged on the phone and there is the option to save the Image of the distance measurement so that the OCR can be verified.

The phone has a Flight Mode which turns off all the transmitters and reduces the interference with the magnetometers. However there is a crucial thing to note about Android phone magnetometers - THEY ARE ALWAYS IN CALIBRATE MODE - this has pros and cons. The main advantage is that it is really easy to calibrate the magnetometers, the main disadvantage is that you always need to calibrate before taking a reading.

The upshot is that I can get better than 1% loop closures (as good as I can get with a compass).

As I said at the start I wasn't really intending to put this out there yet so I haven't had chance to post any code (and it probably needs a bit of tidying and documentation). I also think I can improve the capturing process to reduce the effects of the phone display on the calibration so work still to do. But if anyone wants to have a o let me know.

'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline mmilner

  • Experienced digging / conservation juggling
  • forum hero
  • *****
  • Posts: 1169
  • Outside Handshake Cave, Manifold Valley.
    • Darfar P.C. web site
Re: Poor Man's Digital Survey Device
« Reply #1 on: October 14, 2012, 08:26:15 pm »
That is very cool. I already have an Android phone (only 2.1 I'm afraid, a Motorola Defy) and a Disto A3, would this work with that setup? I've been thinking about Android development for a while now (got Eclipse, the Google SDK, ADT, etc.) but not quite got round to it yet...
Norbert Casteret (Ten Years Under the Earth) and Pierre Chevalier (Subterranean Climbers) were my inspiration to start caving. (And I'm still doing it.) Secretary, Darfar Potholing Club, the Peak District.

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Re: Poor Man's Digital Survey Device
« Reply #2 on: October 14, 2012, 09:15:35 pm »
Mine is a Galaxy Y, 2.3.6 although I believe the code compiles for 2.2. I don't know about 2.1 but I get the impression there are some fairly significant differences.

I found there to be a bit of a learning curve with Android development and there is an awful lot of rubbish out there on the development forums, but when you get into it it is good for quick results.

As I said, the code really isn't ready for release but if you are interested I don't mind sending you a copy to see how you get on with it.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline mmilner

  • Experienced digging / conservation juggling
  • forum hero
  • *****
  • Posts: 1169
  • Outside Handshake Cave, Manifold Valley.
    • Darfar P.C. web site
Re: Poor Man's Digital Survey Device
« Reply #3 on: October 14, 2012, 10:53:10 pm »
OK Cool. You've got 2.3.x Gingerbread then. It's OK, I'll wait awhile. I'm due an upgrade in January so will hopefully be on 2.3.x then or even 4.0.x Ice Cream Sandwich or 4.1.x Jelly Bean.

I guess the OCR will work ok with a Disto A3, so this setup would save me a lot of dosh. If you need any help testing, etc. when I've upgraded u r welcome...

Actually, I might go into the t-mobile shop this week and see if I can get my Defy upgraded. I'm very happy with it otherwise and see no reason to upgrade other than to get a later version of Android...

Regards, Mel.
Norbert Casteret (Ten Years Under the Earth) and Pierre Chevalier (Subterranean Climbers) were my inspiration to start caving. (And I'm still doing it.) Secretary, Darfar Potholing Club, the Peak District.

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Re: Poor Man's Digital Survey Device
« Reply #4 on: October 15, 2012, 07:34:51 am »
Yes the OCR should work with most LCDs (as long as the digits are reasonably large). It would be good to get it tested on a different phone/Android/Laser because I'm sure they all have theor quirks.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline wookey

  • player
  • **
  • Posts: 105
Re: Poor Man's Digital Survey Device
« Reply #5 on: October 15, 2012, 01:07:25 pm »
Nifty! As you say, somewhat cheap and cheerful over an integrated device, but being able to make it from widely-available hardware is clearly very useful. You say your code 'isn't ready' but that really shouldn't matter. PLease put it up somewhere so other people can try it out with other devices, help you improve it and so on. Code is never 'finished' and rarely 'ready', and the sooner you put it up the sooner you might get some help and feedback. Don't worry if it looks like crap at the moment - it's still one of, if not _the_ best in the world for this application, right now.

Could you bring it to one of the CSG training meets (Swales (SWCC), 24/25th November and Yorks (Bull Pot Farm) Jan19/ 20th), or, perhaps better, the next technology symposium next year sometime so we can have a play?
« Last Edit: October 15, 2012, 01:19:29 pm by wookey »

Offline Cave_Troll

  • forum hero
  • *****
  • Posts: 1599
  • SUSS
    • http://www.flickr.com/photos/cave_troll/
Re: Poor Man's Digital Survey Device
« Reply #6 on: October 15, 2012, 01:20:11 pm »
not all android phones have a compass though

Offline mmilner

  • Experienced digging / conservation juggling
  • forum hero
  • *****
  • Posts: 1169
  • Outside Handshake Cave, Manifold Valley.
    • Darfar P.C. web site
Re: Poor Man's Digital Survey Device
« Reply #7 on: October 15, 2012, 01:22:44 pm »
not all android phones have a compass though

Do you know of a list of which ones do CT? I'm due an upgrade in Jan anyway, so if my Defy doesn't, I'll try and get one which does then. Ta.
Norbert Casteret (Ten Years Under the Earth) and Pierre Chevalier (Subterranean Climbers) were my inspiration to start caving. (And I'm still doing it.) Secretary, Darfar Potholing Club, the Peak District.

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Re: Poor Man's Digital Survey Device
« Reply #8 on: October 15, 2012, 01:28:21 pm »
It's not that the code is a mess it's more that as it stands it needs some fairly careful use to make it work accurately, it is also in 3 bits and would need quite a lot of documentation and support. Experience shows that if I release early beta code, especially on this forum people don't understand the spftware development process and get bored with testing it or just write it off as rubbish. I'd rather write code than write docs and do support so I would like to get the process a bit more nailed down* before it has too wide a distribution.


*Full disclosure: it turns out that the biggest single effect on the magnetometers comes from the screen back light. Keeping the screen at a constant brightness allows the calibration to compensate for this but doing something such as popping up an input box (to input station data for example) messes this up, so I want to refine the process so it goes something like Station Data – Calibrate – Read Bearing – Read Distance. It's not far off, possibly a week or two.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline mmilner

  • Experienced digging / conservation juggling
  • forum hero
  • *****
  • Posts: 1169
  • Outside Handshake Cave, Manifold Valley.
    • Darfar P.C. web site
Re: Poor Man's Digital Survey Device
« Reply #9 on: October 15, 2012, 02:10:04 pm »
I'd rather write code than write docs and do support so I would like to get the process a bit more nailed down* before it has too wide a distribution.

I'm quite happy to help with the docs when you feel the code is ready, it's what I do anyway!  :thumbsup:

Regards, Mel.
Norbert Casteret (Ten Years Under the Earth) and Pierre Chevalier (Subterranean Climbers) were my inspiration to start caving. (And I'm still doing it.) Secretary, Darfar Potholing Club, the Peak District.

Offline Cave_Troll

  • forum hero
  • *****
  • Posts: 1599
  • SUSS
    • http://www.flickr.com/photos/cave_troll/
Re: Poor Man's Digital Survey Device
« Reply #10 on: October 15, 2012, 02:23:29 pm »
not all android phones have a compass though

Do you know of a list of which ones do CT? I'm due an upgrade in Jan anyway, so if my Defy doesn't, I'll try and get one which does then. Ta.
I don't. just that mine (HTC Desire C) seems not to.
my shopping list was mainly,  android v4 +, size (i don't want a 4.5"), and what was available to me on contract.
I didn't think to ask about compass

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Re: Poor Man's Digital Survey Device
« Reply #11 on: October 15, 2012, 06:27:18 pm »
I'd rather write code than write docs and do support so I would like to get the process a bit more nailed down* before it has too wide a distribution.

I'm quite happy to help with the docs when you feel the code is ready, it's what I do anyway!  :thumbsup:

Regards, Mel.

Thanks Mel, I'll be in touch.

As for which Android phones have magnetic sensors the ultimate way to find out is to get up the keypad, dial  *#0*# (yes really!) and click sensors - you should see Accelerometers, Proximity and Magnetic.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline mrodoc

  • forum hero
  • *****
  • Posts: 2653
    • Peter Glanvill's Webpage
Re: Poor Man's Digital Survey Device
« Reply #12 on: October 15, 2012, 06:32:22 pm »
I gather you can also use the phones to find caves!

Offline mmilner

  • Experienced digging / conservation juggling
  • forum hero
  • *****
  • Posts: 1169
  • Outside Handshake Cave, Manifold Valley.
    • Darfar P.C. web site
Re: Poor Man's Digital Survey Device
« Reply #13 on: October 15, 2012, 06:51:23 pm »
As for which Android phones have magnetic sensors the ultimate way to find out is to get up the keypad, dial  *#0*# (yes really!) and click sensors - you should see Accelerometers, Proximity and Magnetic.

Hmm, my Defy comes up with a network error when I try that. (Prob cos it's Android 2.1.) BUT I went to Location & Security settings and besides the 'Use wireless networks' & 'Use GPS Satellites' entries there's a 'Calibrate Compass' option! I did what it said and it seems to be pointing in the right direction for North, so it seems my Defy (which is dust, scratch and water resistant) has a compass! 8) With your software I may be able to get all this working!  :thumbsup:
Norbert Casteret (Ten Years Under the Earth) and Pierre Chevalier (Subterranean Climbers) were my inspiration to start caving. (And I'm still doing it.) Secretary, Darfar Potholing Club, the Peak District.

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Re: Poor Man's Digital Survey Device
« Reply #14 on: October 17, 2012, 12:43:42 pm »
Getting the various Apps integrated didn't take as long as expected, so the code and some notes are available at http://www.interestingto.me.uk/cave-digital-survey-device

I haven't put up a binary yet but I will in the next few days.

This is an early beta so expect some issues and we might as well use this thread to report back bugs, ask questions etc.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline Cave_Troll

  • forum hero
  • *****
  • Posts: 1599
  • SUSS
    • http://www.flickr.com/photos/cave_troll/
Re: Poor Man's Digital Survey Device
« Reply #15 on: October 17, 2012, 02:17:24 pm »
As for which Android phones have magnetic sensors the ultimate way to find out is to get up the keypad, dial  *#0*# (yes really!) and click sensors - you should see Accelerometers, Proximity and Magnetic.

I get "Connection problem or invalid MMI Code" when i try that

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Re: Poor Man's Digital Survey Device
« Reply #16 on: October 17, 2012, 03:03:25 pm »
May be that only works on Samsungs...
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1461
  • KCC
    • KCC - Join an active club
Re: Poor Man's Digital Survey Device
« Reply #17 on: October 18, 2012, 08:14:14 pm »
I have fixed a couple of bugs (one in section mode and one relating to axis conversion when the phone is on it's side/upside down)

New code and a Binary is up in the same place - http://www.interestingto.me.uk/cave-digital-survey-device
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline kdxn

  • menacing presence
  • **
  • Posts: 238
  • BPC, CPC
Re: Poor Man's Digital Survey Device
« Reply #18 on: November 21, 2012, 10:17:29 pm »
An interesting development but the magnetic compass chips in mobile phones are not good enough for a BCRA cave survey Grade 3 let alone Grade 5.

The DistoX has three orthogonal high resolution sensors for the magnetic field which is why it can be used for BCRA Grade 5 cave surveys.

Offline mmilner

  • Experienced digging / conservation juggling
  • forum hero
  • *****
  • Posts: 1169
  • Outside Handshake Cave, Manifold Valley.
    • Darfar P.C. web site
Re: Poor Man's Digital Survey Device
« Reply #19 on: November 21, 2012, 11:29:40 pm »
An interesting development but the magnetic compass chips in mobile phones are not good enough for a BCRA cave survey Grade 3 let alone Grade 5.

The DistoX has three orthogonal high resolution sensors for the magnetic field which is why it can be used for BCRA Grade 5 cave surveys.

But a Grade 3-ish survey is better than none, don't you think. I have a number of caves to survey and a Grade 3-ish survey will do fine for me. No-one else will do it so it'll be good just good to get even a rough survey done on them...

Regards, Mel.
Norbert Casteret (Ten Years Under the Earth) and Pierre Chevalier (Subterranean Climbers) were my inspiration to start caving. (And I'm still doing it.) Secretary, Darfar Potholing Club, the Peak District.

Offline graham

  • Retired
  • forum hero
  • *****
  • Posts: 10943
  • UBSS, Speleo-Club de Perigueux, GSG, SUI
    • UBSS
Re: Poor Man's Digital Survey Device
« Reply #20 on: November 22, 2012, 07:18:10 am »
An interesting development but the magnetic compass chips in mobile phones are not good enough for a BCRA cave survey Grade 3 let alone Grade 5.

The DistoX has three orthogonal high resolution sensors for the magnetic field which is why it can be used for BCRA Grade 5 cave surveys.

But a Grade 3-ish survey is better than none, don't you think. I have a number of caves to survey and a Grade 3-ish survey will do fine for me. No-one else will do it so it'll be good just good to get even a rough survey done on them...

Regards, Mel.

Obviously I have no experience with this particular device, but I do have experience with both a DistoX and with traditional tape & compass set ups & I rather suspect that you could do a grade 5 survey with the latter just as quickly as you could a grade 3 with this device. The main reason for using the DistoX/PDA/Therion method is not so much that it is faster - I doubt it is, the rate limiting step on most survey trips is the time taken to do the sketching - but that the data are so much easier to process post-trip and the results generated are so good.
Caving is for Life not just for Christmas

Offline andrew

  • addict
  • **
  • Posts: 122
Re: Poor Man's Digital Survey Device
« Reply #21 on: November 22, 2012, 04:35:48 pm »
Yes grade 3 is better than none, but I doubt this will be grade 3, and why waste time doing a grade 3 when it is as quick, probably quicker to do grade 5 with kit that hardly costs more. (Some new kit will come, I am sure.... but in the mean time there are about 50 DistoX in the uk, that seems to be far more than the surveys that are been produced)

Anyway it is not the centreline that is that important (but you might as well get it right) diagrams make the survey, and the spays available with a separate instrument to drawing pad, means that that things can be drawn in the right place, returning cave surveying to science from an art, although art does help

Andrew

Offline notdavidgilmour

  • regular
  • *
  • Posts: 63
Re: Poor Man's Digital Survey Device
« Reply #22 on: March 17, 2013, 07:21:17 pm »
Really good info on this thread.  Cheers guys.  I've recently carried out a survey of a smallish (63 mtrs long) cave in North Wales using a tape measure (remember them) and a compass.  It was just to settle an argument more than anything, but I'm planning on using a more hi-tech method over the coming weeks.  I am interested to see how accurate my original map is.
I do it because i can, I can because I want to, I want to because you said I couldn't.