Changeset 13 in flair-dev for trunk/include/FlairSensorActuator/VrpnObject.h
- Timestamp:
- Apr 8, 2016, 3:39:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/FlairSensorActuator/VrpnObject.h
r4 r13 6 6 * \file VrpnObject.h 7 7 * \brief Class for VRPN object 8 * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253 8 * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 9 * 7253 9 10 * \date 2013/04/03 10 11 * \version 4.0 … … 17 18 #include <stdint.h> 18 19 19 namespace flair 20 { 21 namespace core 22 { 23 class cvmatrix; 24 class Vector3D; 25 class Euler; 26 class Quaternion; 27 } 28 namespace gui 29 { 30 class TabWidget; 31 class Tab; 32 class DataPlot1D; 33 } 20 namespace flair { 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 } 34 32 } 35 33 … … 37 35 class VrpnClient_impl; 38 36 39 namespace flair 40 { 41 namespace sensor 42 { 43 class VrpnClient; 37 namespace flair { 38 namespace sensor { 39 class VrpnClient; 44 40 45 /*! \class VrpnObject 46 * 47 * \brief Class for VRPN object 48 */ 49 class VrpnObject: public core::IODevice 50 { 51 friend class ::VrpnObject_impl; 52 friend class ::VrpnClient_impl; 41 /*! \class VrpnObject 42 * 43 * \brief Class for VRPN object 44 */ 45 class VrpnObject : public core::IODevice { 46 friend class ::VrpnObject_impl; 47 friend class ::VrpnClient_impl; 53 48 54 public: 55 /*! 56 * \brief Constructor 57 * 58 * Construct a VrpnObject. Connection is done by IP. 59 * 60 * \param parent parent 61 * \param name VRPN object name, should be the same as defined in the server 62 * \param tab Tab for the user interface 63 */ 64 VrpnObject(const VrpnClient *parent,std::string name,const gui::TabWidget* tab); 49 public: 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); 65 61 66 /*! 67 * \brief Constructor 68 * 69 * Construct a VrpnObject. Connection is done by IP. 70 * 71 * \param parent parent 72 * \param name name 73 * \param id VRPN object id, should be the same as defined in the server 74 * \param tab Tab for the user interface 75 */ 76 VrpnObject(const VrpnClient *parent,std::string name,uint8_t id,const gui::TabWidget* tab); 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); 77 74 78 79 80 81 82 75 /*! 76 * \brief Destructor 77 * 78 */ 79 ~VrpnObject(void); 83 80 84 85 86 87 88 89 gui::Tab*GetPlotTab(void) const;81 /*! 82 * \brief Plot tab 83 * 84 * \return plot Tab 85 */ 86 gui::Tab *GetPlotTab(void) const; 90 87 91 92 93 94 95 96 88 /*! 89 * \brief Get Last Packet Time 90 * 91 * \return Time of last received packe 92 */ 93 core::Time GetLastPacketTime(void) const; 97 94 98 99 100 101 102 103 104 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; 105 102 106 107 108 109 110 111 103 /*! 104 * \brief Get Euler angles 105 * 106 * \param euler output datas 107 */ 108 void GetEuler(core::Euler &euler) const; 112 109 113 114 115 116 117 118 119 120 121 122 123 124 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; 125 122 126 127 128 129 130 131 132 133 134 135 136 137 138 139 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; 140 137 141 142 143 144 145 146 147 148 149 150 151 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; 152 149 153 154 155 156 157 158 gui::DataPlot1D*xPlot(void) const;150 /*! 151 * \brief x plot 152 * 153 * \return x plot 154 */ 155 gui::DataPlot1D *xPlot(void) const; 159 156 160 161 162 163 164 165 gui::DataPlot1D*yPlot(void) const;157 /*! 158 * \brief y plot 159 * 160 * \return y plot 161 */ 162 gui::DataPlot1D *yPlot(void) const; 166 163 167 168 169 170 171 172 gui::DataPlot1D*zPlot(void) const;164 /*! 165 * \brief z plot 166 * 167 * \return z plot 168 */ 169 gui::DataPlot1D *zPlot(void) const; 173 170 174 175 176 177 178 179 180 181 182 171 private: 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){}; 183 180 184 185 class VrpnObject_impl*pimpl_;186 181 void mainloop(void); 182 class VrpnObject_impl *pimpl_; 183 }; 187 184 } // end namespace sensor 188 185 } // end namespace flair
Note:
See TracChangeset
for help on using the changeset viewer.