source: flair-src/trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h@ 332

Last change on this file since 332 was 332, checked in by Sanahuja Guillaume, 2 years ago

modif vrpn lite

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