maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   [SCRIPT] Using the N900 as Sonar (https://talk.maemo.org/showthread.php?t=93435)

Encypruon 2014-07-11 13:03

[SCRIPT] Using the N900 as Sonar
 
Hey all,

I hope this is the right place to post this :) I've somehow managed to make my N900 detect movements (and their distances) by checking how the echo of a sound is altered with a Python script that's rather dirty than quick. The way It's recording and playing audio is more a hack than a proper solution, but for some reason it's working. It requires python-numpy and alsa-utils to be installed.

EDIT: It seems like Python is not always taking care of the two subprocesses this script is spawning. The right solution might be wrapping the whole thing in a try-catch-block and cleaning up yourself. I prefer the lazy solution: Starting it with "python echo.py; killall arecord; killall aplay;" If the subprocess module doesn't do it's job properly, killall can take care of it :D

EDIT2: As Vento suggested, I've added "Script" to the title.

Please tell me if there's a way to embed the video that I've missed. Just in case :)

Demo Video
The script on pastebin

nokiabot 2014-07-11 13:10

Re: Using the N900 as Sonar
 
omg !

{10 characters}

endsormeans 2014-07-11 13:11

Re: Using the N900 as Sonar
 
Hahaha
Too frickin'-freakishly-coollio-weird man!
Welcome to the new-guy!
And you bring presents to the party!
A new toy!

Gotta come up with a cool name for it though...
sonar for n900 ...makes me think the n900 needs to be waterproofed for submersible diving. :D

Hmm...how's this for a name..."The Unsneakable App".."UnSneak-A-App"...or "Kato"

.thinkin 'bout the vid there...with you waving your hand behind it and all...tryin to sneak up on it so-to-speak :D...
reminded me of Kato from the pink panther movies always trying to surprise attack Inspector Clouseau.

Hmm...what is the distance on the sucker? How far?
Can it be tweaked to say...cancel out your movements (very tricky that I would imagine) so you wouldn't get your own feedback ?...so to speak.

On a more humourous note...
Can it detect movement say...in another room?
Could it warn me to get under my mistresses bed before her husband comes in the door? :D

Better...could it warn me of a planet- invading alien's heavy-breathing while I hide in the closet? At least I'd die then with major points for dying and going out in better than Hollywood sci-fi movie style. :D

Hmmm very-way cool ....
hmmm... the applications...

Y'know ....it just reiterates yet again...
maemo ain't dead...
the n900 isn't anymore irrelevant than it was when it 1st came out...
Not to mention the frickin' way-cool factor of our devices and of the mad innovations of this community...
stuff stupidphones and their communities just don't have...

The "Other Guys" should be taking notes...want crazy-fast and wild innovations? Open their platforms up for the public to play with them...best and cheapest corporate method of r+d is to let everyone else pool their brain-pans and do it for them. You'd think they would have figured out that cost saving method by now.

Hats off to you man....that is...by far one of the most interesting and bizarre innovations...now how to integrate it with some ideas I got....

ndhikaa 2014-07-11 14:21

Re: Using the N900 as Sonar
 
i gotta say thanks!

gianko 2014-07-11 16:22

Re: Using the N900 as Sonar
 
Amazing stuff!

nokiabot 2014-07-11 18:05

Re: Using the N900 as Sonar
 
well how a simple game or a fun app be put up with this as the input ? think of a ball to put in a hole without touching any sides of the screen or jush make it jump insanley :D a plugin for the photos app that can zoom in or a plugin for omp to forward rewind or play with the volume or any crazy idea that can be implemented:)

endsormeans 2014-07-11 18:15

Re: Using the N900 as Sonar
 
mahgawd nokiabot...yeah..man...hell....just the tip of the iceberg ....of stuff that could be implemented with this...

hmm...kinda like the xbox kinect interface...that monitors visual input and implements a response in the running prog or game.
Better I think...this is crazy sensitive...and unlike the kinect...it isn't limited to direct line of camera sight...you could run an prog/ game/ music... whatever... with the n900 sitting on your desk/ nightstand/ bookshelf...possibly across the room ....BEHIND you..... for all it matters :D

hmmm...OP'er can you give a rough guesstimate as to the distance the sonar receives before the signal becomes ...umm..deterioratingly inadequate (for measurements to be applied to possible applications) ?

Roughly.... how many feet from device before sonar signal degeneration?

Oh my...oh yes....I most definitely could see direct applications

OP.....more possible applications are thrown around...the more I'm super-duper impressed

nokiabot 2014-07-11 18:47

Re: Using the N900 as Sonar
 
humm it feels like it can detect movements two way it cannot sense direction lol :D but as the op says its quick and dirty it seems it can be taliored a bit to cerate some fun things or better a script or a app that can be used to intregate whatever one wants like we use shortcutd or camera half press to map any function:)

Vento 2014-07-11 19:49

Re: Using the N900 as Sonar
 
http://www.indianfunpic.com/wp-conte...an-a-Medal.jpg

Btw, it will be nice an little UI app to know the distance of the nearest moving object. No fancy button or strange things... just a number in center of the screen. Okay maybe some settings would be useful like sample numbers... I'm thinking about a simple menu that popup when you press the number.

Estel 2014-07-11 20:33

Re: Using the N900 as Sonar
 
Interesting, gotta check the accuracy. I wonder if it would more effectively underwater, for obvious reasons (after altering calculations, of course)? No pun, I mean waterproof bag and underwater-tailored receiver/emitter part connected to headphone socket.

Could become a cool part of RC submarine model, too ;)

/Estel


All times are GMT. The time now is 21:22.

vBulletin® Version 3.8.8