Adding orientation_filter class definition 62/23462/5
authorRamasamy <ram.kannan@samsung.com>
Thu, 26 Jun 2014 06:33:11 +0000 (12:03 +0530)
committerRamasamy <ram.kannan@samsung.com>
Wed, 2 Jul 2014 08:19:11 +0000 (13:49 +0530)
  - adding orientation_filter source files with definitions
  - adding test application to read sensor data from sample data files

  Gurleen Kaur will help with implementation and testing of the class

signed-off-by: Ramasamy <ram.kannan@samsung.com>
Change-Id: I9417c85f7e5b656e592772afee7b1e6f4fc1aba9

src/sensor_fusion/standalone/util/orientation_filter.cpp [new file with mode: 0644]
src/sensor_fusion/standalone/util/orientation_filter.h [new file with mode: 0644]
src/sensor_fusion/standalone/util/test/orientation_filter_test/.cproject [new file with mode: 0644]
src/sensor_fusion/standalone/util/test/orientation_filter_test/.project [new file with mode: 0644]
src/sensor_fusion/standalone/util/test/orientation_filter_test/orientation_filter_main.cpp [new file with mode: 0644]

diff --git a/src/sensor_fusion/standalone/util/orientation_filter.cpp b/src/sensor_fusion/standalone/util/orientation_filter.cpp
new file mode 100644 (file)
index 0000000..83d6a3a
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * sensord
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "orientation_filter.h"
+
+#define MOVING_AVERAGE_WINDOW_LENGTH   20
+#define RAD2DEG                57.2957795
+#define DEG2RAD                0.0174532925
+#define US2S           (1.0 / 1000000.0)
+#define GRAVITY                9.80665
+#define PI                     3.141593
+
+// Gyro Types
+// Systron-donner "Horizon"
+#define ZIGMA_W                (0.05 * DEG2RAD) //deg/s
+#define TAU_W          1000 //secs
+// Crossbow DMU-6X
+//#define ZIGMA_W                      0.05 * DEG2RAD //deg/s
+//#define TAU_W                        300 //secs
+// FOGs (KVH Autogyro and Crossbow DMU-FOG)
+//#define ZIGMA_W                      0       //deg/s
+
+template <typename TYPE>
+orientation_filter<TYPE>::orientation_filter()
+{
+
+}
+
+template <typename TYPE>
+orientation_filter<TYPE>::~orientation_filter()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::filter_sensor_data(sensor_data<TYPE> accel,
+               sensor_data<TYPE> gyro, sensor_data<TYPE> magnetic)
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::orientation_triad_algorithm()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::compute_aiding_var()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::compute_driving_var()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::compute_process_covar()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::compute_measurement_covar()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::compute_prediction_covar()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::compute_quat_diff()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::compute_quat_sum()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::update_quat_sum()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::time_update()
+{
+
+}
+
+template <typename TYPE>
+inline void orientation_filter<TYPE>::measurement_update()
+{
+
+}
+
+template <typename TYPE>
+inline euler_angles<TYPE> orientation_filter<TYPE>::get_corrected_orientation()
+{
+       euler_angles<TYPE> euler_ang;
+
+       return euler_ang;
+}
+
+template <typename TYPE>
+euler_angles<TYPE> orientation_filter<TYPE>::get_orientation(sensor_data<TYPE> accel,
+               sensor_data<TYPE> gyro, sensor_data<TYPE> magnetic)
+{
+       euler_angles<TYPE> cor_euler_ang;
+
+       filter_sensor_data(accel, gyro, magnetic);
+
+       orientation_triad_algorithm();
+
+       compute_aiding_var();
+
+       compute_driving_var();
+
+       compute_measurement_covar();
+
+       compute_prediction_covar();
+
+       compute_quat_diff();
+
+       compute_quat_sum();
+
+       update_quat_sum();
+
+       time_update();
+
+       measurement_update();
+
+       cor_euler_ang = get_corrected_orientation();
+
+       return cor_euler_ang;
+}
diff --git a/src/sensor_fusion/standalone/util/orientation_filter.h b/src/sensor_fusion/standalone/util/orientation_filter.h
new file mode 100644 (file)
index 0000000..a08d3f1
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * sensord
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef _ORIENTATION_FILTER_H
+#define _ORIENTATION_FILTER_H
+
+#include "matrix.h"
+#include "vector.h"
+#include "sensor_data.h"
+#include "quaternion.h"
+#include "euler_angles.h"
+#include "rotation_matrix.h"
+
+template <typename TYPE>
+class orientation_filter {
+public:
+       sensor_data<TYPE> filt_accel[2];
+       sensor_data<TYPE> filt_gyro[2];
+       sensor_data<TYPE> filt_magnetic[2];
+       matrix<TYPE> transition_matrix;
+       matrix<TYPE> prediction_covariance;
+       vector<TYPE> state_new;
+       vector<TYPE> state_old;
+       vector<TYPE> state_error;
+       vector<TYPE> bias_correction;
+       quaternion<TYPE> quat_diff;
+       quaternion<TYPE> quat_sum;
+       quaternion<TYPE> quat_aid;
+       quaternion<TYPE> quat_driv;
+       quaternion<TYPE> quat_error;
+       euler_angles<TYPE> euler_error;
+       rotation_matrix<TYPE> rot_matrix;
+       euler_angles<TYPE> orientation;
+
+       orientation_filter();
+       ~orientation_filter();
+
+       inline void filter_sensor_data(sensor_data<TYPE> accel,
+                       sensor_data<TYPE> gyro, sensor_data<TYPE> magnetic);
+       inline void orientation_triad_algorithm();
+       inline void compute_aiding_var();
+       inline void compute_driving_var();
+       inline void compute_process_covar();
+       inline void compute_measurement_covar();
+       inline void compute_prediction_covar();
+       inline void compute_quat_diff();
+       inline void compute_quat_sum();
+       inline void update_quat_sum();
+       inline void time_update();
+       inline void measurement_update();
+       inline euler_angles<TYPE> get_corrected_orientation();
+
+       euler_angles<TYPE> get_orientation(sensor_data<TYPE> accel,
+                       sensor_data<TYPE> gyro, sensor_data<TYPE> magnetic);
+};
+
+#include "orientation_filter.cpp"
+
+#endif /* _ORIENTATION_FILTER_H */
diff --git a/src/sensor_fusion/standalone/util/test/orientation_filter_test/.cproject b/src/sensor_fusion/standalone/util/test/orientation_filter_test/.cproject
new file mode 100644 (file)
index 0000000..c9958ee
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+       <storageModule moduleId="org.eclipse.cdt.core.settings">
+               <cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1985721554">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1985721554" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1985721554" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
+                                       <folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1985721554." name="/" resourcePath="">
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1241765326" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.860242012" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
+                                                       <builder buildPath="${workspace_loc:/orientation_filter_main/Debug}" id="cdt.managedbuild.target.gnu.builder.exe.debug.934923741" managedBuildOn="true" name="Gnu Make Builder.Debug" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.base.889866382" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1782918544" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+                                                               <option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1517134268" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+                                                               <option id="gnu.cpp.compiler.exe.debug.option.debugging.level.629917281" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1914165008" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1939909081" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
+                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1786477497" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
+                                                               <option id="gnu.c.compiler.exe.debug.option.debugging.level.1013393143" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1652488264" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1248951256" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.302180824" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1136475200" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+                                                               </inputType>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1342651968" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.272071043" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+                                                       </tool>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+               </cconfiguration>
+               <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.907439216">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.907439216" moduleId="org.eclipse.cdt.core.settings" name="Release">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.907439216" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
+                                       <folderInfo id="cdt.managedbuild.config.gnu.exe.release.907439216." name="/" resourcePath="">
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.855226350" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
+                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1334312457" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
+                                                       <builder buildPath="${workspace_loc:/orientation_filter_main/Release}" id="cdt.managedbuild.target.gnu.builder.exe.release.1067012518" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.base.1799951387" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1064875116" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
+                                                               <option id="gnu.cpp.compiler.exe.release.option.optimization.level.366404287" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+                                                               <option id="gnu.cpp.compiler.exe.release.option.debugging.level.1052816" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1868300640" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.1743077198" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
+                                                               <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.1751846765" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
+                                                               <option id="gnu.c.compiler.exe.release.option.debugging.level.935966648" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.52044404" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1830971961" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/>
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1757189430" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.601340365" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+                                                               </inputType>
+                                                       </tool>
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.329797480" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1145746336" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+                                                       </tool>
+                                               </toolChain>
+                                       </folderInfo>
+                               </configuration>
+                       </storageModule>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="orientation_filter_main.cdt.managedbuild.target.gnu.exe.1552177428" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+       </storageModule>
+       <storageModule moduleId="scannerConfiguration">
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1985721554;cdt.managedbuild.config.gnu.exe.debug.1985721554.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1939909081;cdt.managedbuild.tool.gnu.c.compiler.input.1652488264">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+               </scannerConfigBuildInfo>
+               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.907439216;cdt.managedbuild.config.gnu.exe.release.907439216.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1064875116;cdt.managedbuild.tool.gnu.cpp.compiler.input.1868300640">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+               </scannerConfigBuildInfo>
+               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.907439216;cdt.managedbuild.config.gnu.exe.release.907439216.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1743077198;cdt.managedbuild.tool.gnu.c.compiler.input.52044404">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+               </scannerConfigBuildInfo>
+               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1985721554;cdt.managedbuild.config.gnu.exe.debug.1985721554.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1782918544;cdt.managedbuild.tool.gnu.cpp.compiler.input.1914165008">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+               </scannerConfigBuildInfo>
+       </storageModule>
+</cproject>
diff --git a/src/sensor_fusion/standalone/util/test/orientation_filter_test/.project b/src/sensor_fusion/standalone/util/test/orientation_filter_test/.project
new file mode 100644 (file)
index 0000000..7e048f5
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>orientation_filter_main</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <triggers>clean,full,incremental,</triggers>
+                       <arguments>
+                               <dictionary>
+                                       <key>?name?</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
+                                       <value>make</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildLocation</key>
+                                       <value>${workspace_loc:/orientation_filter_main/Debug}</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+                                       <value>clean</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.contents</key>
+                                       <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>true</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <triggers>full,incremental,</triggers>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.tizen.nativecpp.apichecker.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.core.ccnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+               <nature>org.tizen.nativecpp.apichecker.core.tizenCppNature</nature>
+       </natures>
+</projectDescription>
diff --git a/src/sensor_fusion/standalone/util/test/orientation_filter_test/orientation_filter_main.cpp b/src/sensor_fusion/standalone/util/test/orientation_filter_test/orientation_filter_main.cpp
new file mode 100644 (file)
index 0000000..862428d
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * sensord
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "../../orientation_filter.h"
+#include <stdlib.h>
+#include <iostream>
+#include <fstream>
+#include <string>
+using namespace std;
+
+#define ORIENTATION_DATA_PATH "../../../../design/data/100ms/orientation/roll_pitch_yaw/"
+#define ORIENTATION_DATA_SIZE 100
+
+int main()
+{
+       int data_available = ORIENTATION_DATA_SIZE;
+       ifstream accel_file, gyro_file, magnetic_file;
+       string line_accel, line_gyro, line_magnetic;
+       float sdata[3];
+       unsigned long long time_stamp;
+       euler_angles<float> orientation;
+       orientation_filter<float> orien_filter;
+
+       accel_file.open(((string)ORIENTATION_DATA_PATH + (string)"accel.txt").c_str());
+       gyro_file.open(((string)ORIENTATION_DATA_PATH + (string)"gyro.txt").c_str());
+       magnetic_file.open(((string)ORIENTATION_DATA_PATH + (string)"magnetic.txt").c_str());
+
+       char *token = NULL;
+
+       while (data_available-- > 0)
+       {
+               getline(accel_file, line_accel);
+               sdata[0] = strtof(line_accel.c_str(), &token);
+               sdata[1] = strtof(token, &token);
+               sdata[2] = strtof(token, &token);
+               time_stamp = strtoull (token, NULL, 10);
+               sensor_data<float> accel_data(sdata[0], sdata[1], sdata[2], time_stamp);
+
+               cout << "Accel Data\t" << accel_data.m_data << "\t Time Stamp\t" << accel_data.m_time_stamp << "\n\n";
+
+               getline(gyro_file, line_gyro);
+               sdata[0] = strtof(line_gyro.c_str(), &token);
+               sdata[1] = strtof(token, &token);
+               sdata[2] = strtof(token, &token);
+               time_stamp = strtoull (token, NULL, 10);
+               sensor_data<float> gyro_data(sdata[0], sdata[1], sdata[2], time_stamp);
+
+               cout << "Gyro Data\t" << gyro_data.m_data << "\t Time Stamp\t" << gyro_data.m_time_stamp << "\n\n";
+
+               getline(magnetic_file, line_magnetic);
+               sdata[0] = strtof(line_magnetic.c_str(), &token);
+               sdata[1] = strtof(token, &token);
+               sdata[2] = strtof(token, &token);
+               time_stamp = strtoull (token, NULL, 10);
+               sensor_data<float> magnetic_data(sdata[0], sdata[1], sdata[2], time_stamp);
+
+               cout << "Magnetic Data\t" << magnetic_data.m_data << "\t Time Stamp\t" << magnetic_data.m_time_stamp << "\n\n";
+
+               orientation = orien_filter.get_orientation(accel_data, gyro_data, magnetic_data);
+
+       }
+
+       return 0;
+}