[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: 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
|
---|
[15] | 20 |
|
---|
[3] | 21 | #include <IODevice.h>
|
---|
| 22 | #include <string>
|
---|
| 23 | #include <stdint.h>
|
---|
| 24 | #include <vrpn_Tracker.h>
|
---|
| 25 | #include "Quaternion.h"
|
---|
| 26 |
|
---|
[15] | 27 | namespace flair {
|
---|
| 28 | namespace core {
|
---|
| 29 | class cvmatrix;
|
---|
| 30 | class Vector3D;
|
---|
| 31 | class Euler;
|
---|
[3] | 32 | }
|
---|
[15] | 33 | namespace gui {
|
---|
| 34 | class TabWidget;
|
---|
| 35 | class Tab;
|
---|
| 36 | class DataPlot1D;
|
---|
| 37 | }
|
---|
| 38 | namespace sensor {
|
---|
| 39 | class VrpnClient;
|
---|
| 40 | class VrpnObject;
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
[3] | 43 |
|
---|
[15] | 44 | class VrpnObject_impl {
|
---|
| 45 | friend class VrpnClient_impl;
|
---|
[3] | 46 |
|
---|
[15] | 47 | public:
|
---|
| 48 | VrpnObject_impl(flair::sensor::VrpnObject *self,
|
---|
| 49 | const flair::sensor::VrpnClient *parent, std::string name,
|
---|
| 50 | int id, const flair::gui::TabWidget *tab);
|
---|
| 51 | ~VrpnObject_impl(void);
|
---|
[3] | 52 |
|
---|
[15] | 53 | void mainloop(void);
|
---|
| 54 | void GetEuler(flair::core::Euler &euler);
|
---|
| 55 | void GetQuaternion(flair::core::Quaternion &quaternion);
|
---|
| 56 | void GetPosition(flair::core::Vector3D &point);
|
---|
| 57 | bool IsTracked(unsigned int timeout_ms);
|
---|
[3] | 58 |
|
---|
[15] | 59 | flair::gui::Tab *plot_tab;
|
---|
| 60 | flair::gui::DataPlot1D *x_plot;
|
---|
| 61 | flair::gui::DataPlot1D *y_plot;
|
---|
| 62 | flair::gui::DataPlot1D *z_plot;
|
---|
| 63 | flair::core::cvmatrix *output, *state;
|
---|
[3] | 64 |
|
---|
[15] | 65 | static void VRPN_CALLBACK handle_pos(void *userdata, const vrpn_TRACKERCB t);
|
---|
| 66 |
|
---|
| 67 | private:
|
---|
| 68 | flair::sensor::VrpnObject *self;
|
---|
| 69 | const flair::sensor::VrpnClient *parent;
|
---|
| 70 | vrpn_Tracker_Remote *tracker;
|
---|
| 71 | flair::core::Quaternion quaternion; // todo: quaternion should be included in
|
---|
| 72 | // the output to replace euler angles
|
---|
| 73 | void Update(void);
|
---|
| 74 | };
|
---|
| 75 |
|
---|
| 76 | #endif // VRPNOBJECT_IMPL_H
|
---|