4 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _LIB_SENSOR_FUSION_H_
21 #define _LIB_SENSOR_FUSION_H_
23 #include <sensor_fusion.h>
25 class lib_sensor_fusion : public sensor_fusion
35 bool add_interval(int client_id, unsigned int interval);
36 bool delete_interval(int client_id);
37 bool get_properties(sensor_properties_t &properties);
39 void fuse(const sensor_event_t &event);
40 bool get_rotation_matrix(arr33_t &rot);
41 bool get_attitude(float &x, float &y, float &z, float &w);
42 bool get_gyro_bias(float &x, float &y, float &z);
43 bool get_rotation_vector(float &x, float &y, float &z, float &w, float &heading_accuracy);
44 bool get_linear_acceleration(float &x, float &y, float &z);
45 bool get_gravity(float &x, float &y, float &z);
46 bool get_rotation_vector_6axis(float &x, float &y, float &z, float &w, float &heading_accuracy);
47 bool get_geomagnetic_rotation_vector(float &x, float &y, float &z, float &w);
48 bool get_orientation(float &azimuth, float &pitch, float &roll);
50 sensor_base *m_accel_sensor;
51 sensor_base *m_gyro_sensor;
52 sensor_base *m_magnetic_sensor;
55 #endif /*_LIB_SENSOR_FUSION_H_*/