[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
|
---|
[286] | 6 | // filename: SimulatedAhrs.cpp
|
---|
[7] | 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 | /*********************************************************************/
|
---|
[268] | 17 | #ifdef CORE2_64
|
---|
[7] | 18 |
|
---|
[286] | 19 | #include "SimulatedAhrs.h"
|
---|
| 20 | #include "SimulatedImu.h"
|
---|
[7] | 21 | #include <AhrsData.h>
|
---|
| 22 |
|
---|
| 23 | using std::string;
|
---|
| 24 | using namespace flair::core;
|
---|
| 25 | using namespace flair::sensor;
|
---|
| 26 |
|
---|
[15] | 27 | namespace flair {
|
---|
| 28 | namespace filter {
|
---|
[7] | 29 |
|
---|
[286] | 30 | SimulatedAhrs::SimulatedAhrs(string name, uint32_t modelId,uint32_t deviceId,
|
---|
[15] | 31 | uint8_t priority)
|
---|
[286] | 32 | : Ahrs(new SimulatedImu("imu", modelId,deviceId, priority), name) {
|
---|
[157] | 33 | SetIsReady(true);
|
---|
| 34 | }
|
---|
[7] | 35 |
|
---|
[286] | 36 | SimulatedAhrs::~SimulatedAhrs() {}
|
---|
[7] | 37 |
|
---|
[286] | 38 | // datas from SimulatedImu are AhrsData!
|
---|
| 39 | void SimulatedAhrs::UpdateFrom(const io_data *data) {
|
---|
[15] | 40 | AhrsData *input = (AhrsData *)data;
|
---|
| 41 | AhrsData *output;
|
---|
| 42 | GetDatas(&output);
|
---|
[7] | 43 |
|
---|
[15] | 44 | Quaternion quaternion;
|
---|
[167] | 45 | Vector3Df filteredAngRates;
|
---|
[15] | 46 | input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
|
---|
| 47 | output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
|
---|
| 48 | output->SetDataTime(input->DataTime());
|
---|
[7] | 49 |
|
---|
[15] | 50 | ProcessUpdate(output);
|
---|
[7] | 51 | }
|
---|
| 52 |
|
---|
| 53 | } // end namespace filter
|
---|
| 54 | } // end namespace flair
|
---|
[268] | 55 |
|
---|
| 56 | #endif |
---|