[3] | 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: VrpnClient_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 se connectant au serveur vrpn
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #ifndef VRPNCLIENT_IMPL_H
|
---|
| 19 | #define VRPNCLIENT_IMPL_H
|
---|
| 20 |
|
---|
| 21 | #include <string>
|
---|
| 22 | #include <vector>
|
---|
| 23 |
|
---|
| 24 | namespace flair
|
---|
| 25 | {
|
---|
| 26 | namespace core
|
---|
| 27 | {
|
---|
| 28 | class OneAxisRotation;
|
---|
| 29 | class Vector3D;
|
---|
| 30 | class Quaternion;
|
---|
| 31 | class Mutex;
|
---|
| 32 | class SerialPort;
|
---|
| 33 | }
|
---|
| 34 | namespace gui
|
---|
| 35 | {
|
---|
| 36 | class TabWidget;
|
---|
| 37 | class Tab;
|
---|
| 38 | class Layout;
|
---|
| 39 | }
|
---|
| 40 | namespace sensor
|
---|
| 41 | {
|
---|
| 42 | class VrpnClient;
|
---|
| 43 | class VrpnObject;
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | class VrpnObject_impl;
|
---|
| 48 | class vrpn_Connection;
|
---|
| 49 |
|
---|
| 50 | class VrpnClient_impl
|
---|
| 51 | {
|
---|
| 52 | public:
|
---|
| 53 | VrpnClient_impl(flair::sensor::VrpnClient* self,std::string name,std::string address,uint16_t us_period);
|
---|
| 54 | VrpnClient_impl(flair::sensor::VrpnClient* self,std::string name,flair::core::SerialPort* serialport,uint16_t us_period);
|
---|
| 55 | ~VrpnClient_impl();
|
---|
| 56 | void AddTrackable(flair::sensor::VrpnObject* obj);//normal
|
---|
| 57 | void RemoveTrackable(flair::sensor::VrpnObject* obj);//normal
|
---|
| 58 | void AddTrackable(VrpnObject_impl* obj,uint8_t id);//xbee
|
---|
| 59 | void RemoveTrackable(VrpnObject_impl* obj);//xbee
|
---|
| 60 | void ComputeRotations(flair::core::Vector3D& point);
|
---|
| 61 | void ComputeRotations(flair::core::Quaternion& quat);
|
---|
| 62 | bool UseXbee(void);
|
---|
| 63 | void Run(void);
|
---|
| 64 | flair::gui::Tab* setup_tab;
|
---|
| 65 | flair::gui::TabWidget* tab;
|
---|
| 66 | vrpn_Connection *connection;
|
---|
| 67 |
|
---|
| 68 | private:
|
---|
| 69 | flair::sensor::VrpnClient* self;
|
---|
| 70 | flair::core::Mutex* mutex;
|
---|
| 71 | uint16_t us_period;
|
---|
| 72 | std::vector<flair::sensor::VrpnObject*> trackables;
|
---|
| 73 | typedef struct xbee_object{
|
---|
| 74 | VrpnObject_impl* vrpnobject;
|
---|
| 75 | uint8_t id;
|
---|
| 76 | } xbee_object;
|
---|
| 77 |
|
---|
| 78 | std::vector<xbee_object> xbee_objects;
|
---|
| 79 | flair::gui::Tab* main_tab;
|
---|
| 80 | flair::core::OneAxisRotation *rotation_1,*rotation_2;
|
---|
| 81 | flair::core::SerialPort* serialport;
|
---|
| 82 | };
|
---|
| 83 |
|
---|
| 84 | #endif // VRPNCLIENT_IMPL_H
|
---|