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