Rotate

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (updated link - accel-rotate at projects.openmoko.org)
 
(8 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
Here's a quick and simple C program that reads a packet from the
 
Here's a quick and simple C program that reads a packet from the
 
accelerometer once per second, and rotates the screen to a new
 
accelerometer once per second, and rotates the screen to a new
orientation if the orientation has changed.          
+
orientation if the orientation has changed.
  
 
I don't mean this to conflict with Paul's excellent work on [[Gestures]];
 
I don't mean this to conflict with Paul's excellent work on [[Gestures]];
Line 12: Line 12:
  
 
The code is:
 
The code is:
  http://github.com/cjb/freerunner-rotate/tree/master/rotate.c?raw=true
+
http://github.com/cjb/freerunner-rotate/tree/master/rotate.c?raw=true
  
 
There's an ARM binary here (chmod a+x rotate && ./rotate):
 
There's an ARM binary here (chmod a+x rotate && ./rotate):
  http://dev.laptop.org/~cjb/rotate
+
http://dev.laptop.org/~cjb/rotate
  
There's also a complete rewrite at http://blog.1407.org/tag/rotate
+
== rotated ==
 +
* author: Kurt Van Dijck <kurt.van.dijck_at_skynet.be>
 +
* [http://www.ecirc.net/openmoko/rotated_0.9_armv4t.ipk] ipkg for 2008.12
 +
* [http://www.ecirc.net/openmoko/rotated.tgz] for sources
  
== Patches ==
+
I found that rotating the desktop area in landscape (using xrandr) makes the XGlamo eat the CPU on my GTA-02
And you're welcome to make patches against the GIT repo here:
+
system.
  git://github.com/cjb/freerunner-rotate.git
+
  
* [http://blog.1407.org/2008/09/20/openmoko-rotate-now-using-libxrandr/ Patch for using libxrandr] instead of system+xrandr -- Rui Miguel Silva Seabra <rms_ghaaaNoSpamPlease_at_1407_org>
+
Rotating the display head (xrandr --output default ...) works without major CPU load.
  
== Maintainership ==
+
By using no libxrandr, but invoking xrandr commands, it only depends on the accelerometer.
Would anyone else be interested in being the maintainer of this package?
+
It would involve packaging it up in bitbake/OE and trying to persuade
+
the various OM distros to include it by default. (Perhaps with an
+
on/off control panel entry in distros that make that easy to do?)
+
  
Comments appreciated. Thanks!
+
== omnewrotate at code.google.com ==
  
- Chris.
+
* author: Rui Miguel Silva Seabra <rms_ghaaaNoSpamPlease_at_1407_org>
--
+
* related blog posts:
Chris Ball  <cjb_at_laptop_dot_org>
+
** http://blog.1407.org/tag/rotate
 
+
** [http://blog.1407.org/2008/09/20/openmoko-rotate-now-using-libxrandr/ Patch for using libxrandr] instead of system+xrandr
== Packages and Binaries ==
+
* source codes http://code.google.com/p/omnewrotate/ (there are [https://admin-trac.openmoko.org/trac/ticket/1563 problems with projects.openmoko.org] )
 
+
* Arm [http://files.1407.org/openmoko/rotate/ releases built]  
* Arm [http://files.1407.org/openmoko/rotate/ releases built] by Rui
+
  
 
== accel-rotate at projects.openmoko.org ==
 
== accel-rotate at projects.openmoko.org ==
  
[http://joejoe.blog.root.cz/2008/09/23/akcelerometry-v-openmoku/] how to display data from accelerometers on Desktop in gnuplot (there is a few of czech text, but there is also youtube video).
+
<onlyinclude>
 
+
{{ApplicationBox|
* [http://projects.openmoko.org/projects/accell-rotate/ project page]
+
Name=[[Rotate]]|
* Source codes are in subversion, every developer is welcome
+
Description=Rotates the screen according to the position of the Neo FreeRunner. |
* TODO:
+
Screenshot=No-screenshot.png|
** disabling of rotation while shaking (some heuristics)
+
Homepage=http://projects.openmoko.org/projects/accell-rotate/|
** disabling of rotation while is screen saver running
+
TestedOn=FSO, ASU, QtExtended|
** is there any dbus event "disable rotation" ?
+
PackageName=accel-rotate (external download)
 +
}}
 +
</onlyinclude>
 
* Om2008.x package:
 
* Om2008.x package:
 
+
<pre>opkg install http://projects.openmoko.org/frs/download.php/455/accel-rotate_0.41_armv4t.ipk</pre>
  opkg install http://projects.openmoko.org/frs/download.php/392/accel-rotate_0.2_armv4t.ipk
+
  update-rc.d accel-rotate defaults
+
 
+
 
* Qt Extended 4.4.1 package:
 
* Qt Extended 4.4.1 package:
  echo "/opt/Trolltech/Qtopia/lib/">> /etc/ld.so.conf.d/local.conf # there are some important libraries
+
<pre>opkg install http://projects.openmoko.org/frs/download.php/456/accel-rotate-qte_0.41_armv4t.ipk</pre>
  ldconfig
+
* Source codes are in subversion, developers are welcome
  opkg install http://projects.openmoko.org/frs/download.php/415/accel-rotate_0.2_qte441_armv4t.ipk
+
* TODO:
  /etc/init.d/accel-rotate start
+
** better heuristics - any ideas how to do this well? please use discussion on this wiki.
  update-rc.d accel-rotate defaults # start at boot time
+
** disabling on screensaver
 +
* [http://joejoe.blog.root.cz/2008/09/23/akcelerometry-v-openmoku/] how to display data from accelerometers on Desktop with gnuplot (there is a few of czech text, but there is also youtube video).
 +
 
 +
== Simple-rotate ==
  
<onlyinclude>
 
 
{{ApplicationBox|
 
{{ApplicationBox|
  Name=[[Rotate]]|
+
Name=[[Simple-Rotate]]|
  Description=Rotates the screen according to the position of the Neo FreeRunner.|
+
Description=Rotates the screen according to the position of the Neo FreeRunner. |
  Screenshot=No-screenshot.png|
+
Screenshot=No-screenshot.png|
  Homepage=-|
+
Homepage=http://projects.openmoko.org/projects/simple-rotate/|
  TestedOn=-|
+
TestedOn=ASU, Debian|
  PackageName=accel-rotate (external download)
+
PackageName=simple-rotate (external download)
 
}}
 
}}
</onlyinclude>
+
 
 +
Author: Miguel Angel Vilchez Lopez
 +
 
 +
* Debian package:
 +
<pre>wget http://projects.openmoko.org/frs/download.php/584/simple-rotate.deb
 +
dpkg -i simple-rotate.deb</pre>
 +
 
 +
* ASU binary:(Sorry, but still i have no ipkg package)
 +
 
 +
<pre>
 +
wget http://projects.openmoko.org/plugins/scmsvn/viewcvs.php/*checkout*/opkg/simple-rotate?rev=4&root=simple-rotate
 +
chmod +x simple-rotate
 +
./simple-rotate &
 +
</pre>
 +
 
 +
== See also ==
 +
 
 +
* [http://lists.openmoko.org/nabble.html#nabble-td1108285 October 13th version].
  
 
[[Category:System Applications]]
 
[[Category:System Applications]]
 
[[Category:Accelerometer]]
 
[[Category:Accelerometer]]

Latest revision as of 13:00, 11 January 2009


Here's a quick and simple C program that reads a packet from the accelerometer once per second, and rotates the screen to a new orientation if the orientation has changed.

I don't mean this to conflict with Paul's excellent work on Gestures; my reason for writing it is so that it can be used as an always-on daemon in the OM distributions. (Full gesture interpretation is more CPU heavy and requires reading data more often than once per second, so perhaps that will be done on-demand instead of always-on.)

The code is: http://github.com/cjb/freerunner-rotate/tree/master/rotate.c?raw=true

There's an ARM binary here (chmod a+x rotate && ./rotate): http://dev.laptop.org/~cjb/rotate

Contents

[edit] rotated

  • author: Kurt Van Dijck <kurt.van.dijck_at_skynet.be>
  • [1] ipkg for 2008.12
  • [2] for sources

I found that rotating the desktop area in landscape (using xrandr) makes the XGlamo eat the CPU on my GTA-02 system.

Rotating the display head (xrandr --output default ...) works without major CPU load.

By using no libxrandr, but invoking xrandr commands, it only depends on the accelerometer.

[edit] omnewrotate at code.google.com

[edit] accel-rotate at projects.openmoko.org

No-screenshot.png Rotate

Rotates the screen according to the position of the Neo FreeRunner.


Homepage: http://projects.openmoko.org/projects/accell-rotate/
Package: accel-rotate (external download)
Tested on: FSO, ASU, QtExtended


  • Om2008.x package:
opkg install http://projects.openmoko.org/frs/download.php/455/accel-rotate_0.41_armv4t.ipk
  • Qt Extended 4.4.1 package:
opkg install http://projects.openmoko.org/frs/download.php/456/accel-rotate-qte_0.41_armv4t.ipk
  • Source codes are in subversion, developers are welcome
  • TODO:
    • better heuristics - any ideas how to do this well? please use discussion on this wiki.
    • disabling on screensaver
  • [3] how to display data from accelerometers on Desktop with gnuplot (there is a few of czech text, but there is also youtube video).

[edit] Simple-rotate

No-screenshot.png Simple-Rotate

Rotates the screen according to the position of the Neo FreeRunner.


Homepage: http://projects.openmoko.org/projects/simple-rotate/
Package: simple-rotate (external download)
Tested on: ASU, Debian


Author: Miguel Angel Vilchez Lopez

  • Debian package:
wget http://projects.openmoko.org/frs/download.php/584/simple-rotate.deb
dpkg -i simple-rotate.deb
  • ASU binary:(Sorry, but still i have no ipkg package)
wget http://projects.openmoko.org/plugins/scmsvn/viewcvs.php/*checkout*/opkg/simple-rotate?rev=4&root=simple-rotate
chmod +x simple-rotate
./simple-rotate &

[edit] See also

Personal tools


Here's a quick and simple C program that reads a packet from the accelerometer once per second, and rotates the screen to a new orientation if the orientation has changed.

I don't mean this to conflict with Paul's excellent work on Gestures; my reason for writing it is so that it can be used as an always-on daemon in the OM distributions. (Full gesture interpretation is more CPU heavy and requires reading data more often than once per second, so perhaps that will be done on-demand instead of always-on.)

The code is:

  http://github.com/cjb/freerunner-rotate/tree/master/rotate.c?raw=true

There's an ARM binary here (chmod a+x rotate && ./rotate):

  http://dev.laptop.org/~cjb/rotate

There's also a complete rewrite at http://blog.1407.org/tag/rotate

Patches

And you're welcome to make patches against the GIT repo here:

  git://github.com/cjb/freerunner-rotate.git

Maintainership

Would anyone else be interested in being the maintainer of this package? It would involve packaging it up in bitbake/OE and trying to persuade the various OM distros to include it by default. (Perhaps with an on/off control panel entry in distros that make that easy to do?)

Comments appreciated. Thanks!

- Chris. -- Chris Ball <cjb_at_laptop_dot_org>

Packages and Binaries

accel-rotate at projects.openmoko.org

[1] how to display data from accelerometers on Desktop in gnuplot (there is a few of czech text, but there is also youtube video).

  • project page
  • Source codes are in subversion, every developer is welcome
  • TODO:
    • disabling of rotation while shaking (some heuristics)
    • disabling of rotation while is screen saver running
    • is there any dbus event "disable rotation" ?
  • Om2008.x package:
  opkg install http://projects.openmoko.org/frs/download.php/392/accel-rotate_0.2_armv4t.ipk
  update-rc.d accel-rotate defaults
  • Qt Extended 4.4.1 package:
  echo "/opt/Trolltech/Qtopia/lib/">> /etc/ld.so.conf.d/local.conf # there are some important libraries
  ldconfig 
  opkg install http://projects.openmoko.org/frs/download.php/415/accel-rotate_0.2_qte441_armv4t.ipk
  /etc/init.d/accel-rotate start
  update-rc.d accel-rotate defaults # start at boot time


No-screenshot.png Rotate

Rotates the screen according to the position of the Neo FreeRunner.


Homepage: [- -]
Package: accel-rotate (external download)
Tested on: -