[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: 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>
|
---|
[167] | 23 | #include "Vector3D.h"
|
---|
[3] | 24 |
|
---|
[15] | 25 | namespace flair {
|
---|
| 26 | namespace core {
|
---|
| 27 | class OneAxisRotation;
|
---|
| 28 | class Quaternion;
|
---|
| 29 | class Mutex;
|
---|
| 30 | class SerialPort;
|
---|
[309] | 31 | class UdpSocket;
|
---|
[3] | 32 | }
|
---|
[15] | 33 | namespace gui {
|
---|
| 34 | class TabWidget;
|
---|
| 35 | class Tab;
|
---|
| 36 | class Layout;
|
---|
| 37 | }
|
---|
| 38 | namespace sensor {
|
---|
| 39 | class VrpnClient;
|
---|
| 40 | class VrpnObject;
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
[3] | 43 |
|
---|
| 44 | class VrpnObject_impl;
|
---|
| 45 | class vrpn_Connection;
|
---|
| 46 |
|
---|
[15] | 47 | class VrpnClient_impl {
|
---|
| 48 | public:
|
---|
| 49 | VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
|
---|
[136] | 50 | std::string address);
|
---|
[15] | 51 | VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
|
---|
| 52 | flair::core::SerialPort *serialport, uint16_t us_period);
|
---|
[309] | 53 | VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
|
---|
| 54 | uint16_t port);
|
---|
[15] | 55 | ~VrpnClient_impl();
|
---|
[140] | 56 | void AddTrackable(VrpnObject_impl *obj); // normal
|
---|
[16] | 57 | void AddTrackable(VrpnObject_impl *obj, uint8_t id); // xbee
|
---|
[140] | 58 | void RemoveTrackable(VrpnObject_impl *obj); // normal+xbee
|
---|
[167] | 59 | void ComputeRotations(flair::core::Vector3Df &point);
|
---|
[15] | 60 | void ComputeRotations(flair::core::Quaternion &quat);
|
---|
| 61 | void Run(void);
|
---|
| 62 | flair::gui::Tab *setup_tab;
|
---|
| 63 | flair::gui::TabWidget *tab;
|
---|
| 64 | vrpn_Connection *connection;
|
---|
[309] | 65 | flair::sensor::VrpnClient::ConnectionType_t connectionType;
|
---|
[3] | 66 |
|
---|
[15] | 67 | private:
|
---|
[309] | 68 | void CommonConstructor(std::string name);
|
---|
[15] | 69 | flair::sensor::VrpnClient *self;
|
---|
| 70 | flair::core::Mutex *mutex;
|
---|
| 71 | uint16_t us_period;
|
---|
[140] | 72 | std::vector<VrpnObject_impl *> trackables;
|
---|
[309] | 73 | typedef struct liteObject_t {
|
---|
[15] | 74 | VrpnObject_impl *vrpnobject;
|
---|
| 75 | uint8_t id;
|
---|
[309] | 76 | } liteObject_t;
|
---|
[3] | 77 |
|
---|
[309] | 78 | std::vector<liteObject_t> liteObjects;
|
---|
[15] | 79 | flair::gui::Tab *main_tab;
|
---|
| 80 | flair::core::OneAxisRotation *rotation_1, *rotation_2;
|
---|
| 81 | flair::core::SerialPort *serialport;
|
---|
[136] | 82 | bool isConnected;//only for ip connection, not for xbee
|
---|
[294] | 83 | std::string address;
|
---|
[309] | 84 | flair::core::UdpSocket* dataSocket;
|
---|
| 85 |
|
---|
[3] | 86 | };
|
---|
| 87 |
|
---|
| 88 | #endif // VRPNCLIENT_IMPL_H
|
---|