[3] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[3] | 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 | /*********************************************************************/
|
---|
[268] | 17 | #ifdef ARMV7A
|
---|
[3] | 18 |
|
---|
| 19 | #include "Gx3_25_imu.h"
|
---|
| 20 | #include <FrameworkManager.h>
|
---|
| 21 | #include "Gx3_25_imu_impl.h"
|
---|
| 22 | #include <GroupBox.h>
|
---|
| 23 | #include <ImuData.h>
|
---|
| 24 |
|
---|
| 25 | using std::string;
|
---|
| 26 | using namespace flair::core;
|
---|
| 27 |
|
---|
[15] | 28 | namespace flair {
|
---|
| 29 | namespace sensor {
|
---|
[3] | 30 |
|
---|
[137] | 31 | Gx3_25_imu::Gx3_25_imu(string name,
|
---|
[15] | 32 | SerialPort *serialport, Command_t command,
|
---|
| 33 | uint8_t priority)
|
---|
[137] | 34 | : Imu(name), Thread(getFrameworkManager(), name, priority) {
|
---|
[15] | 35 | pimpl_ = new Gx3_25_imu_impl(this, name, serialport, command, GetGroupBox());
|
---|
[3] | 36 |
|
---|
[15] | 37 | if (command == EulerAnglesAndAngularRates) {
|
---|
[103] | 38 | Printf("Gx3_25_imu enabling EulerAnglesAndAngularRates\n");
|
---|
[15] | 39 | } else if (command == AccelerationAngularRateAndOrientationMatrix) {
|
---|
[103] | 40 | Printf("Gx3_25_imu enabling AccelerationAngularRateAndOrientationMatrix\n");
|
---|
[102] | 41 | } else if (command == Quaternion) {
|
---|
[103] | 42 | Printf("Gx3_25_imu enabling Quaternion\n");
|
---|
[15] | 43 | } else {
|
---|
| 44 | Thread::Err("command not supported (%i)\n", command);
|
---|
| 45 | }
|
---|
| 46 | // AddDataToLog(imudata);
|
---|
[3] | 47 | }
|
---|
| 48 |
|
---|
| 49 | Gx3_25_imu::~Gx3_25_imu() {
|
---|
[15] | 50 | SafeStop();
|
---|
| 51 | Join();
|
---|
| 52 | delete pimpl_;
|
---|
[3] | 53 | }
|
---|
| 54 |
|
---|
[15] | 55 | void Gx3_25_imu::Run(void) { pimpl_->Run(); }
|
---|
[3] | 56 |
|
---|
| 57 | } // end namespace sensor
|
---|
| 58 | } // end namespace flair
|
---|
[268] | 59 |
|
---|
| 60 | #endif
|
---|