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

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

filter and meta

File size: 1.3 KB
Line 
1// created: 2013/01/16
2// filename: Gx3_25_ahrs.cpp
3//
4// author: Guillaume Sanahuja
5// Copyright Heudiasyc UMR UTC/CNRS 7253
6//
7// version: $Id: $
8//
9// purpose: class for 3dmgx3-25 ahrs
10//
11//
12/*********************************************************************/
13
14#include "Gx3_25_ahrs.h"
15#include <FrameworkManager.h>
16#include <AhrsData.h>
17
18using std::string;
19using namespace flair::core;
20using namespace flair::sensor;
21
22namespace flair { namespace filter {
23
24Gx3_25_ahrs::Gx3_25_ahrs(const FrameworkManager* parent,string name,SerialPort *serialport,Gx3_25_imu::Command_t command,uint8_t priority) : Ahrs(new Gx3_25_imu(parent,name,serialport,command,priority),name) {
25}
26
27Gx3_25_ahrs::~Gx3_25_ahrs() {
28}
29
30void Gx3_25_ahrs::Start(void) {
31 ((Gx3_25_imu*)GetImu())->Start();
32}
33
34//datas from Gx3_25_imu are AhrsData!
35void Gx3_25_ahrs::UpdateFrom(const io_data *data) {
36 AhrsData *input=(AhrsData*)data;
37 AhrsData *output;
38 GetDatas(&output);
39
40 Quaternion quaternion;
41 Vector3D filteredAngRates;
42 input->GetQuaternionAndAngularRates(quaternion,filteredAngRates);
43 output->SetQuaternionAndAngularRates(quaternion,filteredAngRates);
44 output->SetDataTime(input->DataTime());
45
46 ProcessUpdate(output);
47}
48
49} // end namespace filter
50} // end namespace flair
51
Note: See TracBrowser for help on using the repository browser.