maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Accelerometers (https://talk.maemo.org/showthread.php?t=29091)

VDVsx 2009-05-21 11:13

Accelerometers
 
Hello,

yesterday appeared a page on the maemo wiki about the accelerometers features in fremantle. In this page is suggested a example application, and a deb file (compiled to arm) is provided.

How should we use it ? :p or it's just for internal use/future code example ?

Since I'm very interested in the accelerometer features of fremantle, I have a couple of harmless questions (if this information can be disclosed now).

Is possible to set/get the sample rate and threshold via sysfs ?

The accelerometers d-bus code is OSS or will be ?

Thanks.

lcuk 2009-05-21 11:24

Re: Accelerometers
 
interesting

i wonder if we could hack something together using the wiimote drivers to give similar results.

tape wiimote to bottom of 810 and see if it works, or plugin one of the mini usb ones ive seen knocking about.
i doubt we could replicate the dbus part, but the sysfs portion looks feasible for a fake driver to supply.

yerga 2009-05-21 11:43

Re: Accelerometers
 
I have compiled the app for X86 to test it in the SDK, but it fails with a nice core dump:
Code:

ERROR:sand.c:285:main: assertion failed: (dbus_proxy)
/usr/bin/run-standalone.sh: line 11: 23643 Aborted                (core dumped) "$@"


lardman 2009-05-21 12:39

Re: Accelerometers
 
Might be best to look at the kernel code and see what the driver does (assuming we have the relevant bit), apparently the scaling, etc., to produce a value in milli-gs is done in there.

VDVsx 2009-05-21 13:15

Re: Accelerometers
 
Quote:

Originally Posted by lardman (Post 288996)
Might be best to look at the kernel code and see what the driver does (assuming we have the relevant bit), apparently the scaling, etc., to produce a value in milli-gs is done in there.

Yeah, the driver is there: /kernel-2.6.28/drivers/hwmon/lis3lv02d.c
But depends how the system use it :p

Lord Raiden 2009-05-21 13:38

Re: Accelerometers
 
Ya know, if the next NIT has an accelerometer in it, I'm so gonna be stoked. That in itself has so many uses that I can't even name them all. :D

qgil 2009-05-21 13:49

Re: Accelerometers
 
Hi, yes I published that page yesterday but then I went for other things and forgot to link it somewhere.

Basically is the best I could get to answer a question that was coming from the NumptyPhysics developer and others. Hopefully a better interface and documentation will come, but in the meantime you have the basics there.

About the little app, please contact marnanel directly. I'm sure he is willing to share his own findings but I don't expect him to be aware of this thread here. I have seen the app working but that's all I know about it.

VDVsx 2009-05-21 13:56

Re: Accelerometers
 
Quote:

Originally Posted by qgil (Post 289017)
I have seen the app working but that's all I know about it.

In a Fremantle prototype device right ?

Thanks.

lardman 2009-05-21 13:56

Re: Accelerometers
 
Quote:

But depends how the system use it
I was assuming the sysfs entry code would also be present. I can't look myself atm as I'm running on WinXP (can't apply the diff easily), but will have a look through later on.

lardman 2009-05-21 14:01

Re: Accelerometers
 
Ah no worries, just looked in the patch. Take a look at the following file: /drivers/i2c/chips/lis302dl.c

VDVsx 2009-05-21 14:03

Re: Accelerometers
 
Quote:

Originally Posted by lardman (Post 289019)
I was assuming the sysfs entry code would also be present. I can't look myself atm as I'm running on WinXP (can't apply the diff easily), but will have a look through later on.

Yeah, is there. Didn't looked for it :D. thanks !!!

qgil 2009-05-21 14:04

Re: Accelerometers
 
Quote:

Originally Posted by VDVsx (Post 289018)
In a Fremantle prototype device right ?

In a development unit used to test Fremantle. Shaking my laptop with the Maemo 5 SDK installed won't work. ;)

lardman 2009-05-21 14:06

Re: Accelerometers
 
So the answer is yes, you can alter the rate from the looks of it. See lis302dl_set_rate() and likewise the scaling with lis302dl_set_scale()

VDVsx 2009-05-21 14:07

Re: Accelerometers
 
Quote:

Originally Posted by lardman (Post 289022)
Ah no worries, just looked in the patch. Take a look at the following file: /drivers/i2c/chips/lis302dl.c

Humm, don't have that file, should have a different kernel, where did you grab yours ?

VDVsx 2009-05-21 14:09

Re: Accelerometers
 
Quote:

Originally Posted by qgil (Post 289025)
In a development unit used to test Fremantle. Shaking my laptop with the Maemo 5 SDK installed won't work. ;)

Ehehe, so we can't test it :)

lardman 2009-05-21 14:09

Re: Accelerometers
 
I just grabbed the patch from the repo: http://repository.maemo.org/pool/fre...02+0m5.diff.gz

qgil 2009-05-21 14:12

Re: Accelerometers
 
Quote:

Originally Posted by VDVsx (Post 289029)
Ehehe, so we can't test it :)

I can give feedback if anybody tries and uploads the packages to extras-devel.

VDVsx 2009-05-21 14:19

Re: Accelerometers
 
Quote:

Originally Posted by lardman (Post 289026)
So the answer is yes, you can alter the rate from the looks of it. See lis302dl_set_rate() and likewise the scaling with lis302dl_set_scale()

Ah, almost everything is configurable, nice work.
I'm happy now :D

Master of Gizmo 2009-06-05 11:20

Re: Accelerometers
 
Quote:

Originally Posted by qgil (Post 289025)
In a development unit used to test Fremantle. Shaking my laptop with the Maemo 5 SDK installed won't work. ;)

That's actually not as a strange idea as it seems. The tiltstick e.g. just works inside the sdk and so would any other usb peripheral connected via usb and accessed via libusb.

lcuk 2009-06-05 11:58

Re: Accelerometers
 
Quote:

Originally Posted by Master of Gizmo (Post 293969)
That's actually not as a strange idea as it seems. The tiltstick e.g. just works inside the sdk and so would any other usb peripheral connected via usb and accessed via libusb.

does the tiltstick use the same format and sysfs entries as the built in commands?

if not, it would be nice if there was perhaps a small redirection app which could allow people to test using as you say a tiltstick, or using a bluetooth connected wiimote.

Perhaps the library version does this already and will accept input from any accel unit, maybe someone else will know.

Master of Gizmo 2009-06-15 19:33

Re: Accelerometers
 
Quote:

Originally Posted by lcuk (Post 293975)
does the tiltstick use the same format and sysfs entries as the built in commands?

No, it doesn't. But the page now says that there'll perhaps be a library.

Master of Gizmo 2009-06-16 12:19

Re: Accelerometers
 
The enigma game is now in fremantle extras-devel and includes accelerometer support.

qgil 2009-06-17 05:53

Re: Accelerometers
 
Quote:

Originally Posted by Master of Gizmo (Post 297127)
The enigma game is now in fremantle extras-devel and includes accelerometer support.

And works in a real device with great precision! I benchmarked yesterday with a device and 2 users without NDA: my 2 and 4 year old kids. It was the first time they played anything like this and they did move the device naturally based on their knowledge on real gravity. They even got through the levels 1 and 2!

My big son asked me whether that was a real ball.

X-Fade 2009-06-17 08:23

Re: Accelerometers
 
Quote:

Originally Posted by qgil (Post 297394)
My big son asked me whether that was a real ball.

It amazing how kids perceive the world at that age, makes you wonder what we can learn from them :)

mikkov 2009-06-21 22:26

Re: Accelerometers
 
Quote:

Originally Posted by Master of Gizmo (Post 297127)
The enigma game is now in fremantle extras-devel and includes accelerometer support.

How enigma is using the accelerometer? Is it using it through libtiltstick?

Accelerometer really needs some documentation. The wiki page doesn't count as documentation atm :)

Jaffa 2009-06-22 13:14

Re: Accelerometers
 
Indeed, I've got a great idea for a simple app using the accelerometers; but am unsure whether it's best to poll the sysfs interface directly, or some other mechanism.

qgil 2009-06-22 19:21

Re: Accelerometers
 
Please file a bug for the lack of official documentation on how to use the accelerometers. I put together the wiki page as a temporary solution.

VDVsx 2009-06-22 19:32

Re: Accelerometers
 
Quote:

Originally Posted by qgil (Post 298722)
Please file a bug for the lack of official documentation on how to use the accelerometers. I put together the wiki page as a temporary solution.

https://bugs.maemo.org/show_bug.cgi?id=4724

Feel free to add more specific requests on the documentation that should be provided.

Thesandlord 2009-06-22 19:39

Re: Accelerometers
 
Quote:

Originally Posted by qgil (Post 297394)
It was the first time they played anything like this and they did move the device naturally based on their knowledge on real gravity.

Never played with an iPhone or Wii have they? My 3 year old cousin loves to play that ball game on his dad's iPhone...

Master of Gizmo 2009-06-30 06:24

Re: Accelerometers
 
Quote:

Originally Posted by mikkov (Post 298496)
How enigma is using the accelerometer? Is it using it through libtiltstick?

Nope, i just polls the sysfs. I completely removed tiltstick support as only 2 or 3 devices ever had the necessary hardware.

But i agree that some generic tilt sensor solution is required which may then again include support for the tiltstick.

attila77 2009-06-30 12:14

Re: Accelerometers
 
Apropos accm, I undestand this is a hardcore question but... will we have access to the inertial wakeup feature of the chip ? (this could be used to detect being picked up/flipping pages/etc without polling like crazy).

speculatrix 2009-06-30 21:16

Re: Accelerometers
 
Quote:

Originally Posted by Master of Gizmo (Post 293969)
That's actually not as a strange idea as it seems. The tiltstick e.g. just works inside the sdk and so would any other usb peripheral connected via usb and accessed via libusb.

many laptop hard drives have accelerometers built in to sense falling/dropping.. maybe you could use that?

qgil 2009-08-14 21:14

Re: Accelerometers
 
There is a new version of NumptyPhysics in Fremantle extras-devel. The game now starts with a new but provisional screen: "Accelerometers test".

Sadly the test fails. The objects in that screen and anthing else you draw follows the same gravity falling down the display... no matter in what position you have the device. Maybe someone can give a hand to Tim Edmonds?

mikkov 2009-08-15 20:06

Re: Accelerometers
 
I uploaded madbomber 0.2.5-3maemo5 to extras-devel, it has accelerometer based control now. Any feedback (does it work, direction ok, general feel) would be welcome so I could decide what do with it.

qgil 2009-08-23 07:51

Re: Accelerometers
 
MadBomer doesn't seem to respond to accelerometers. The keys do work.

mikkov 2009-08-23 11:53

Re: Accelerometers
 
Quote:

Originally Posted by qgil (Post 314510)
MadBomer doesn't seem to respond to accelerometers. The keys do work.

Doh! I left my acceleremoter test setup in the code (which is typing some numbers manually to a file and see what happens). You could try this
Code:

ln -s /sys/class/i2c-adapter/i2c-3/3-001d/coord /tmp/coord

Flandry 2009-11-12 16:29

Re: Accelerometers
 
Bringing this back from the dead...

I looked at sandcastle and there is the DBusGProxy callback. Ok, what amound of motion does it take to trigger such a callback?

Is there some documentation on the nature of the dbus accelerometer functionality?

wahlau 2009-11-13 11:13

Re: Accelerometers
 
hi,

i am also interested to know how one can access the accelerometer on the N900, especially if it is possible to do so via Python.

how about other sensors? or radio signal/base station/battery etc.?

thank you..

wahlau.

attila77 2009-11-13 12:24

Re: Accelerometers
 
See http://wiki.maemo.org/Accelerometers, it even has a python example.

wahlau 2009-11-13 12:43

Re: Accelerometers
 
thanks. that answers my answer pretty well!

i wonder if there will be Sensor API-like on the S60 Platform interfaces on N900. that would make many things simpler... :)


All times are GMT. The time now is 15:49.

vBulletin® Version 3.8.8