source: flair-src/trunk/lib/FlairIpc/src/IpcAhrs.cpp @ 397

Last change on this file since 397 was 397, checked in by Sanahuja Guillaume, 8 months ago

add ipc lib

  • Property svn:eol-style set to native
File size: 1.3 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:    2021/03/03
6//  filename:   IpcdAhrs.cpp
7//
8//  author:     Sébastien Ambroziak
9//              Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11//  version:    $Id: $
12//
13//  purpose:    Class for an ipc ahrs
14//
15//
16/*********************************************************************/
17
18
19#include "IpcAhrs.h"
20#include "IpcImu.h"
21#include <AhrsData.h>
22
23using std::string;
24using namespace flair::core;
25using namespace flair::sensor;
26
27namespace flair {
28namespace filter {
29
30IpcAhrs::IpcAhrs(string name, uint8_t priority, const char* ipc_name, int ipc_channel)
31    : Ahrs(new IpcImu("imu", priority, ipc_name, ipc_channel, false), name) {
32  SetIsReady(true);
33}
34
35IpcAhrs::~IpcAhrs() {}
36
37// datas from IpcImu are AhrsData!
38void IpcAhrs::UpdateFrom(const io_data *data) {
39  AhrsData *input = (AhrsData *)data;
40  AhrsData *output;
41  GetDatas(&output);
42
43  Quaternion quaternion;
44  Vector3Df filteredAngRates;
45  input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
46  output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
47  output->SetDataTime(input->DataTime());
48
49  ProcessUpdate(output);
50}
51
52} // end namespace filter
53} // end namespace flair
54
Note: See TracBrowser for help on using the repository browser.