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

Last change on this file since 158 was 158, checked in by Sanahuja Guillaume, 7 years ago

corrected simu/device id for sensors

File size: 1.3 KB
RevLine 
[10]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[10]4// %flair:license}
[7]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
[15]26namespace flair {
27namespace filter {
[7]28
[158]29SimuAhrs::SimuAhrs(string name, uint32_t modelId,uint32_t deviceId,
[15]30 uint8_t priority)
[158]31 : Ahrs(new SimuImu(name, modelId,deviceId, priority), name) {
[157]32 SetIsReady(true);
33}
[7]34
35SimuAhrs::~SimuAhrs() {}
36
[15]37// datas from SimuImu are AhrsData!
[7]38void SimuAhrs::UpdateFrom(const io_data *data) {
[15]39 AhrsData *input = (AhrsData *)data;
40 AhrsData *output;
41 GetDatas(&output);
[7]42
[15]43 Quaternion quaternion;
44 Vector3D filteredAngRates;
45 input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
46 output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
47 output->SetDataTime(input->DataTime());
[7]48
[15]49 ProcessUpdate(output);
[7]50}
51
52} // end namespace filter
53} // end namespace flair
Note: See TracBrowser for help on using the repository browser.