Changeset 15 in flair-src for trunk/lib/FlairFilter/src/JoyReference.h
- Timestamp:
- 04/08/16 15:40:57 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairFilter/src/JoyReference.h
r10 r15 17 17 #include <stdint.h> 18 18 19 namespace flair 20 { 21 namespace core { 22 class Quaternion; 23 class AhrsData; 24 } 25 namespace gui { 26 class LayoutPosition; 27 } 19 namespace flair { 20 namespace core { 21 class Quaternion; 22 class AhrsData; 28 23 } 24 namespace gui { 25 class LayoutPosition; 26 } 27 } 29 28 30 29 class JoyReference_impl; 31 30 32 namespace flair { namespace filter { 33 /*! \class JoyReference 34 * 35 * \brief Class creating references from a joystick 36 */ 37 class JoyReference : public core::IODevice 38 { 39 public: 40 /*! 41 * \brief Constructor 42 * 43 * Construct a JoyReference at given position. \n 44 * The JoyReference will automatically be child of position->getLayout() Layout. After calling this function, 45 * position will be deleted as it is no longer usefull. \n 46 * JoyReference compute reference in quaternion, wz, altitude and altitude speed. 47 * 48 * \param position position 49 * \param name name 50 */ 51 JoyReference(const gui::LayoutPosition* position,std::string name); 52 53 /*! 54 * \brief Destructor 55 * 56 */ 57 ~JoyReference(); 58 59 /*! 60 * \brief Set roll axis value 61 * 62 * \param value value 63 */ 64 void SetRollAxis(float value); 65 66 /*! 67 * \brief Set pitch axis value 68 * 69 * \param value value 70 */ 71 void SetPitchAxis(float value); 72 73 /*! 74 * \brief Set yaw axis value 75 * 76 * \param value value 77 */ 78 void SetYawAxis(float value); 79 80 /*! 81 * \brief Set thrust axis value 82 * 83 * \param value value 84 */ 85 void SetAltitudeAxis(float value); 86 87 /*! 88 * \brief Get orientation reference 89 * 90 * \return reference 91 */ 92 core::AhrsData* GetReferenceOrientation(void) const; 93 94 /*! 95 * \brief Get z reference 96 * 97 * \return reference 98 */ 99 float ZRef(void) const; 100 101 /*! 102 * \brief Get z derivative reference 103 * 104 * \return reference 105 */ 106 float DzRef(void) const; 107 108 /*! 109 * \brief Get roll trim 110 * 111 * \return trim value 112 */ 113 float RollTrim(void) const; 114 115 /*! 116 * \brief Get pitch trim 117 * 118 * \return trim value 119 */ 120 float PitchTrim(void) const; 121 122 /*! 123 * \brief Set yaw reference 124 * 125 * Yaw part of the output quaternion is obtained by integrating the wz desired angular speed.\n 126 * This method reset the yaw. 127 * 128 * \param value value 129 */ 130 void SetYawRef(float value); 131 132 /*! 133 * \brief Set yaw reference 134 * 135 * Yaw part of the output quaternion is obtained by integrating the wz desired angular speed.\n 136 * This method reset the yaw. 137 * 138 * \param value value, only the yaw part of the quaternion is used 139 */ 140 void SetYawRef(core::Quaternion const &value); 141 142 /*! 143 * \brief Set z reference 144 * 145 * Altitude of the output is obtained by integrating the vz desired altitude speed.\n 146 * This method reset z. 147 * 148 * \param value value 149 */ 150 void SetZRef(float value); 151 152 /*! 153 * \brief Trim up roll 154 * 155 * Roll trim value is increased by one 156 */ 157 void RollTrimUp(void); 158 159 /*! 160 * \brief Trim down roll 161 * 162 * Roll trim value is decreased by one 163 */ 164 void RollTrimDown(void); 165 166 /*! 167 * \brief Trim up pitch 168 * 169 * Pitch trim value is increased by one 170 */ 171 void PitchTrimUp(void); 172 173 /*! 174 * \brief Trim down pitch 175 * 176 * Pitch trim value is decreased by one 177 */ 178 void PitchTrimDown(void); 179 180 /*! 181 * \brief Update references 182 * 183 * Calls UpdateFrom with values entered manually. 184 * 185 * \param time time 186 */ 187 void Update(core::Time time); 188 189 private: 190 /*! 191 * \brief Update using provided datas 192 * 193 * Reimplemented from IODevice. 194 * 195 * \param data data from the parent to process 196 */ 197 void UpdateFrom(const core::io_data *data); 198 199 class JoyReference_impl* pimpl_; 200 }; 31 namespace flair { 32 namespace filter { 33 /*! \class JoyReference 34 * 35 * \brief Class creating references from a joystick 36 */ 37 class JoyReference : public core::IODevice { 38 public: 39 /*! 40 * \brief Constructor 41 * 42 * Construct a JoyReference at given position. \n 43 * The JoyReference will automatically be child of position->getLayout() 44 *Layout. After calling this function, 45 * position will be deleted as it is no longer usefull. \n 46 * JoyReference compute reference in quaternion, wz, altitude and altitude 47 *speed. 48 * 49 * \param position position 50 * \param name name 51 */ 52 JoyReference(const gui::LayoutPosition *position, std::string name); 53 54 /*! 55 * \brief Destructor 56 * 57 */ 58 ~JoyReference(); 59 60 /*! 61 * \brief Set roll axis value 62 * 63 * \param value value 64 */ 65 void SetRollAxis(float value); 66 67 /*! 68 * \brief Set pitch axis value 69 * 70 * \param value value 71 */ 72 void SetPitchAxis(float value); 73 74 /*! 75 * \brief Set yaw axis value 76 * 77 * \param value value 78 */ 79 void SetYawAxis(float value); 80 81 /*! 82 * \brief Set thrust axis value 83 * 84 * \param value value 85 */ 86 void SetAltitudeAxis(float value); 87 88 /*! 89 * \brief Get orientation reference 90 * 91 * \return reference 92 */ 93 core::AhrsData *GetReferenceOrientation(void) const; 94 95 /*! 96 * \brief Get z reference 97 * 98 * \return reference 99 */ 100 float ZRef(void) const; 101 102 /*! 103 * \brief Get z derivative reference 104 * 105 * \return reference 106 */ 107 float DzRef(void) const; 108 109 /*! 110 * \brief Get roll trim 111 * 112 * \return trim value 113 */ 114 float RollTrim(void) const; 115 116 /*! 117 * \brief Get pitch trim 118 * 119 * \return trim value 120 */ 121 float PitchTrim(void) const; 122 123 /*! 124 * \brief Set yaw reference 125 * 126 * Yaw part of the output quaternion is obtained by integrating the wz desired 127 *angular speed.\n 128 * This method reset the yaw. 129 * 130 * \param value value 131 */ 132 void SetYawRef(float value); 133 134 /*! 135 * \brief Set yaw reference 136 * 137 * Yaw part of the output quaternion is obtained by integrating the wz desired 138 *angular speed.\n 139 * This method reset the yaw. 140 * 141 * \param value value, only the yaw part of the quaternion is used 142 */ 143 void SetYawRef(core::Quaternion const &value); 144 145 /*! 146 * \brief Set z reference 147 * 148 * Altitude of the output is obtained by integrating the vz desired altitude 149 *speed.\n 150 * This method reset z. 151 * 152 * \param value value 153 */ 154 void SetZRef(float value); 155 156 /*! 157 * \brief Trim up roll 158 * 159 * Roll trim value is increased by one 160 */ 161 void RollTrimUp(void); 162 163 /*! 164 * \brief Trim down roll 165 * 166 * Roll trim value is decreased by one 167 */ 168 void RollTrimDown(void); 169 170 /*! 171 * \brief Trim up pitch 172 * 173 * Pitch trim value is increased by one 174 */ 175 void PitchTrimUp(void); 176 177 /*! 178 * \brief Trim down pitch 179 * 180 * Pitch trim value is decreased by one 181 */ 182 void PitchTrimDown(void); 183 184 /*! 185 * \brief Update references 186 * 187 * Calls UpdateFrom with values entered manually. 188 * 189 * \param time time 190 */ 191 void Update(core::Time time); 192 193 private: 194 /*! 195 * \brief Update using provided datas 196 * 197 * Reimplemented from IODevice. 198 * 199 * \param data data from the parent to process 200 */ 201 void UpdateFrom(const core::io_data *data); 202 203 class JoyReference_impl *pimpl_; 204 }; 201 205 } // end namespace sensor 202 206 } // end namespace flair
Note:
See TracChangeset
for help on using the changeset viewer.