source: flair-dev/trunk/include/FlairSensorActuator/VrpnObject.h @ 13

Last change on this file since 13 was 13, checked in by Bayard Gildas, 5 years ago

formatting script + include reformatted

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