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: 2011/08/19
|
---|
6 | // filename: Gx3_25_imu.cpp
|
---|
7 | //
|
---|
8 | // author: Guillaume Sanahuja
|
---|
9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
10 | //
|
---|
11 | // version: $Id: $
|
---|
12 | //
|
---|
13 | // purpose: objet integrant la centrale 3dmgx3-25
|
---|
14 | //
|
---|
15 | //
|
---|
16 | /*********************************************************************/
|
---|
17 |
|
---|
18 | #include "Gx3_25_imu.h"
|
---|
19 | #include <FrameworkManager.h>
|
---|
20 | #include "Gx3_25_imu_impl.h"
|
---|
21 | #include <GroupBox.h>
|
---|
22 | #include <ImuData.h>
|
---|
23 |
|
---|
24 | using std::string;
|
---|
25 | using namespace flair::core;
|
---|
26 |
|
---|
27 | namespace flair {
|
---|
28 | namespace sensor {
|
---|
29 |
|
---|
30 | Gx3_25_imu::Gx3_25_imu(const FrameworkManager *parent, string name,
|
---|
31 | SerialPort *serialport, Command_t command,
|
---|
32 | uint8_t priority)
|
---|
33 | : Imu(parent, name), Thread(parent, name, priority) {
|
---|
34 | pimpl_ = new Gx3_25_imu_impl(this, name, serialport, command, GetGroupBox());
|
---|
35 |
|
---|
36 | if (command == EulerAnglesAndAngularRates) {
|
---|
37 | Printf("Gx3_25_imu enabling EulerAnglesAndAngularRates\n");
|
---|
38 | } else if (command == AccelerationAngularRateAndOrientationMatrix) {
|
---|
39 | Printf("Gx3_25_imu enabling AccelerationAngularRateAndOrientationMatrix\n");
|
---|
40 | } else if (command == Quaternion) {
|
---|
41 | Printf("Gx3_25_imu enabling Quaternion\n");
|
---|
42 | } else {
|
---|
43 | Thread::Err("command not supported (%i)\n", command);
|
---|
44 | }
|
---|
45 | // AddDataToLog(imudata);
|
---|
46 | }
|
---|
47 |
|
---|
48 | Gx3_25_imu::~Gx3_25_imu() {
|
---|
49 | SafeStop();
|
---|
50 | Join();
|
---|
51 | delete pimpl_;
|
---|
52 | }
|
---|
53 |
|
---|
54 | void Gx3_25_imu::Run(void) { pimpl_->Run(); }
|
---|
55 |
|
---|
56 | } // end namespace sensor
|
---|
57 | } // end namespace flair
|
---|