| 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: 2013/04/03
|
---|
| 6 | // filename: VrpnObject_impl.h
|
---|
| 7 | //
|
---|
| 8 | // author: César Richard, Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: objet vrpn
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #ifndef VRPNOBJECT_IMPL_H
|
---|
| 19 | #define VRPNOBJECT_IMPL_H
|
---|
| 20 |
|
---|
| 21 | #include <IODevice.h>
|
---|
| 22 | #include <string>
|
---|
| 23 | #include <stdint.h>
|
---|
| 24 | #include <vrpn_Tracker.h>
|
---|
| 25 | #include "Quaternion.h"
|
---|
| 26 |
|
---|
| 27 | namespace flair
|
---|
| 28 | {
|
---|
| 29 | namespace core
|
---|
| 30 | {
|
---|
| 31 | class cvmatrix;
|
---|
| 32 | class Vector3D;
|
---|
| 33 | class Euler;
|
---|
| 34 | }
|
---|
| 35 | namespace gui
|
---|
| 36 | {
|
---|
| 37 | class TabWidget;
|
---|
| 38 | class Tab;
|
---|
| 39 | class DataPlot1D;
|
---|
| 40 | }
|
---|
| 41 | namespace sensor
|
---|
| 42 | {
|
---|
| 43 | class VrpnClient;
|
---|
| 44 | class VrpnObject;
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | class VrpnObject_impl
|
---|
| 49 | {
|
---|
| 50 | friend class VrpnClient_impl;
|
---|
| 51 |
|
---|
| 52 | public:
|
---|
| 53 | VrpnObject_impl(flair::sensor::VrpnObject* self,const flair::sensor::VrpnClient *parent,std::string name,int id,const flair::gui::TabWidget* tab);
|
---|
| 54 | ~VrpnObject_impl(void);
|
---|
| 55 |
|
---|
| 56 | void mainloop(void);
|
---|
| 57 | void GetEuler(flair::core::Euler &euler);
|
---|
| 58 | void GetQuaternion(flair::core::Quaternion &quaternion);
|
---|
| 59 | void GetPosition(flair::core::Vector3D &point);
|
---|
| 60 | bool IsTracked(unsigned int timeout_ms);
|
---|
| 61 |
|
---|
| 62 | flair::gui::Tab* plot_tab;
|
---|
| 63 | flair::gui::DataPlot1D* x_plot;
|
---|
| 64 | flair::gui::DataPlot1D* y_plot;
|
---|
| 65 | flair::gui::DataPlot1D* z_plot;
|
---|
| 66 | flair::core::cvmatrix *output,*state;
|
---|
| 67 |
|
---|
| 68 | static void VRPN_CALLBACK handle_pos(void *userdata, const vrpn_TRACKERCB t);
|
---|
| 69 |
|
---|
| 70 | private:
|
---|
| 71 | flair::sensor::VrpnObject* self;
|
---|
| 72 | const flair::sensor::VrpnClient *parent;
|
---|
| 73 | vrpn_Tracker_Remote* tracker;
|
---|
| 74 | flair::core::Quaternion quaternion;//todo: quaternion should be included in the output to replace euler angles
|
---|
| 75 | void Update(void);
|
---|
| 76 | };
|
---|
| 77 |
|
---|
| 78 | #endif // VRPNOBJECT_IMPL_H
|
---|