source: flair-src/tags/latest/lib/FlairFilter/src/SimulatedAhrs.cpp

Last change on this file was 286, checked in by Sanahuja Guillaume, 3 years ago

draw vrpn axis in simulator

File size: 1.4 KB
Line 
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:    2014/02/07
6//  filename:   SimulatedAhrs.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#ifdef CORE2_64
18
19#include "SimulatedAhrs.h"
20#include "SimulatedImu.h"
21#include <AhrsData.h>
22
23using std::string;
24using namespace flair::core;
25using namespace flair::sensor;
26
27namespace flair {
28namespace filter {
29
30SimulatedAhrs::SimulatedAhrs(string name, uint32_t modelId,uint32_t deviceId,
31                   uint8_t priority)
32    : Ahrs(new SimulatedImu("imu", modelId,deviceId, priority), name) {
33  SetIsReady(true);
34}
35
36SimulatedAhrs::~SimulatedAhrs() {}
37
38// datas from SimulatedImu are AhrsData!
39void SimulatedAhrs::UpdateFrom(const io_data *data) {
40  AhrsData *input = (AhrsData *)data;
41  AhrsData *output;
42  GetDatas(&output);
43
44  Quaternion quaternion;
45  Vector3Df 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
55
56#endif
Note: See TracBrowser for help on using the repository browser.