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: 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 <FrameworkManager.h>
|
---|
20 | #include <AhrsData.h>
|
---|
21 |
|
---|
22 | using std::string;
|
---|
23 | using namespace flair::core;
|
---|
24 | using namespace flair::sensor;
|
---|
25 |
|
---|
26 | namespace flair {
|
---|
27 | namespace filter {
|
---|
28 |
|
---|
29 | Gx3_25_ahrs::Gx3_25_ahrs(const FrameworkManager *parent, string name,
|
---|
30 | SerialPort *serialport, Gx3_25_imu::Command_t command,
|
---|
31 | uint8_t priority)
|
---|
32 | : Ahrs(new Gx3_25_imu(parent, name, serialport, command, priority), name) {}
|
---|
33 |
|
---|
34 | Gx3_25_ahrs::~Gx3_25_ahrs() {}
|
---|
35 |
|
---|
36 | void Gx3_25_ahrs::Start(void) { ((Gx3_25_imu *)GetImu())->Start(); }
|
---|
37 |
|
---|
38 | // datas from Gx3_25_imu are AhrsData!
|
---|
39 | void Gx3_25_ahrs::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
|
---|