Last change
on this file since 7 was 7, checked in by Sanahuja Guillaume, 8 years ago |
filter and meta
|
File size:
1.2 KB
|
Line | |
---|
1 | // created: 2014/02/07
|
---|
2 | // filename: SimuAhrs.cpp
|
---|
3 | //
|
---|
4 | // author: Guillaume Sanahuja
|
---|
5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
6 | //
|
---|
7 | // version: $Id: $
|
---|
8 | //
|
---|
9 | // purpose: Class for a simulation ahrs
|
---|
10 | //
|
---|
11 | //
|
---|
12 | /*********************************************************************/
|
---|
13 |
|
---|
14 | #include "SimuAhrs.h"
|
---|
15 | #include "SimuImu.h"
|
---|
16 | #include <FrameworkManager.h>
|
---|
17 | #include <AhrsData.h>
|
---|
18 |
|
---|
19 | using std::string;
|
---|
20 | using namespace flair::core;
|
---|
21 | using namespace flair::sensor;
|
---|
22 |
|
---|
23 | namespace flair { namespace filter {
|
---|
24 |
|
---|
25 | SimuAhrs::SimuAhrs(const FrameworkManager* parent,string name,uint32_t dev_id,uint8_t priority) :Ahrs(new SimuImu(parent,name,dev_id,priority),name) {
|
---|
26 | }
|
---|
27 |
|
---|
28 | SimuAhrs::~SimuAhrs() {}
|
---|
29 |
|
---|
30 | void SimuAhrs::Start(void) {
|
---|
31 | ((SimuImu*)GetImu())->Start();
|
---|
32 | }
|
---|
33 |
|
---|
34 | //datas from SimuImu are AhrsData!
|
---|
35 | void SimuAhrs::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
|
---|
Note:
See
TracBrowser
for help on using the repository browser.