Symbian3/SDK/Source/GUID-92AD13DF-216A-4B5A-9C6D-5FA50BB0D692.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-92AD13DF-216A-4B5A-9C6D-5FA50BB0D692" xml:lang="en"><title>Sensor
Data Compensator Overview</title><shortdesc>The Sensor Data Compensator provides APIs to correct sensor data,
based on device or display orientation. That is, using the APIs, the coordinate
system can be adjusted appropriately to get correct sensor axis data in relation
to the Symbian device user's current display orientation.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-173CC4BB-4C2D-43B0-9ADD-85C716B9297B"><title>Description</title> 
     <p>The sensor channel APIs retrieve coordinate information and angle
data from different sensors when a display or device orientation change is
detected. The data is bound to the device form factor and hardware configuration
using device based coordinate system. Using the data, the sensor data compensator
APIs can adjust the coordinate system to match the changed system characteristics.
This procedure is called sensor data compensation. </p><p>For example, if
a display orientation change (as illustrated in the following figure) is detected,
the accelerometer sensor provides axis data using the device base coordinate
system. To convert the axis data to match the current display orientation,
sensor data compensator APIs can be used. The data compensator APIs enable
you to adjust the coordinate system to match the changed system characteristics.</p><fig id="GUID-CB810DA3-6532-47DF-878E-A0D8A07ACC7C">
<title>Example to illustrate adjustment of the coordinate system due to device
orientation change</title>
<image href="GUID-24B8686D-727A-47A8-B01D-1BA1FBC8F771_d0e129360_href.png" placement="inline"/>
</fig><p>To convert the sensor data to the compensated values, the adjustment
values (for example, interchanged x-axis with y-axis) for each device state
that the compensation is applied to, must be configured and taken as an input
for calculations.</p><fig id="GUID-15844543-6586-43AE-87C8-B90A4D24404D">
<title>Correcting the coordinate system of a Symbian device</title>
<desc>The figure depicts the correction of coordinate system in the Symbian
device</desc>
<image href="GUID-BF822A89-F932-400F-82FC-FB998B768EBF_d0e129372_href.png" placement="inline"/>
</fig><p>The following example explains how the sensor data compensation works,
by illustrating the behavior of maps application of the Symbian device when
the keyboard is in opened and closed state. </p><table id="GUID-6CF1E7CE-0076-415F-BF6A-E92034B6F6D4">
<tgroup cols="3"><colspec colname="col1"/><colspec colname="col2"/><colspec colname="col3"/>
<thead>
<row>
<entry valign="top">Symbian device position</entry>
<entry valign="top">Symbian device movement</entry>
<entry valign="top">Application behavior</entry>
</row>
</thead>
<tbody>
<row>
<entry>The keyboard is closed and the display is upward and parallel with
the table surface</entry>
<entry>The Symbian device spins around the z-axis</entry>
<entry>The compass needle points to the north and the map does not move on
the screen.</entry>
</row>
<row>
<entry>The keyboard is opened and the display is upward and parallel with
the table surface</entry>
<entry>The Symbian device spins around the z-axis</entry>
<entry>The compass needle points to the north and the map is always in the
north-south direction on the screen.</entry>
</row>
</tbody>
</tgroup>
</table> </section>
<section id="GUID-983C07BB-4B1A-4030-A533-22728BDCF281"><title>APIs</title><table id="GUID-B0112D3A-0CCB-47FF-BF2C-6DC4EE1217A7">
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<thead>
<row>
<entry>API</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>CSensorDataCompensator</entry>
<entry>The sensor data compensator class provides functions to
compensate sensor data.</entry>
</row>
</tbody>
</tgroup>
</table></section>
<section id="GUID-E046AE53-A268-4085-8BF4-293873115857"><title>Typical Uses</title><ul>
<li><p><xref href="GUID-64AC6F53-A9A5-46FD-BCC6-4A9BD8D4DB5C.dita">Compensating
Sensor Data</xref></p></li>
</ul></section>
</conbody></concept>