Last change
on this file since 137 was 137, checked in by Sanahuja Guillaume, 8 years ago |
singleton manager
|
File size:
1.3 KB
|
Rev | Line | |
---|
[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: 2014/02/07
|
---|
| 6 | // filename: SimuAhrs.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Class for a simulation ahrs
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #include "SimuAhrs.h"
|
---|
| 19 | #include "SimuImu.h"
|
---|
| 20 | #include <AhrsData.h>
|
---|
| 21 |
|
---|
| 22 | using std::string;
|
---|
| 23 | using namespace flair::core;
|
---|
| 24 | using namespace flair::sensor;
|
---|
| 25 |
|
---|
[15] | 26 | namespace flair {
|
---|
| 27 | namespace filter {
|
---|
[7] | 28 |
|
---|
[137] | 29 | SimuAhrs::SimuAhrs(string name, uint32_t dev_id,
|
---|
[15] | 30 | uint8_t priority)
|
---|
[137] | 31 | : Ahrs(new SimuImu(name, dev_id, priority), name) {}
|
---|
[7] | 32 |
|
---|
| 33 | SimuAhrs::~SimuAhrs() {}
|
---|
| 34 |
|
---|
[15] | 35 | void SimuAhrs::Start(void) { ((SimuImu *)GetImu())->Start(); }
|
---|
[7] | 36 |
|
---|
[15] | 37 | // datas from SimuImu are AhrsData!
|
---|
[7] | 38 | void SimuAhrs::UpdateFrom(const io_data *data) {
|
---|
[15] | 39 | AhrsData *input = (AhrsData *)data;
|
---|
| 40 | AhrsData *output;
|
---|
| 41 | GetDatas(&output);
|
---|
[7] | 42 |
|
---|
[15] | 43 | Quaternion quaternion;
|
---|
| 44 | Vector3D filteredAngRates;
|
---|
| 45 | input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
|
---|
| 46 | output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
|
---|
| 47 | output->SetDataTime(input->DataTime());
|
---|
[7] | 48 |
|
---|
[15] | 49 | ProcessUpdate(output);
|
---|
[7] | 50 | }
|
---|
| 51 |
|
---|
| 52 | } // end namespace filter
|
---|
| 53 | } // end namespace flair
|
---|
Note:
See
TracBrowser
for help on using the repository browser.