source: flair-src/trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp@ 218

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

maj imu

File size: 1.4 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: 2013/01/16
6// filename: Gx3_25_ahrs.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: class for 3dmgx3-25 ahrs
14//
15//
16/*********************************************************************/
17
18#include "Gx3_25_ahrs.h"
19#include <AhrsData.h>
[99]20#include <OneAxisRotation.h>
[7]21
22using std::string;
23using namespace flair::core;
24using namespace flair::sensor;
25
[15]26namespace flair {
27namespace filter {
[7]28
[137]29Gx3_25_ahrs::Gx3_25_ahrs(string name,
[15]30 SerialPort *serialport, Gx3_25_imu::Command_t command,
31 uint8_t priority)
[186]32 : Ahrs(new Gx3_25_imu( "imu", serialport, command, priority), name) {
[7]33
[157]34 SetIsReady(true);
35}
36
[15]37Gx3_25_ahrs::~Gx3_25_ahrs() {}
[7]38
[173]39// datas outputed from Gx3_25_imu are AhrsData!
[7]40void Gx3_25_ahrs::UpdateFrom(const io_data *data) {
[15]41 AhrsData *input = (AhrsData *)data;
42 AhrsData *output;
43 GetDatas(&output);
[7]44
[15]45 Quaternion quaternion;
[167]46 Vector3Df filteredAngRates;
[15]47 input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
48 output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
49 output->SetDataTime(input->DataTime());
[7]50
[15]51 ProcessUpdate(output);
[7]52}
53
54} // end namespace filter
55} // end namespace flair
Note: See TracBrowser for help on using the repository browser.