![]() |
[Maemo 5] Accelemymote: making your accelerometer more joy-ful
Accelemymote
making your accelerometer more joy-ful Accelemymote takes input from the accelerometers in the N900 and converts it into joystick events. This makes any game that supports a generic joystick interface tilt compatible. Games and emulators that support tilt control using Accelemymote:
Status: Default profile (analog 2 axis; proximity sensor as button A) and debug implemented. As installed, works reasonably well with quite a few MAME ROMs and is okay in uqm. PrBoom works well, but requires some changes to the default config due to its poor joystick support (a separate issue that will hopefully be dealt with at some point). With some key mapping and config tweaks (this is where you come in...), a lot of other games and MAME ROMs should work well. Please report. Package pages: GUI -- Found in the "System" category. Will automatically install the other package: CLI daemon -- for those who want to invoke via scripts or xterm. You'll have to use apt to grab this by itself. Instructions:
How to Edit Settings (for Dummies :))
Zeroing the axis: To change the baseline tilt (the neutral position) from the default of 30 degrees, click the button in the GUI and hold it at the desired neutral tilt until a banner informs you it has been calibrated (about 5 s). Triggering that automatic calibration can also be done by changing the value of the offset_pitch in the config file to 900 and then saving. Alternatively, you can change the value to whatever angle you hold the N900 at by default (0 would be flat on a table, 90 vertical). Config Options (main.cfg) Code:
; Accelemymote configuration file |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Let me be the first to say - HUZZAH!
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Initial proof-of-concept package uploaded. It seems to set up the driver correctly and was tested to work with PrBoom (you need to enable the joystick in the PrBoom menu.)
The way it works right now is through a toggle, implemented as a startup script and a file called ~/accelemymote/live-trigger, that gets the daemon running. It will continue to run, consuming about 0.8% CPU cycles, until you restart or delete the trigger file. You can delete the trigger file by clicking the app icon again. If in doubt whether it is running, you can run top and see if the process shows up. It's probably more sensible to run it from the command line for now: /opt/maemo/usr/bin/accelemymote.sh Let me know if it works for you. There is a lot left to do before it's ready for mainstream, but i want to be sure the module and driver installation is working. Edit: i tried it with uqm and it's way too spammy with events to work well there right now. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Great work all we need now is a flight simulator...or a port of Descent!
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
i just tried it with prboom and it's working, so good job for this :)
But the problem is that is nearly impossible to play with it because of the settings of the accelerometer :( Would it be possible to config accelemymote without going to ~/.accelemymote/main.cfg ? I'm really a end user and if config woul be possible from the application it would be much more friendly :) anyway, it's just the 0.1 so we can expectgood things for the 0.2 ;) |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
actually it installs mostlly but i get an error during install, icon is in menu........I run app, it closes and I dont see it in top
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Thanks for testing.
Quote:
tangs: The config file is a first step. Version 0.0.0 didn't have any options at all. ;) What is it about the accelerometer setup that you find hard to control? |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Someone tried to port Descent 1 to OpenGL ES, couldn't get it running though.
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
I looked at Descent 1 and 2 but they suffer from the same problem as other commercial games with open engine and closed data: you can't distribute the content via the repos so it can never be end-user friendly. That was enough to discourage me from putting more time into it. It seems like the shareware version might be ok to distribute, though, so maybe there was something else to it. I really should keep notes. :p
Descent 1 in its original incarnation could certainly have run on the N900 without GLES acceleration--in fact, there was a descent port for an earlier version of maemo iirc. So far i have one report of success and one of failure at getting this package to work. Anyone else? |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
I'm a bit scared because a friend of mine installed some joydev kernel and after rebooting phone it was totally bricked so he needed to flash it... so any more reports of some brave people in here??
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
This doesn't install a custom kernel, just a kernel module. While the chances of something bad happening aren't zero, i think you'd have to try really hard to brick an N900 by installing a tested, packaged kernel module.
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
ok ive tried now installation went well and icon got shown. Followed your instructions app closed after pressing but no accelero use in prboom for me, still default key config.
hope you'll get it working, sounds amazing |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
Did you enable joystick in the prboom menu? |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Ha no thanks that was my fault gonna try again and report asap
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
ehm....cant find any enable joystick option in prboom menu..? is it in general?
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Options->General->Next->Enable Joystick
I'm especially interested in feedback from people who have played a lot of accelerometer-controlled games (say, on the iPhone...) and therefore have a good idea what is possible and insight into what could be improved for the control itself. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
AWESOME! it works very flawless! one option to add would be to shake the phone for making a jump, like in openarena.
I also couldnt find the shoot button, does it change when applying joystick?? thanks for your work, this is bomb! EDIT: ok shoot button found, its getting pretty late :) gorgeous |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
for me it downloads but says "unable to install" part way thru install.........
it seems install cant overwrite joydev.ko as ive installed another kernel thats updated that file (sixaxis support) |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Yes, i was going to ask if you had installed one of the hacks going around. The joydev kernel module is available as a package now, so hopefully there won't be too many taking the hard route to installing it.
Well good, it seems this install works for stock N900s. Quote:
Quote:
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
so theres a compatibility issue then with sixaxis joydev kernel?? thx
im unable to install joydev kernel thru app manager also, i get the same error :( |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
I haven't looked at the sixaxis setup in detail but from what you describe, i suspect that they are providing the same file in their package, so the package manager sees that another package would collide and refuses to let you install it. All it requires is for the sixaxis maintainer to either depend on the joydev package instead of installing the module, or to mark the package as "Provides" joydev. If his package advertises itself as providing the virtual package "joydev", the accelemymote package that depends on "joydev" will happily install and use that module. The first option is better because there are obviously cases where someone would want to uninstall the sixaxis package and not the accelemymote package, and that wouldn't be possible with the latter option.
Maybe you can point him to this post so he's aware of the problem? Edit: of course individual users can "force" the install, which should work fine, but that's not a solution. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
--ignore-missing might do it. I've never had to do it for a package i didn't have as a .deb file, so i use dpkg. See dpkg --force-help for more information. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
downloaded *.deb, did dpkg --force-all -i accelemymote.deb....... installed i think... thanks HEAPS
EDIT: okay found config file.. but I get this error when running app from xterm. trigger file /home/user/.accelemymote/live-trigger specified; file not found... shutting down. EDIT: dont know what i did but i ran thru menu shortcut, checked in top and it was there and works!! but in doom, if i want to config 'actions' is that possible?? i.e. make left/right strafe instead of turn??? tHANKS :D actually im guessing thats not posible if this acts as a joystick, not keyboard IMHO i think the name Accelemote would be much better for this app..! :D |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
Quote:
Seriously, though, you were probably running the binary executable instead of the script. /opt/maemo/usr/bin/accelemymote.sh is the toggle script. Run it with an "&" at the end to start it up, and then run it again when you are done. Quote:
Quote:
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
i did run
/opt/maemo/usr/bin/accelemymote.sh in xterm! ?? it works fine, just doesnt install properly for me.. keeps saying it has an update.. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
Sorry for my bad english, just trying to hell p ;) |
Quote:
Quote:
As for the speed of side movement... are you saying it should actually go slower than when you push "left" and "right" on the keyboard? I guess what you're asking is analog control. Right now it only works as a "hat" (up/down/left/right) rather than an analog stick, so that might be fixed when i finish the analog profile... if prboom supports that. Quote:
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Ok, i'll try to change it to 45.
where do i find the .accelemymote/main.cfg please ? |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
sed -i 's/\(offset_pitch *= *\)[0-9]*\(.*\)/\145\2/' ~/.accelemymote/main.cfg Change the part that says 45 to something like 30 if it ends up being too much. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
so i sudo gainrooted, copyed your line but nothing happened... i tried the game and this is still the same :(
I asked where i can find .accelemymote/main.cfg because like this i could maybe also change the speed of how it's turn right and left. trying to do it, trying to do it :) |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
chown user ~/.accelemymote/main.cfg and then type exit and don't sudo again unless you know why you are doing it. :D The tilde (~) represents your home directory to the shell, so ~/.accelemymote/main.cfg is the full location of the file. It's in your home directory under a hidden subdirectory (begins with '.') called .accelemymote. You are right though that it doesn't do anything (besides change the value in the config file). Apparently it's not using that option properly yet. Next version... ;) You can try changing the poll_rate parameter in the file to something lower, but in Doom you are either moving, running, or not moving. I'm not sure there is a "slower". If there is, it will be via analog joystick support which is not implemented yet. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
"Sudo gainroot and type:
chown user ~/.accelemymote/main.cfg and then type exit " I did it, nothing happened after this, i suppose this is the way it should be ? As you see, i'm ready to risk my life to try it ;) |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Nice, that's what I was searching for, already wanted to write it myself :D
But the offset_pitch doesn't seem to work here... Changed it to 35, 60, even 350, and the zero position is always nearly horizontal (about 5-10 degrees maybe). Is this a bug or am I just too stupid? :P Descent is running pretty good with it though (Ignoring the fact that I have to play it in strange positions because the offset_pitch isn't recognized :D). But it got some framerate-problems with the software-renderer, especially in the energy-charging areas. There seems to be a OpenGL ES port in work, but it's not complete and the source isn't released to the public up to now so I couldn't try it out yet :/ |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
|
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Quote:
Beside this bug it's really a great application, thanks a lot for it :) |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
Version 0.0.2 just went through the autobuilder and should be available momentarily.
Changelog: accelemymote (0.0.2) unstable; urgency=low * Fixed ini config file parser (offset_pitch now works). * Abstracted polling for a frame into a function (enables samples option). -- Flandry <davidfalkayn@gmail.cmo> Mon, 1 Mar 2010 16:52:17 -0500 Valid options (~/.accelemymote/main.cfg): [Sampling] samples = 2 ; Samples to average for each frame (1-5) [2] frame_rate = 24 ; Number of event-generating timesteps per second (1-30)[24] [Control] flip_pitch = -1 ; -1=> tilt forward is up; 1=> tilt forward is down [-1] offset_pitch = 30 ; degrees tilt backwards to the neutral position [30] max_roll = 9 ; degrees plus/minus from neutral to max out the axis [9] max_pitch = 7 ; degrees plus/minus from neutral to max out the axis [7] It will clobber your existing main.cfg file. Just FYI. Edit: Works pretty well with PrBoom with default settings. Still too spammy for uqm. Gauntlet is "interesting" but not really enjoyable; Rampage middling; someone with mad Centipede skills might find that entertaining (really, really fast movement...:D ); Joust is not too bad; ghosts 'n goblins has a weird ladder climbing issue. Some tweaks to config might make a big difference for some of these. |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
1 Attachment(s)
just so you know this app is compatible with sixaxis daemon!
i have made an app icon, if you like it.....feel free to use it. EDIT: updated icon http://f2thak.com/N900/Screenshot-20100302-213239.png |
Re: [Maemo 5] Accelemymote: making your accelerometer more joy-ful
PrBoom turns out to be a really bad test case. While it actually needs redundant joystick events to be spammed to work properly, most apps don't really appreciate that.
Version 0.0.3 brings better defaults for everything (except prboom). To use it with prboom, edit the main.cfg and reduce the maximum pitch and roll to around 8 and the thresholds to 0. Alternatively, edit and copy the file to prboom.cfg and pass that as the only parameter to the accelemymote binary. I.e. /opt/maemo/usr/bin/accelemymote ~/.accelemymote/prboom.cfg accelemymote (0.0.3) unstable; urgency=low * Enabled threshold angle change between events (fixes many control issues). * Better universal default settings (PrBoom has special needs). |
All times are GMT. The time now is 18:17. |
vBulletin® Version 3.8.8