source: flair-src/trunk/lib/FlairFilter/src/SimuAhrs.cpp @ 186

Last change on this file since 186 was 186, checked in by Sanahuja Guillaume, 4 years ago

maj imu

File size: 1.3 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5//  created:    2014/02/07
6//  filename:   SimuAhrs.cpp
7//
8//  author:     Guillaume Sanahuja
9//              Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11//  version:    $Id: $
12//
13//  purpose:    Class for a simulation ahrs
14//
15//
16/*********************************************************************/
17
18#include "SimuAhrs.h"
19#include "SimuImu.h"
20#include <AhrsData.h>
21
22using std::string;
23using namespace flair::core;
24using namespace flair::sensor;
25
26namespace flair {
27namespace filter {
28
29SimuAhrs::SimuAhrs(string name, uint32_t modelId,uint32_t deviceId,
30                   uint8_t priority)
31    : Ahrs(new SimuImu("imu", modelId,deviceId, priority), name) {
32  SetIsReady(true);
33}
34
35SimuAhrs::~SimuAhrs() {}
36
37// datas from SimuImu are AhrsData!
38void SimuAhrs::UpdateFrom(const io_data *data) {
39  AhrsData *input = (AhrsData *)data;
40  AhrsData *output;
41  GetDatas(&output);
42
43  Quaternion quaternion;
44  Vector3Df filteredAngRates;
45  input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
46  output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
47  output->SetDataTime(input->DataTime());
48
49  ProcessUpdate(output);
50}
51
52} // end namespace filter
53} // end namespace flair
Note: See TracBrowser for help on using the repository browser.