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 |
|
---|
18 | using std::string;
|
---|
19 | using namespace flair::core;
|
---|
20 | using namespace flair::sensor;
|
---|
21 |
|
---|
22 | namespace flair { namespace filter {
|
---|
23 |
|
---|
24 | Gx3_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 |
|
---|
27 | Gx3_25_ahrs::~Gx3_25_ahrs() {
|
---|
28 | }
|
---|
29 |
|
---|
30 | void Gx3_25_ahrs::Start(void) {
|
---|
31 | ((Gx3_25_imu*)GetImu())->Start();
|
---|
32 | }
|
---|
33 |
|
---|
34 | //datas from Gx3_25_imu are AhrsData!
|
---|
35 | void 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 |
|
---|