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

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

improved vprnobject added to vrpnclient

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