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

Last change on this file since 24 was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

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 {
28namespace filter {
29
30SimuAhrs::SimuAhrs(const FrameworkManager *parent, string name, uint32_t dev_id,
31 uint8_t priority)
32 : Ahrs(new SimuImu(parent, name, dev_id, priority), name) {}
33
34SimuAhrs::~SimuAhrs() {}
35
36void SimuAhrs::Start(void) { ((SimuImu *)GetImu())->Start(); }
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.