Last change
on this file since 471 was 448, checked in by Sanahuja Guillaume, 3 years ago |
handle ack in vrpnlite
|
File size:
1.3 KB
|
Rev | Line | |
---|
[308] | 1 | // created: 2019/03/12
|
---|
| 2 | // filename: VrpnLite.h
|
---|
| 3 | //
|
---|
| 4 | // author: Guillaume Sanahuja
|
---|
| 5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 6 | //
|
---|
| 7 | // version: $Id: $
|
---|
| 8 | //
|
---|
| 9 | // purpose: vrpnlite, to forward it to bth for exemple
|
---|
| 10 | // usefull to reduce vrpn frame size
|
---|
| 11 | //
|
---|
| 12 | /*********************************************************************/
|
---|
| 13 |
|
---|
| 14 | #ifndef VRPNLITE_H
|
---|
| 15 | #define VRPNLITE_H
|
---|
| 16 |
|
---|
| 17 | #include <string>
|
---|
| 18 | #include <Thread.h>
|
---|
| 19 |
|
---|
| 20 | namespace flair {
|
---|
| 21 | namespace core {
|
---|
| 22 | class UdpSocket;
|
---|
| 23 | }
|
---|
[446] | 24 | namespace gui {
|
---|
| 25 | class PushButton;
|
---|
| 26 | }
|
---|
[308] | 27 | namespace sensor {
|
---|
| 28 | class VrpnClient;
|
---|
| 29 | class VrpnObject;
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | class VrpnLite: public flair::core::Thread {
|
---|
| 34 | public:
|
---|
[330] | 35 | VrpnLite(int vrpnLitePort,std::string vrpnServerAddress);
|
---|
[308] | 36 | ~VrpnLite();
|
---|
| 37 |
|
---|
| 38 | private:
|
---|
[448] | 39 | typedef struct {
|
---|
| 40 | std::vector<flair::sensor::VrpnObject*> vrpnobjects;
|
---|
| 41 | flair::core::Time lastAck;
|
---|
| 42 | uint16_t srcId;
|
---|
| 43 | } connection_t;
|
---|
[446] | 44 | flair::gui::PushButton* killButton;
|
---|
[308] | 45 | flair::sensor::VrpnClient* vrpnclient;
|
---|
[448] | 46 | std::vector<connection_t> connections;
|
---|
[308] | 47 | flair::core::UdpSocket* dataSocket;
|
---|
[448] | 48 | void Run(void);
|
---|
| 49 | void SendObjects(void) ;
|
---|
[330] | 50 | int16_t ConvertPosition(float value) const;
|
---|
| 51 | int16_t ConvertQuaternion(float value) const;
|
---|
[448] | 52 | connection_t* ConnectionOfSrcId(uint16_t srcId);
|
---|
[308] | 53 | };
|
---|
| 54 |
|
---|
| 55 | #endif // VRPNLITE_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.