source: flair-src/trunk/lib/FlairSensorActuator/src/VrpnObject.h @ 122

Last change on this file since 122 was 122, checked in by Sanahuja Guillaume, 5 years ago

modifs uav vrpn i686

File size: 3.4 KB
RevLine 
[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/*!
6 * \file VrpnObject.h
7 * \brief Class for VRPN object
[15]8 * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
9 * 7253
[3]10 * \date 2013/04/03
11 * \version 4.0
12 */
13
14#ifndef VRPNOBJECT_H
15#define VRPNOBJECT_H
[15]16
[3]17#include <IODevice.h>
18#include <stdint.h>
19
[15]20namespace flair {
[122]21        namespace core {
22                class cvmatrix;
23                class Vector3D;
24                class Euler;
25                class Quaternion;
26        }
27        namespace gui {
28                class TabWidget;
29                class Tab;
30                class DataPlot1D;
31        }
[3]32}
33
34class VrpnObject_impl;
35class VrpnClient_impl;
36
[15]37namespace flair {
38namespace sensor {
39class VrpnClient;
[3]40
[15]41/*! \class VrpnObject
42*
[122]43* \brief Class for VRPN object. The IODevice is created with
44*  the VrpnClient as parent. VrpnClient must be created before.
[15]45*/
46class VrpnObject : public core::IODevice {
47  friend class ::VrpnObject_impl;
48  friend class ::VrpnClient_impl;
[3]49
[15]50public:
51  /*!
52  * \brief Constructor
53  *
54  * Construct a VrpnObject. Connection is done by IP.
55  *
56  * \param name VRPN object name, should be the same as defined in the server
57  * \param tab Tab for the user interface
58  */
[122]59  VrpnObject(std::string name,
[15]60             const gui::TabWidget *tab);
[3]61
[15]62  /*!
63  * \brief Constructor
64  *
65  * Construct a VrpnObject. Connection is done by IP.
66  *
67  * \param name name
68  * \param id VRPN object id, should be the same as defined in the server
69  * \param tab Tab for the user interface
70  */
[122]71  VrpnObject(std::string name, uint8_t id,
[15]72             const gui::TabWidget *tab);
[3]73
[15]74  /*!
75  * \brief Destructor
76  *
77  */
78  ~VrpnObject(void);
[3]79
[15]80  /*!
81  * \brief Plot tab
82  *
83  * \return plot Tab
84  */
85  gui::Tab *GetPlotTab(void) const;
[3]86
[15]87  /*!
88  * \brief Get Last Packet Time
89  *
90  * \return Time of last received packe
91  */
92  core::Time GetLastPacketTime(void) const;
[3]93
[15]94  /*!
95  * \brief Is object tracked?
96  *
97  * \param timeout_ms timeout
98  * \return true if object is tracked during timeout_ms time
99  */
100  bool IsTracked(unsigned int timeout_ms) const;
[3]101
[15]102  /*!
103  * \brief Get Euler angles
104  *
105  * \param euler output datas
106  */
107  void GetEuler(core::Euler &euler) const;
[3]108
[15]109  /*!
110  * \brief Get Quaternion
111  *
112  * \param quaternion output datas
113  */
114  void GetQuaternion(core::Quaternion &quaternion) const;
115  /*!
116  * \brief Get Position
117  *
118  * \param point output datas
119  */
120  void GetPosition(core::Vector3D &point) const;
[3]121
[15]122  /*!
123  * \brief Output matrix
124  *
125  * Matrix is of type float and as follows: \n
126  * (0,0) roll (rad) \n
127  * (1,0) pitch (rad) \n
128  * (2,0) yaw (rad) \n
129  * (3,0) x \n
130  * (4,0) y \n
131  * (5,0) z \n
132  *
133  * \return Output metrix
134  */
135  core::cvmatrix *Output(void) const;
[3]136
[15]137  /*!
138  * \brief State matrix
139  *
140  * Matrix is of type float and as follows: \n
141  * (0,0) roll (deg) \n
142  * (1,0) pitch (deg) \n
143  * (2,0) yaw (deg) \n
144  *
145  * \return State metrix
146  */
147  core::cvmatrix *State(void) const;
[3]148
[15]149  /*!
150  * \brief x plot
151  *
152  * \return x plot
153  */
154  gui::DataPlot1D *xPlot(void) const;
[3]155
[15]156  /*!
157  * \brief y plot
158  *
159  * \return y plot
160  */
161  gui::DataPlot1D *yPlot(void) const;
[3]162
[15]163  /*!
164  * \brief z plot
165  *
166  * \return z plot
167  */
168  gui::DataPlot1D *zPlot(void) const;
169
170private:
171  /*!
172  * \brief Update using provided datas
173  *
174  * Reimplemented from IODevice.
175  *
176  * \param data data from the parent to process
177  */
178  void UpdateFrom(const core::io_data *data){};
179
180  void mainloop(void);
181  class VrpnObject_impl *pimpl_;
182};
[3]183} // end namespace sensor
184} // end namespace flair
[15]185#endif // VRPNOBJECT_H
Note: See TracBrowser for help on using the repository browser.