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 _SENSOR_FUSION_H_
21 #define _SENSOR_FUSION_H_
24 #include <sensor_base.h>
26 typedef std::array<std::array<float, 3> , 3> arr33_t;
28 class sensor_fusion : public sensor_base
32 virtual ~sensor_fusion();
34 virtual void fuse(const sensor_event_t &event) = 0;
35 virtual bool is_data_ready(void);
36 virtual bool add_interval(int client_id, unsigned int interval);
37 virtual bool delete_interval(int client_id);
38 virtual bool get_properties(sensor_properties_t &properties);
40 virtual bool get_rotation_matrix(arr33_t &rot);
41 virtual bool get_attitude(float &x, float &y, float &z, float &w);
42 virtual bool get_gyro_bias(float &x, float &y, float &z);
43 virtual bool get_rotation_vector(float &x, float &y, float &z, float &w, float &heading_accuracy);
44 virtual bool get_linear_acceleration(float &x, float &y, float &z);
45 virtual bool get_gravity(float &x, float &y, float &z);
46 virtual bool get_rotation_vector_6axis(float &x, float &y, float &z, float &w, float &heading_accuracy);
47 virtual bool get_geomagnetic_rotation_vector(float &x, float &y, float &z, float &w);
48 virtual bool get_orientation(float &azimuth, float &pitch, float &roll);
53 #endif /*_SENSOR_FUSION_H_*/