Sunday, November 25, 2012

state of QSensor and Qt's sensor gestures

I wanted my next post to include some videos demonstrating QSensors and QSensorGestures. I got sidelined by learning BlackBerry Cascades development.


I am happy to report that Qt5's QSensor and QSensorGestures work very well on BB10.



The qt-project, in cooperation with Qt copyright holders Digia, have recently opened up Qt Mobility project and included that code in the Open Governance model that Qt is currently developed under.

This means that I can contribute to qt-mobility again since Nokia closed the Brisbane office.

There are a number of high profile projects that use Qt 4 and Qt Mobility, namely Jolla Mobile and BlackBerry 10.

One of the first community committed patches was me backporting QSensorGesture to Qt Mobility.
You can get the code here:
http://qt.gitorious.org/qt-mobility


There is one change in the signals being generated. I decided to remove the runtime generated signals such as 'shake()' and 'whip()' that use QMetaObjectBuilder. So now there is only 'detected(QString)' signal. The QML API remains the same, with an additional 1.3 version.

On top of that, I added a freefall gesture, as well as moving the irProximity sensor to it's proper place with all the other QSensors.

As for Qt 5...

QSensors unfortunately will not be part of the Qt 5 release package. On top of that, you wont be able to currently find the documentation at qt-project.org nor build QSensors using the normal 'make module-qtsensors'. So, it's a bit like it fell off the face of the Earth.

But fear not, it's still there in git. Still being worked on and improved.


Saturday, October 27, 2012

motion sensor gestures

It's been quite a bit of time since I blogged about anything. No longer able to post to the official Qt Labs blog, so I will post here, and maybe it will get picked up to a wider audience.

It's been about 60 days since my last day at the Nokia office In Brisbane, Australia. My days are now full of house duties, kids, recording music, and looking for appropriate workage.

Blatant self promotion

I have been trying to keep my chops up, taking a short contract doing some desktopy work with Qt. But also keeping up with the Mer and Nemo projects.

We have been working on refactoring the Qt 5 QSensor qml API, removing the old qt-mobility stuff and merging the two imports.

As well, I will, in the near future be adding a QFreeFall sensor that detects when a device is freefalling, and a Wii controller sensor plugin to drive the normal motion QSensors and well as some of the QSensorGestures.

I have done the easily possible, and back ported QSensorGesture and friends to Qt 4, so projects such as Mer/Nemo/Jolla, as well as the Blackberry 10 projects could use some cool sensor gestures API.

When most people think of gesture recognition, they think of the touch sensor. Within Qt, this would be the QGesture classes. They also think about using the image sensor to decipher gestures through a computer vision API such as openCV.
and although I would like to extend QSensorGesture to include the openCV and touch sensors techniques, this is really about existing device motion gestures.

Things such as the obvious gesture of 'shake' - when you shake your phone/tablet, your audio playlist gets randomized. But it can be extended to other gestures as well.

QSensors include the qtsensors gesture recognition plugin, that includes such gestures as whip, shake, pickup, twist, cover, hover, turnover and slam.

http://doc-snapshot.qt-project.org/5.0/sensorgesture-plugins-topics.html#recognizer-plugins

The above url shows about how to perform these gestures.

These are simple ad-hock gesture recognizers, and do not verge into the more robust and technically challenging HMM realm of recognizers.


Nor is it currently possible for a user to create their own gestures and use them. I'd planned on doing this at my day job, but someone thought it better I needed to take my own time doing them. These are still on my todo list.

Of course, the backport isn't in the official Qt Mobility repo until becomes a part of the qt-project, but I believe that is only a matter of time and resources.

In my next blog, I will demonstrate the use of motion sensor gestures and the advantages that they might bring to a mobile UX.