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

Last change on this file since 10 was 10, checked in by Sanahuja Guillaume, 6 years ago

lic

File size: 1.4 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 <FrameworkManager.h>
21#include <AhrsData.h>
22
23using std::string;
24using namespace flair::core;
25using namespace flair::sensor;
26
27namespace flair { namespace filter {
28
29SimuAhrs::SimuAhrs(const FrameworkManager* parent,string name,uint32_t dev_id,uint8_t priority) :Ahrs(new SimuImu(parent,name,dev_id,priority),name) {
30}
31
32SimuAhrs::~SimuAhrs() {}
33
34void SimuAhrs::Start(void) {
35    ((SimuImu*)GetImu())->Start();
36}
37
38//datas from SimuImu are AhrsData!
39void SimuAhrs::UpdateFrom(const io_data *data) {
40    AhrsData *input=(AhrsData*)data;
41    AhrsData *output;
42    GetDatas(&output);
43
44    Quaternion quaternion;
45    Vector3D filteredAngRates;
46    input->GetQuaternionAndAngularRates(quaternion,filteredAngRates);
47    output->SetQuaternionAndAngularRates(quaternion,filteredAngRates);
48    output->SetDataTime(input->DataTime());
49
50    ProcessUpdate(output);
51}
52
53} // end namespace filter
54} // end namespace flair
Note: See TracBrowser for help on using the repository browser.