source: flair-src/trunk/lib/FlairFilter/src/PassthroughAhrs.cpp

Last change on this file was 417, checked in by Sanahuja Guillaume, 8 months ago

define and use passthrough ahrs

  • Property svn:eol-style set to native
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:    2021/04/15
6//  filename:   PassthroughAhrs.cpp
7//
8//  author:     Guillaume Sanahuja
9//              Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11//  version:    $Id: $
12//
13//  purpose:    Class for passthrough imu to ahrs. When imu can already delivers ahrs datas
14//
15//
16/*********************************************************************/
17
18#include "PassthroughAhrs.h"
19#include <AhrsData.h>
20
21
22using std::string;
23using namespace flair::core;
24using namespace flair::sensor;
25
26namespace flair {
27namespace filter {
28
29PassthroughAhrs::PassthroughAhrs(Imu *imu,string name)
30    : Ahrs(imu, name) {
31
32  SetIsReady(true);
33}
34
35PassthroughAhrs::~PassthroughAhrs() {}
36
37// datas outputed imu are AhrsData!
38void PassthroughAhrs::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.