Changeset 50 in flair-dev for trunk/include
- Timestamp:
- May 31, 2017, 3:54:26 PM (8 years ago)
- Location:
- trunk/include
- Files:
-
- 1 added
- 79 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/FlairCore/AhrsData.h
r13 r50 121 121 * 122 122 */ 123 void SetAngularRates(const Vector3D &angularRates);123 void SetAngularRates(const Vector3Df &angularRates); 124 124 125 125 /*! … … 131 131 * 132 132 */ 133 Vector3D GetAngularRates(void) const;133 Vector3Df GetAngularRates(void) const; 134 134 135 135 /*! … … 143 143 */ 144 144 void GetQuaternionAndAngularRates(Quaternion &quaternion, 145 Vector3D &angularRates) const;145 Vector3Df &angularRates) const; 146 146 147 147 /*! … … 155 155 */ 156 156 void SetQuaternionAndAngularRates(const Quaternion &quaternion, 157 const Vector3D &angularRates);157 const Vector3Df &angularRates); 158 158 159 159 const Type &GetDataType() const { return dataType; } … … 182 182 * 183 183 */ 184 Vector3D angularRates;184 Vector3Df angularRates; 185 185 186 186 Type dataType; -
trunk/include/FlairCore/GpsData.h
r30 r50 19 19 20 20 class IODataElement; 21 class Vector3D;22 21 23 22 /*! \class GpsData … … 42 41 size += UInt8Type.GetSize(); // FixQuality_t 43 42 size += 5*floatType.GetSize();//e,n,u,ve,vn 43 size += 3*floatType.GetSize();//pdop,hdop,vdop 44 44 return size; 45 45 } … … 63 63 EastVelocity /*! east velocity*/, 64 64 NorthVelocity /*! north velocity*/, 65 Pdop /* dilution of precision*/, 66 Hdop /* horizontal dilution of precision*/, 67 Vdop /* vertical dilution of precision*/, 65 68 } PlotableData_t; 66 69 … … 215 218 */ 216 219 void SetFixQuality(FixQuality_t fixQuality); 220 221 /*! 222 * \brief Get dilution of precision 223 * 224 * This method is mutex protected. 225 * 226 * \param pDop dilution of precision 227 * \param hDop horizontal dilution of precision 228 * \param vDop vertical dilution of precision 229 * 230 */ 231 void GetDop(float &pDop, float &hDop,float &vDop) const; 232 233 /*! 234 * \brief Set dilution of precision 235 * 236 * This method is mutex protected. 237 * 238 * \param pDop dilution of precision 239 * \param hDop horizontal dilution of precision 240 * \param vDop vertical dilution of precision 241 * 242 */ 243 void SetDop(float pDop, float hDop,float vDop); 217 244 218 245 Type const &GetDataType() const { return dataType; } … … 235 262 uint8_t numberOfSatellites; 236 263 FixQuality_t fixQuality; 237 float east,north,up,eastVelocity,northVelocity ;264 float east,north,up,eastVelocity,northVelocity,pDop,hDop,vDop; 238 265 }; 239 266 -
trunk/include/FlairCore/I2cPort.h
r13 r50 95 95 }; 96 96 } // end namespace core 97 } // end namespace f ramework97 } // end namespace flair 98 98 99 99 #endif // I2CPORT_H -
trunk/include/FlairCore/IODataElement.h
r13 r50 56 56 57 57 } // end namespace core 58 } // end namespace f ramework58 } // end namespace flair 59 59 60 60 #endif // IODATAELEMENT_H -
trunk/include/FlairCore/IODevice.h
r44 r50 110 110 */ 111 111 void OutputToShMem(bool enabled); 112 113 /*! 114 * \brief is device ready 115 * 116 * Use it check if a device is ready or not. 117 * See also setIsReady. 118 * 119 * \return true if device is ready 120 */ 121 bool IsReady(void) const; 112 122 113 123 // TODO: these 2 method should be pure virtual … … 115 125 virtual DataType const &GetOutputDataType() const; 116 126 117 protected: 118 /*! 119 * \brief Process the childs of type IODevice, and log if needed 120 * 121 * This method must be called after computing datas; 122 * generally at the end of the reimplemented UpdateFrom or after acquiring datas in case of a sensor. \n 123 * It will call UpdateFrom methods of each child of type IODevice, 124 * and log all datas (this IODevice and its childs) 125 * if logging is enabled (see SetDataToLog(), AddDeviceToLog(), 126 * FrameworkManager::StartLog and FrameworkManager::AddDeviceToLog). \n 127 * If a thread is waiting on this IODevice (see Thread::WaitUpdate), it will be resumed. 128 * 129 * \param data data to process 130 */ 131 void ProcessUpdate(io_data* data); 127 protected: 128 /*! 129 * \brief Process the childs of type IODevice, and log if needed 130 * 131 * This method must be called after computing datas; 132 * generally at the end of the reimplemented UpdateFrom or after acquiring datas in case of a sensor. \n 133 * It will call UpdateFrom methods of each child of type IODevice, 134 * and log all datas (this IODevice and its childs) 135 * if logging is enabled (see SetDataToLog(), AddDeviceToLog(), 136 * FrameworkManager::StartLog and FrameworkManager::AddDeviceToLog). \n 137 * If a thread is waiting on this IODevice (see Thread::WaitUpdate), it will be resumed. 138 * 139 * \param data data to process 140 */ 141 void ProcessUpdate(io_data* data); 142 143 /*! 144 * \brief set is ready 145 * 146 * Sets if the device is ready or not. By default the IODevice is not ready.\n 147 * See also isReady. 148 * 149 * \param status status 150 */ 151 void SetIsReady(bool status); 132 152 133 153 private: -
trunk/include/FlairCore/ImuData.h
r13 r50 104 104 * 105 105 */ 106 Vector3D GetRawAcc(void) const;106 Vector3Df GetRawAcc(void) const; 107 107 108 108 /*! … … 114 114 * 115 115 */ 116 Vector3D GetRawMag(void) const;116 Vector3Df GetRawMag(void) const; 117 117 118 118 /*! … … 124 124 * 125 125 */ 126 Vector3D GetRawGyr(void) const;126 Vector3Df GetRawGyr(void) const; 127 127 128 128 /*! … … 136 136 * 137 137 */ 138 void GetRawAccMagAndGyr(Vector3D &rawAcc, Vector3D&rawMag,139 Vector3D &rawGyr) const;138 void GetRawAccMagAndGyr(Vector3Df &rawAcc, Vector3Df &rawMag, 139 Vector3Df &rawGyr) const; 140 140 141 141 /*! … … 147 147 * 148 148 */ 149 void SetRawAcc(const Vector3D &rawAcc);149 void SetRawAcc(const Vector3Df &rawAcc); 150 150 151 151 /*! … … 157 157 * 158 158 */ 159 void SetRawMag(const Vector3D &rawMag);159 void SetRawMag(const Vector3Df &rawMag); 160 160 161 161 /*! … … 167 167 * 168 168 */ 169 void SetRawGyr(const Vector3D &rawGyr);169 void SetRawGyr(const Vector3Df &rawGyr); 170 170 171 171 /*! … … 179 179 * 180 180 */ 181 void SetRawAccMagAndGyr(const Vector3D &rawAcc, const Vector3D&rawMag,182 const Vector3D &rawGyr);181 void SetRawAccMagAndGyr(const Vector3Df &rawAcc, const Vector3Df &rawMag, 182 const Vector3Df &rawGyr); 183 183 184 184 Type const &GetDataType() const { return dataType; } … … 199 199 * 200 200 */ 201 Vector3D rawAcc;201 Vector3Df rawAcc; 202 202 203 203 /*! … … 205 205 * 206 206 */ 207 Vector3D rawGyr;207 Vector3Df rawGyr; 208 208 209 209 /*! … … 211 211 * 212 212 */ 213 Vector3D rawMag;213 Vector3Df rawMag; 214 214 215 215 void Queue(char **dst, const void *src, size_t size) const; -
trunk/include/FlairCore/OneAxisRotation.h
r13 r50 15 15 16 16 #include <GroupBox.h> 17 #include <Vector3D.h> 17 18 18 19 class OneAxisRotation_impl; … … 24 25 25 26 namespace core { 26 class Vector3D;27 27 class Euler; 28 28 class Quaternion; … … 57 57 * \brief Compute rotation 58 58 * 59 * \param vector Vector3D to rotate59 * \param vector Vector3Df to rotate 60 60 */ 61 void ComputeRotation(core::Vector3D&vector) const;61 template <typename T> void ComputeRotation(core::Vector3D<T> &vector) const; 62 62 63 63 /*! … … 81 81 */ 82 82 void ComputeRotation(core::RotationMatrix &matrix) const; 83 84 /*! 85 * \brief Get angle 86 * 87 * \return angle in radians 88 */ 89 float GetAngle() const; 90 int GetAxis() const; 83 91 84 92 private: -
trunk/include/FlairCore/Quaternion.h
r13 r50 13 13 #define QUATERNION_H 14 14 15 #include <Vector3D.h> 16 15 17 namespace flair { 16 18 namespace core { 17 19 class Euler; 18 class Vector3D;19 20 class RotationMatrix; 20 21 … … 62 63 * \param logarithm output logarithm 63 64 */ 64 void GetLogarithm(Vector3D &logarithm);65 void GetLogarithm(Vector3Df &logarithm); 65 66 66 67 /*! … … 71 72 * \return output logarithm 72 73 */ 73 Vector3D GetLogarithm(void);74 Vector3Df GetLogarithm(void); 74 75 75 76 /*! … … 92 93 * \return derivative 93 94 */ 94 Quaternion GetDerivative(const Vector3D &angularSpeed) const;95 Quaternion GetDerivative(const Vector3Df &angularSpeed) const; 95 96 96 97 /*! … … 99 100 * \param w rotationonal speed 100 101 */ 101 void Derivate(const Vector3D &angularSpeed);102 void Derivate(const Vector3Df &angularSpeed); 102 103 103 104 /*! -
trunk/include/FlairCore/SerialPort.h
r13 r50 85 85 }; 86 86 } // end namespace core 87 } // end namespace f ramework87 } // end namespace flair 88 88 89 89 #endif // SERIALPORT_H -
trunk/include/FlairCore/SharedMem.h
r13 r50 32 32 class SharedMem : public Object { 33 33 public: 34 enum class Type { mutex, producerConsumer }; 34 35 /*! 35 36 * \brief Constructor … … 40 41 * \param name name 41 42 * \param size size of the shared memory 43 * \param blockOnRead if true reading will block if nothing written 42 44 */ 43 SharedMem(const Object *parent, std::string name, size_t size );45 SharedMem(const Object *parent, std::string name, size_t size, Type type=Type::mutex); 44 46 45 47 /*! … … 65 67 void Read(char *buf, size_t size) const; 66 68 69 70 /*! 71 * \brief This function should be called when reader starts (in case of a SharedMem of type producerConsumer) 72 */ 73 void ReaderReady(); 67 74 private: 68 75 SharedMem_impl *pimpl_; 76 Type type; 69 77 }; 70 78 -
trunk/include/FlairCore/Thread.h
r13 r50 176 176 */ 177 177 bool IsSuspended(void) const; 178 179 /*! 180 * \brief Is the thread running? 181 * 182 * \return true if thread is running (call to Start). A suspended thread is running. 183 * 184 */ 185 bool IsRunning(void) const; 178 186 179 187 /*! -
trunk/include/FlairCore/Vector2D.h
r13 r50 21 21 * \brief Class defining a 2D vector 22 22 */ 23 template <typename T> 23 24 class Vector2D { 24 25 public: … … 31 32 * \param y 32 33 */ 33 Vector2D( float x = 0, floaty = 0);34 Vector2D(T x = 0, T y = 0); 34 35 35 36 /*! … … 73 74 * \param max maximum Vector2D value 74 75 */ 75 void Saturate(Vector2D min, Vector2Dmax);76 void Saturate(Vector2D<T> min, Vector2D<T> max); 76 77 77 78 /*! … … 92 93 * \param value saturation Vector2D value 93 94 */ 94 void Saturate(const Vector2D &value);95 void Saturate(const Vector2D<T> &value); 95 96 96 97 /*! … … 106 107 * \brief x 107 108 */ 108 floatx;109 T x; 109 110 110 111 /*! 111 112 * \brief y 112 113 */ 113 floaty;114 T y; 114 115 115 Vector2D &operator=(const Vector2D &vector); 116 template<typename S> Vector2D<T> &operator=(const Vector2D<S> &vector) { 117 x = vector.x; 118 y = vector.y; 119 return (*this); 120 } 121 Vector2D<T> &operator+=(const Vector2D<T> &vector); 122 Vector2D<T> &operator-=(const Vector2D<T> &vector); 116 123 }; 124 125 typedef Vector2D<float> Vector2Df; 117 126 118 127 /*! Add … … 123 132 * \param vectorB vector 124 133 */ 125 Vector2D operator+(const Vector2D &vectorA, const Vector2D&vectorB);134 template<typename T> Vector2D<T> operator+(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB); 126 135 127 136 /*! Substract … … 132 141 * \param vectorB vector 133 142 */ 134 Vector2D operator-(const Vector2D &vectorA, const Vector2D &vectorB); 143 template<typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB); 144 145 /*! Opposite 146 * 147 * \brief Opposite 148 * 149 * \param vectorA vector 150 * 151 * \return -vectorA 152 */ 153 template<typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA); 135 154 136 155 /*! Divid … … 142 161 * \return vector/coefficient 143 162 */ 144 Vector2D operator/(const Vector2D&vector, float coeff);163 template<typename T> Vector2D<T> operator/(const Vector2D<T> &vector, float coeff); 145 164 146 165 /*! Multiply … … 152 171 * \return coefficient*vector 153 172 */ 154 Vector2D operator*(const Vector2D&vector, float coeff);173 template<typename T> Vector2D<T> operator*(const Vector2D<T> &vector, float coeff); 155 174 156 175 /*! Multiply … … 162 181 * \return coefficient*vector 163 182 */ 164 Vector2D operator*(float coeff, const Vector2D&vector);183 template<typename T> Vector2D<T> operator*(float coeff, const Vector2D<T> &vector); 165 184 166 185 } // end namespace core -
trunk/include/FlairCore/Vector3D.h
r13 r50 15 15 16 16 #include <stddef.h> 17 #include <Vector2D.h> 17 18 18 19 namespace flair { 19 20 namespace core { 20 class Vector2D;21 21 class RotationMatrix; 22 22 class Quaternion; … … 26 26 * \brief Class defining a 3D vector 27 27 */ 28 template <typename T> 28 29 class Vector3D { 29 30 public: … … 37 38 * \param z 38 39 */ 39 Vector3D( float x = 0, float y = 0, floatz = 0);40 Vector3D(T x = 0, T y = 0, T z = 0); 40 41 41 42 /*! … … 48 49 * \brief x 49 50 */ 50 floatx;51 T x; 51 52 52 53 /*! 53 54 * \brief y 54 55 */ 55 floaty;56 T y; 56 57 57 58 /*! 58 59 * \brief z 59 60 */ 60 floatz;61 T z; 61 62 62 63 /*! … … 126 127 * \param vector destination 127 128 */ 128 void To2Dxy(Vector2D &vector) const;129 void To2Dxy(Vector2D<T> &vector) const; 129 130 130 131 /*! … … 135 136 * \return destination 136 137 */ 137 Vector2D To2Dxy(void) const;138 Vector2D<T> To2Dxy(void) const; 138 139 139 140 /*! … … 157 158 * \param max maximum value 158 159 */ 159 void Saturate(const Vector3D &min, const Vector3D&max);160 void Saturate(const Vector3D<T> &min, const Vector3D<T> &max); 160 161 161 162 /*! … … 176 177 * \param value saturation Vector3D value 177 178 */ 178 void Saturate(const Vector3D &value);179 void Saturate(const Vector3D<T> &value); 179 180 180 181 /*! … … 188 189 void Saturate(float value); 189 190 190 float &operator[](size_t idx); 191 const float &operator[](size_t idx) const; 192 Vector3D &operator=(const Vector3D &vector); 193 Vector3D &operator+=(const Vector3D &vector); 194 Vector3D &operator-=(const Vector3D &vector); 191 T &operator[](size_t idx); 192 const T &operator[](size_t idx) const; 193 //Vector3D<T> &operator=(const Vector3D<T> &vector); 194 template<typename S> Vector3D<T> &operator=(const Vector3D<S> &vector) { 195 x = vector.x; 196 y = vector.y; 197 z = vector.z; 198 return (*this); 199 } 200 Vector3D<T> &operator+=(const Vector3D<T> &vector); 201 Vector3D<T> &operator-=(const Vector3D<T> &vector); 195 202 196 203 private: 197 204 }; 198 205 206 typedef Vector3D<float> Vector3Df; 207 199 208 /*! Add 200 209 * … … 206 215 * \return vectorA+vectorB 207 216 */ 208 Vector3D operator+(const Vector3D &vectorA, const Vector3D&vectorB);217 template<typename T> Vector3D<T> operator+(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB); 209 218 210 219 /*! Substract … … 217 226 * \return vectorA-vectorB 218 227 */ 219 Vector3D operator-(const Vector3D &vectorA, const Vector3D&vectorB);228 template<typename T> Vector3D<T> operator-(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB); 220 229 221 230 /*! Minus … … 227 236 * \return -vector 228 237 */ 229 Vector3D operator-(const Vector3D&vector);238 template<typename T> Vector3D<T> operator-(const Vector3D<T> &vector); 230 239 231 240 /*! Divid … … 238 247 * \return vector/coefficient 239 248 */ 240 Vector3D operator/(const Vector3D&vector, float coeff);249 template<typename T> Vector3D<T> operator/(const Vector3D<T> &vector, float coeff); 241 250 242 251 /*! Hadamard product … … 249 258 * \return Hadamard product 250 259 */ 251 Vector3D operator*(const Vector3D &vectorA, const Vector3D&vectorB);260 template<typename T> Vector3D<T> operator*(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB); 252 261 253 262 /*! Multiply … … 260 269 * \return coefficient*vector 261 270 */ 262 Vector3D operator*(const Vector3D&vector, float coeff);271 template<typename T> Vector3D<T> operator*(const Vector3D<T> &vector, float coeff); 263 272 264 273 /*! Multiply … … 271 280 * \return coefficient*vector 272 281 */ 273 Vector3D operator*(float coeff, const Vector3D&vector);282 template<typename T> Vector3D<T> operator*(float coeff, const Vector3D<T> &vector); 274 283 275 284 /*! Cross product … … 282 291 * \return cross product 283 292 */ 284 Vector3D CrossProduct(const Vector3D &vectorA, const Vector3D&vectorB);293 template<typename T> Vector3D<T> CrossProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB); 285 294 286 295 /*! Dot product … … 293 302 * \return dot product 294 303 */ 295 float DotProduct(const Vector3D &vectorA, const Vector3D&vectorB);304 template<typename T> float DotProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB); 296 305 297 306 } // end namespace core -
trunk/include/FlairCore/Vector3DSpinBox.h
r13 r50 44 44 Vector3DSpinBox(const LayoutPosition *position, std::string name, double min, 45 45 double max, double step, int decimals = 2, 46 core::Vector3D default_value = core::Vector3D(0, 0, 0));46 core::Vector3Df default_value = core::Vector3Df(0, 0, 0)); 47 47 48 48 /*! … … 57 57 * \return value 58 58 */ 59 core::Vector3D Value(void) const;59 core::Vector3Df Value(void) const; 60 60 // operator core::Vector3D() const; 61 61 private: … … 68 68 void XmlEvent(void); 69 69 70 core::Vector3D box_value;70 core::Vector3Df box_value; 71 71 }; 72 72 -
trunk/include/FlairCore/Vector3Ddata.h
r13 r50 26 26 * User must manually use the io_data's Mutex to access to Vector3D values. 27 27 */ 28 class Vector3Ddata : public io_data, public Vector3D {28 class Vector3Ddata : public io_data, public Vector3Df { 29 29 public: 30 30 /*! -
trunk/include/FlairCore/cvmatrix.h
r13 r50 55 55 * Construct an io_data representing a CvMat. \n 56 56 * It uses a cvmatrix_descriptor to get size and elements' names. \n 57 * Names are used for graphs and logs. 57 * Names are used for graphs and logs. \n 58 * All values are initialized to 0. 58 59 * 59 60 * \param parent parent 60 * \param descriptor matrix description 61 * \param descriptor matrix description, it is safe to destroy it after calling this constructor 61 62 * \param type type of matrix elements 62 63 * \param name name … … 71 72 * 72 73 * Construct an io_data representing a CvMat. \n 73 * Elements are unamed. 74 * Elements are unamed. \n 75 * All values are initialized to 0. 74 76 * 75 77 * \param parent parent -
trunk/include/FlairFilter/Ahrs.h
r32 r50 19 19 namespace flair { 20 20 namespace core { 21 class Euler;22 class Vector3D;23 class ImuData;24 class Quaternion;25 21 class AhrsData; 26 22 } … … 174 170 /*! 175 171 * \brief Get ahrs datas 176 * 172 * 173 * Can be used by dervied class to fill core::AhrsData 174 * 177 175 * \param ahrsData ahrs datas 178 176 */ -
trunk/include/FlairFilter/AhrsComplementaryFilter.h
r16 r50 66 66 bool isInit; 67 67 core::Quaternion QHat; 68 core::Vector3D BHat;68 core::Vector3Df BHat; 69 69 gui::DoubleSpinBox *ka[3]; 70 70 gui::DoubleSpinBox *kb[3]; -
trunk/include/FlairFilter/ButterworthLowPass.h
r13 r50 48 48 * \param name name 49 49 * \param order order of the filter 50 * \param nbRow number of rows of input/output 51 * \param nbCol number of cols of input/output 50 52 */ 51 53 ButterworthLowPass(const IODevice *parent, 52 54 const gui::LayoutPosition *position, std::string name, 53 int order);55 uint32_t order,uint32_t nbRow=1,uint32_t nbCol=1); 54 56 55 57 /*! … … 65 67 * \param name name 66 68 * \param order order of the filter 69 * \param nbRow number of rows of input/output 70 * \param nbCol number of cols of input/output 67 71 */ 68 72 ButterworthLowPass(const gui::LayoutPosition *position, std::string name, 69 int order);73 uint32_t order,uint32_t nbRow,uint32_t nbCol); 70 74 71 75 /*! -
trunk/include/FlairFilter/EulerDerivative.h
r13 r50 45 45 * IODevice::ProcessUpdate is called. \n 46 46 * The optional init_value parameters allow to specify 47 * the size of the input datas and itsinital values.47 * the size of the input datas and output inital values. 48 48 * If unspecified, a 1*1 size is used, and values are 49 49 * initialized with 0. … … 52 52 * \param position position to display settings 53 53 * \param name name 54 * \param init_value initial value 54 * \param init_value initial value, it is safe to destroy it after calling this constructor 55 55 */ 56 56 EulerDerivative(const core::IODevice *parent, -
trunk/include/FlairFilter/Gx3_25_ahrs.h
r13 r50 30 30 * \brief Constructor 31 31 * 32 * Construct an Ahrs for 3dmgx3-25 32 * Construct an Ahrs for 3dmgx3-25. It will be child of the FrameworkManager. 33 33 * 34 * \param parent parent35 34 * \param name name 36 35 * \param serialport Imu SerialPort … … 38 37 * \param priority priority of the Gx3_25_imu Thread 39 38 */ 40 Gx3_25_ahrs( const core::FrameworkManager *parent,std::string name,39 Gx3_25_ahrs(std::string name, 41 40 core::SerialPort *serialport, 42 41 sensor::Gx3_25_imu::Command_t command, uint8_t priority); … … 47 46 */ 48 47 ~Gx3_25_ahrs(); 49 50 /*!51 * \brief Start Gx3_25_imu Thread52 *53 */54 void Start(void);55 48 56 49 private: -
trunk/include/FlairFilter/LowPassFilter.h
r13 r50 52 52 * \param position position to display settings 53 53 * \param name name 54 * \param init_value initial value 54 * \param init_value initial value, it is safe to destroy it after calling this constructor 55 55 */ 56 56 LowPassFilter(const core::IODevice *parent, -
trunk/include/FlairFilter/SimuAhrs.h
r13 r50 30 30 * \brief Constructor 31 31 * 32 * Construct a simulation Ahrs. 32 * Construct a simulation Ahrs. It will be child of the FrameworkManager. 33 33 * 34 * \param parent parent35 34 * \param name name 36 * \param dev_id number id of the simulated Ahrs 35 * \param modelId Model id 36 * \param deviceId Ahrs id of the Model 37 37 * \param priority priority of the SimuImu Thread 38 38 */ 39 SimuAhrs( const core::FrameworkManager *parent,std::string name,40 uint32_t dev_id, uint8_t priority);39 SimuAhrs(std::string name, 40 uint32_t modelId,uint32_t deviceId, uint8_t priority); 41 41 42 42 /*! … … 45 45 */ 46 46 ~SimuAhrs(); 47 48 /*!49 * \brief Start SimuImu Thread50 *51 */52 void Start(void);53 47 54 48 private: -
trunk/include/FlairFilter/TrajectoryGenerator1D.h
r13 r50 72 72 * \brief Start trajectory 73 73 * 74 * \param start_pos start position 75 * \param end_pos end position 74 * \param startPosition start position 75 * \param endPosition end position 76 * \param startVelocity start velocity, should be actual velocity. This value will be saturated 77 * max velocity defined in GCS. 76 78 */ 77 void StartTraj(float start _pos, float end_pos);79 void StartTraj(float startPosition, float endPosition,float startVelocity=0); 78 80 79 81 /*! -
trunk/include/FlairFilter/TrajectoryGenerator2DCircle.h
r13 r50 15 15 16 16 #include <IODevice.h> 17 #include <Vector2D.h> 17 18 18 19 namespace flair { 19 20 namespace core { 20 21 class cvmatrix; 21 class Vector2D;22 22 } 23 23 namespace gui { … … 72 72 * \param nb_lap number of laps, -1 for infinite 73 73 */ 74 void StartTraj(const core::Vector2D &start_pos, float nb_lap = -1);74 void StartTraj(const core::Vector2Df &start_pos, float nb_lap = -1); 75 75 76 76 /*! … … 93 93 * \param value center position 94 94 */ 95 void SetCenter(const core::Vector2D &value);95 void SetCenter(const core::Vector2Df &value); 96 96 97 97 /*! … … 100 100 * \param value center speed 101 101 */ 102 void SetCenterSpeed(const core::Vector2D &value);102 void SetCenterSpeed(const core::Vector2Df &value); 103 103 104 104 /*! … … 117 117 * \param point returned position 118 118 */ 119 void GetPosition(core::Vector2D &point) const;119 void GetPosition(core::Vector2Df &point) const; 120 120 121 121 /*! … … 124 124 * \param point returned speed 125 125 */ 126 void GetSpeed(core::Vector2D &point) const;126 void GetSpeed(core::Vector2Df &point) const; 127 127 128 128 /*! -
trunk/include/FlairFilter/UavMultiplex.h
r13 r50 19 19 namespace flair { 20 20 namespace core { 21 class FrameworkManager;22 21 class io_data; 23 22 } … … 41 40 * \brief Constructor 42 41 * 43 * Construct a uav multiplexing 44 * 45 * \param parent parent 42 * Construct a uav multiplexing. It will be child of the FrameworkManager. 43 * 46 44 * \param name name 47 45 */ 48 UavMultiplex( const core::FrameworkManager *parent,std::string name);46 UavMultiplex(std::string name); 49 47 50 48 /*! -
trunk/include/FlairFilter/X4X8Multiplex.h
r13 r50 59 59 * \brief Constructor 60 60 * 61 * Construct a X4 and X8 multiplexing 61 * Construct a X4 and X8 multiplexing. It will be child of the FrameworkManager. 62 62 * 63 * \param parent parent64 63 * \param name name 65 64 * \param type type 66 65 */ 67 X4X8Multiplex(const core::FrameworkManager *parent, std::string name, 68 UavType_t type); 66 X4X8Multiplex(std::string name, UavType_t type); 69 67 70 68 /*! -
trunk/include/FlairMeta/HdsX8.h
r44 r50 24 24 class HdsX8 : public Uav { 25 25 public: 26 HdsX8(std::string name, 26 HdsX8(std::string name,std::string options="", 27 27 filter::UavMultiplex *multiplex = NULL); 28 28 ~HdsX8(); 29 29 void StartSensors(void); 30 30 std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";} 31 bool isReadyToFly(void) const; 32 virtual std::string GetType(void) const{return "hds_x8";} 31 33 32 34 private: -
trunk/include/FlairMeta/MetaDualShock3.h
r25 r50 40 40 41 41 public: 42 MetaDualShock3( core::FrameworkManager *parent,std::string name,42 MetaDualShock3(std::string name, 43 43 sensor::TargetController *controller); 44 44 ~MetaDualShock3(); -
trunk/include/FlairMeta/MetaVrpnObject.h
r44 r50 15 15 16 16 #include <VrpnObject.h> 17 #include "io_data.h" 17 #include <io_data.h> 18 #include <Vector3D.h> 18 19 19 20 namespace flair { 20 namespace core {21 class Vector3D;22 class FloatType;23 }24 21 namespace gui { 25 22 class DataPlot1D; … … 51 48 gui::DataPlot1D *VzPlot(void) const; // 1,2 52 49 gui::DataPlot2D *XyPlot(void) const; 53 void GetSpeed(core::Vector3D &speed) const;50 void GetSpeed(core::Vector3Df &speed) const; 54 51 55 52 private: … … 60 57 gui::DataPlot1D *vx_opti_plot, *vy_opti_plot, *vz_opti_plot; 61 58 gui::Tab *plot_tab; 62 core::FloatType elementDataType;63 59 }; 64 60 } // end namespace meta -
trunk/include/FlairMeta/SimuX4.h
r44 r50 18 18 namespace flair { 19 19 namespace meta { 20 20 21 /*! \class SimuX4 21 22 * … … 23 24 */ 24 25 class SimuX4 : public Uav { 25 public: 26 // simu_id: 0 if simulating only one UAV 27 //>0 otherwise 28 SimuX4(std::string name, int simu_id = 0, 29 filter::UavMultiplex *multiplex = NULL); 30 ~SimuX4(); 31 void StartSensors(void); 26 public: 27 // simu_id: 0 if simulating only one UAV 28 //>0 otherwise 29 SimuX4(std::string name, uint32_t simu_id = 0,std::string options="", 30 filter::UavMultiplex *multiplex = NULL); 31 ~SimuX4(); 32 void StartSensors(void); 33 virtual std::string GetType(void) const{return "x4_simu";} 34 35 private: 36 void ReadCameraResolutionOption(std::string options,std::string cameraName,uint16_t &camWidth,uint16_t &camHeight) const; 37 32 38 }; 33 39 } // end namespace meta -
trunk/include/FlairMeta/SimuX8.h
r44 r50 23 23 */ 24 24 class SimuX8 : public Uav { 25 public: 26 // simu_id: 0 if simulating only one UAV 27 //>0 otherwise 28 SimuX8(std::string name, int simu_id = 0, 29 filter::UavMultiplex *multiplex = NULL); 30 ~SimuX8(); 31 void StartSensors(void); 25 public: 26 // simu_id: 0 if simulating only one UAV 27 //>0 otherwise 28 SimuX8(std::string name, uint32_t simu_id = 0,std::string options="", 29 filter::UavMultiplex *multiplex = NULL); 30 ~SimuX8(); 31 void StartSensors(void); 32 virtual std::string GetType(void) const{return "simu_x8";} 33 34 private: 35 void ReadCameraResolutionOption(std::string options,std::string cameraName,uint16_t &camWidth,uint16_t &camHeight) const; 36 32 37 }; 33 38 } // end namespace meta -
trunk/include/FlairMeta/Uav.h
r44 r50 15 15 16 16 #include <Object.h> 17 #include <UsRangeFinder.h> 17 18 18 19 namespace flair { … … 62 63 sensor::Camera *GetHorizontalCamera(void) const; 63 64 virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";} 65 virtual bool isReadyToFly(void) const { return true;} 66 virtual std::string GetType(void) const=0; 64 67 65 68 protected: 66 69 void SetBldc(const actuator::Bldc *bldc); 67 70 void SetMultiplex(const filter::UavMultiplex *multiplex); 68 void SetAhrs(const filter::Ahrs *ahrs); 71 void SetAhrs(const filter::Ahrs *ahrs);//also sets imu (retrieved from the ahrs) 69 72 void SetUsRangeFinder(const sensor::UsRangeFinder *us); 70 73 void SetBatteryMonitor(const sensor::BatteryMonitor *battery); -
trunk/include/FlairMeta/UavFactory.h
r44 r50 21 21 #include <Uav.h> 22 22 23 flair::meta::Uav *CreateUav(std::string name, std::string type, 23 flair::meta::Uav *CreateUav(std::string name, std::string type,std::string options="", 24 24 flair::filter::UavMultiplex *multiplex = NULL); 25 25 26 void RegisterUavCreator(flair::meta::Uav*(*func)(std::string name, std::string type,27 flair::filter::UavMultiplex *multiplex));26 void RegisterUavCreator(flair::meta::Uav*(*func)(std::string,std::string,std::string, 27 flair::filter::UavMultiplex*)); 28 28 #endif // UAVFACTORY -
trunk/include/FlairMeta/UavStateMachine.h
r44 r50 107 107 const core::Quaternion &GetCurrentQuaternion(void) const; 108 108 109 const core::Vector3D &GetCurrentAngularSpeed(void) const;109 const core::Vector3Df &GetCurrentAngularSpeed(void) const; 110 110 111 111 void Land(void); … … 227 227 228 228 const sensor::TargetController *GetJoystick(void) const; 229 MetaDualShock3 *joy; 229 230 230 231 gui::Tab *setupLawTab, *graphLawTab; … … 266 267 267 268 core::Quaternion currentQuaternion; 268 core::Vector3D currentAngularSpeed;269 core::Vector3Df currentAngularSpeed; 269 270 270 271 const core::AhrsData *ComputeReferenceOrientation(void); … … 297 298 filter::Pid *uYaw; 298 299 filter::PidThrust *uZ; 299 300 MetaDualShock3 *joy;301 300 filter::TrajectoryGenerator1D *altitudeTrajectory; 302 301 }; -
trunk/include/FlairMeta/XAir.h
r44 r50 24 24 class XAir : public Uav { 25 25 public: 26 XAir(std::string name, 26 XAir(std::string name,std::string options="", 27 27 filter::UavMultiplex *multiplex = NULL); 28 28 ~XAir(); 29 29 void StartSensors(void); 30 30 std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";} 31 bool isReadyToFly(void) const; 32 virtual std::string GetType(void) const{return "xair";} 31 33 32 34 private: -
trunk/include/FlairSensorActuator/AfroBldc.h
r13 r50 18 18 namespace flair { 19 19 namespace core { 20 class FrameworkManager;21 20 class I2cPort; 22 21 } -
trunk/include/FlairSensorActuator/BatteryMonitor.h
r13 r50 21 21 class Label; 22 22 class DoubleSpinBox; 23 class SpinBox; 23 24 } 24 25 } … … 56 57 * 57 58 */ 58 bool IsBatteryLow(void) const;59 bool IsBatteryLow(void); 59 60 60 61 /*! … … 77 78 float batteryvalue; 78 79 gui::DoubleSpinBox *battery_thresh; 80 gui::SpinBox *thresholdTime; 79 81 gui::Label *battery; 82 core::Time underThersholdStartTime; 83 bool isUnderThershold; 80 84 }; 81 85 } // end namespace sensor -
trunk/include/FlairSensorActuator/BlCtrlV2.h
r13 r50 18 18 namespace flair { 19 19 namespace core { 20 class FrameworkManager;21 20 class I2cPort; 22 21 } -
trunk/include/FlairSensorActuator/BlCtrlV2_x4_speed.h
r13 r50 25 25 namespace core { 26 26 class cvmatrix; 27 class FrameworkManager;28 27 class I2cPort; 29 28 } … … 44 43 45 44 public: 46 BlCtrlV2_x4_speed( core::FrameworkManager *parent,std::string name,45 BlCtrlV2_x4_speed(std::string name, 47 46 core::I2cPort *i2cport, uint8_t base_address, 48 47 uint8_t priority); -
trunk/include/FlairSensorActuator/Bldc.h
r13 r50 19 19 namespace flair { 20 20 namespace core { 21 class FrameworkManager;22 21 class cvmatrix; 23 22 } … … 186 185 }; 187 186 } // end namespace actuator 188 } // end namespace f ramewor187 } // end namespace flair 189 188 #endif // BLDC_H -
trunk/include/FlairSensorActuator/Camera.h
r47 r50 43 43 * 44 44 * Construct a Camera. 45 * 46 * \param parent parent 45 * It will be child of the FrameworkManager. 46 * 47 47 * \param name name 48 48 * \param width width … … 50 50 * \param format image format 51 51 */ 52 Camera( const core::FrameworkManager *parent,std::string name, uint16_t width,52 Camera(std::string name, uint16_t width, 53 53 uint16_t height, core::cvimage::Type::Format format); 54 54 -
trunk/include/FlairSensorActuator/EmulatedController.h
r26 r50 21 21 namespace flair { 22 22 namespace core { 23 class FrameworkManager;24 23 class cvmatrix; 25 24 } … … 39 38 class EmulatedController : public TargetController { 40 39 public: 41 EmulatedController( const core::FrameworkManager* parent,std::string name,uint8_t priority=0);40 EmulatedController(std::string name,uint8_t priority=0); 42 41 ~EmulatedController(); 43 42 enum class ButtonType : uint16_t { -
trunk/include/FlairSensorActuator/Gx3_25_imu.h
r36 r50 50 50 * \brief Constructor 51 51 * 52 * Construct a Gx3_25_imu. 52 * Construct a Gx3_25_imu. It will be child of the FrameworkManager. 53 53 * 54 * \param parent parent55 54 * \param name name 56 55 * \param serialport SerialPort … … 58 57 * \param priority priority of the Thread 59 58 */ 60 Gx3_25_imu( const core::FrameworkManager *parent,std::string name,59 Gx3_25_imu(std::string name, 61 60 core::SerialPort *serialport, Command_t command, uint8_t priority); 62 61 -
trunk/include/FlairSensorActuator/HokuyoUTM30Lx.h
r13 r50 24 24 namespace core { 25 25 class cvmatrix; 26 class FrameworkManager;27 26 class SerialPort; 28 27 class Mutex; … … 47 46 * 48 47 * Construct a Hokuyo UTM30-Lx. 49 * 50 * \param parent parent48 * It will be child of the FrameworkManage 49 * 51 50 * \param name name 52 51 * \param serialport serialport 53 52 * \param priority priority of the Thread 54 53 */ 55 HokuyoUTM30Lx( const core::FrameworkManager *parent,std::string name,54 HokuyoUTM30Lx(std::string name, 56 55 core::SerialPort *serialport, uint8_t priority); 57 56 void getMesure(int startStep, int endStep, int clusterCount, int interval, … … 168 167 }; 169 168 } // end namespace sensor 170 } // end namespace f ramewor169 } // end namespace flair 171 170 #endif // HOKUYOUTM30LX_H -
trunk/include/FlairSensorActuator/HostEthController.h
r13 r50 26 26 namespace flair { 27 27 namespace core { 28 class FrameworkManager;29 28 class cvmatrix; 30 29 class TcpSocket; 31 class Socket;30 class UdpSocket; 32 31 class Mutex; 33 32 } … … 56 55 class HostEthController : public core::Thread, public core::IODevice { 57 56 public: 58 HostEthController( const core::FrameworkManager *parent,std::string name,57 HostEthController(std::string name, 59 58 std::string address, int port, uint32_t period = 10, 60 59 uint32_t _bitsPerAxis = 7, uint8_t priority = 0); … … 65 64 std::string controllerName; 66 65 core::TcpSocket *controlSocket; // connection to the target 67 core:: Socket *dataSocket;66 core::UdpSocket *dataSocket; 68 67 std::string targetAddress; 69 68 int targetPort; -
trunk/include/FlairSensorActuator/Imu.h
r36 r50 15 15 16 16 #include <IODevice.h> 17 #include <Vector3D.h> 17 18 18 19 namespace flair { … … 49 50 * 50 51 * Construct an Imu. 52 * It will be child of the FrameworkManager. 51 53 * 52 * \param parent parent53 54 * \param name name 54 55 */ 55 Imu( const core::FrameworkManager *parent,std::string name);56 Imu(std::string name); 56 57 57 58 /*! … … 71 72 */ 72 73 ~Imu(); 74 75 /*! 76 * \brief Get IMU datas 77 * 78 * \return ImuData 79 */ 80 const core::ImuData *GetDatas(void) const; 81 73 82 74 83 /*! … … 121 130 122 131 /*! 123 * \brief UpdateImu132 * \brief ApplyRotation 124 133 * 125 * The reimplemented class must call this function as soon as IMU datas are 126 *available. \n 134 * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n 127 135 * It handles the data rotation if it was defined. 128 136 * 137 * \param vector vector to apply rotation to 129 138 */ 130 void UpdateImu(); 139 void ApplyRotation(core::Vector3Df& vector); 140 141 /*! 142 * \brief ApplyRotation 143 * 144 * The reimplemented class must call this function to rotate IMU datas, before filling the ImuData. \n 145 * It handles the data rotation if it was defined. 146 * 147 * \param quaternion quaternion to apply rotation to 148 */ 149 void ApplyRotation(core::Quaternion& quaternion); 131 150 132 151 /*! 133 152 * \brief Get imu datas 134 153 * 154 * Can be used by dervied class to fill core::ImuData 155 * 135 156 * \param imuData imu datas 136 157 */ -
trunk/include/FlairSensorActuator/LaserRangeFinder.h
r13 r50 42 42 * 43 43 * Construct a Laser Range Finder. 44 * It will be child of the FrameworkManager 44 45 * 45 * \param parent parent46 46 * \param name name 47 47 */ 48 LaserRangeFinder( const core::FrameworkManager *parent,std::string name);48 LaserRangeFinder(std::string name); 49 49 /*! 50 50 * \brief Constructor … … 129 129 }; 130 130 } // end namespace sensor 131 } // end namespace f ramewor131 } // end namespace flair 132 132 #endif // LASERRANGEFINDER_H -
trunk/include/FlairSensorActuator/Mb800.h
r32 r50 19 19 namespace flair { 20 20 namespace core { 21 class FrameworkManager;22 21 class SerialPort; 23 22 } … … 36 35 * 37 36 * Construct a Mb800. 38 * 39 * \param parent parent 37 * It will be child of the FrameworkManager. 38 * 40 39 * \param name name 41 40 * \param serialport serialport … … 43 42 * \param priority priority of the Thread 44 43 */ 45 Mb800( const core::FrameworkManager *parent,std::string name,44 Mb800(std::string name, 46 45 core::SerialPort *serialport, NmeaGps::NMEAFlags_t NMEAFlags, 47 46 uint8_t priority); … … 75 74 }; 76 75 } // end namespace sensor 77 } // end namespace f ramewor76 } // end namespace flair 78 77 #endif // MB800_H -
trunk/include/FlairSensorActuator/NmeaGps.h
r32 r50 15 15 16 16 #include <IODevice.h> 17 #include <Vector3D.h> 17 18 #include <nmea/nmea.h> 18 19 … … 21 22 class FrameworkManager; 22 23 class GeoCoordinate; 23 class Vector3D;24 24 class GpsData; 25 25 } … … 53 53 VTG = 0x02, /*!< VTG */ 54 54 GST = 0x04, /*!< GST */ 55 GSA = 0x08, /*!< GSA */ 55 56 }; 56 57 … … 59 60 * 60 61 * Construct a NmeaGps. 62 * It will be child of the FrameworkManager. 63 * 64 * \param name name 65 * \param NMEAFlags NMEA sentances to enable 66 */ 67 NmeaGps(std::string name, 68 NMEAFlags_t NMEAFlags); 69 70 /*! 71 * \brief Constructor 72 * 73 * Construct a NmeaGps. \n 74 * This contructor must only be called for a simulated device. 61 75 * 62 76 * \param parent parent 63 77 * \param name name 64 * \param NMEAFlags NMEA sentances to enable65 */66 NmeaGps(const core::FrameworkManager *parent, std::string name,67 NMEAFlags_t NMEAFlags);68 69 /*!70 * \brief Constructor71 *72 * Construct a NmeaGps. \n73 * This contructor must only be called for a simulated device.74 *75 * \param parent parent76 * \param name name77 78 */ 78 79 NmeaGps(const core::IODevice *parent, std::string name); … … 168 169 * \param point to store position 169 170 */ 170 void GetEnu(core::Vector3D *point);171 void GetEnu(core::Vector3Df *point); 171 172 172 173 protected: … … 222 223 }; 223 224 } // end namespace sensor 224 } // end namespace f ramewor225 } // end namespace flair 225 226 #endif // NMEAGPS_H -
trunk/include/FlairSensorActuator/Novatel.h
r32 r50 36 36 * 37 37 * Construct a Novatel. 38 * It will be child of the FrameworkManager. 38 39 * 39 * \param parent parent40 40 * \param name name 41 41 * \param serialport serialport … … 43 43 * \param priority priority of the Thread 44 44 */ 45 Novatel( const core::FrameworkManager *parent,std::string name,45 Novatel(std::string name, 46 46 core::SerialPort *serialport, NmeaGps::NMEAFlags_t NMEAFlags, 47 47 uint8_t priority); … … 75 75 }; 76 76 } // end namespace sensor 77 } // end namespace f ramewor77 } // end namespace flair 78 78 #endif // Novatel_H -
trunk/include/FlairSensorActuator/Ps3Eye.h
r13 r50 17 17 18 18 namespace flair { 19 namespace core {20 class cvimage;21 class FrameworkManager;22 }23 namespace gui {24 class GridLayout;25 class DoubleSpinBox;26 class CheckBox;27 }28 }29 30 namespace flair {31 19 namespace sensor { 32 20 /*! \class Ps3Eye … … 41 29 * 42 30 * Construct a Ps3Eye. 31 * It will be child of the FrameworkManager. 43 32 * 44 * \param parent parent45 33 * \param name name 46 34 * \param camera_index index of the camera, ie /dev/videox 47 35 * \param priority priority of the Thread 48 36 */ 49 Ps3Eye( const core::FrameworkManager *parent,std::string name,37 Ps3Eye(std::string name, 50 38 int camera_index, uint8_t priority); 51 39 -
trunk/include/FlairSensorActuator/RadioReceiver.h
r13 r50 19 19 namespace flair { 20 20 namespace core { 21 class FrameworkManager;22 21 class cvmatrix; 23 22 } … … 41 40 * 42 41 * Construct a RadioReceiver. 42 * It will be child of the FrameworkManager. 43 43 * 44 * \param parent parent45 44 * \param name name 46 45 * \param nb_channels number of supported channels 47 46 */ 48 RadioReceiver( const core::FrameworkManager *parent,std::string name,47 RadioReceiver(std::string name, 49 48 unsigned int nb_channels); 50 49 -
trunk/include/FlairSensorActuator/SimuBldc.h
r13 r50 46 46 * \param name name 47 47 * \param motors_count number of motors 48 * \param dev_id device id 48 * \param modelId Model id 49 * \param deviceId Bldc id of the Model 49 50 */ 50 51 SimuBldc(const core::IODevice *parent, gui::Layout *layout, std::string name, 51 uint8_t motors_count, uint32_t dev_id);52 uint8_t motors_count, uint32_t modelId,uint32_t deviceId); 52 53 53 54 /*! … … 59 60 * \param name name 60 61 * \param motors_count number of motors 61 * \param dev_id device id 62 * \param modelId Model id 63 * \param deviceId Bldc id of the Model 62 64 */ 63 65 SimuBldc(const core::Object *parent, std::string name, uint8_t motors_count, 64 uint32_t dev_id);66 uint32_t modelId,uint32_t deviceId); 65 67 66 68 /*! … … 107 109 */ 108 110 void SetMotors(float *value); 109 111 112 std::string ShMemName(uint32_t modelId,uint32_t deviceId); 110 113 core::SharedMem *shmem; 111 114 gui::DoubleSpinBox *k; -
trunk/include/FlairSensorActuator/SimuCamera.h
r13 r50 19 19 20 20 namespace flair { 21 namespace core { 22 class SharedMem; 23 } 24 namespace gui { 25 class SpinBox; 26 } 21 namespace core { 22 class SharedMem; 23 } 27 24 } 28 25 … … 39 36 * 40 37 * Construct a SimuCamera. Control part. 38 * It will be child of the FrameworkManager. 41 39 * 42 * \param parent parent43 40 * \param name name 44 41 * \param width width 45 42 * \param height height 46 43 * \param channels number of channels 47 * \param dev_id device id 44 * \param modelId Model id 45 * \param deviceId Camera id of the Model 48 46 * \param priority priority of the Thread 49 47 */ 50 SimuCamera( const core::FrameworkManager *parent,std::string name,51 uint16_t width, uint16_t height, uint8_t channels, uint32_t dev_id,48 SimuCamera(std::string name, 49 uint16_t width, uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId, 52 50 uint8_t priority); 53 51 … … 63 61 * \param height height 64 62 * \param channels number of channels 65 * \param dev_id device id 63 * \param modelId Model id 64 * \param deviceId Camera id of the Model 66 65 */ 67 66 SimuCamera(const core::IODevice *parent, std::string name, uint16_t width, 68 uint16_t height, uint8_t channels, uint32_t dev_id);67 uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId); 69 68 70 69 /*! … … 98 97 */ 99 98 void UpdateFrom(const core::io_data *data){}; 99 100 std::string ShMemName(uint32_t modelId,uint32_t deviceId); 100 101 101 gui::SpinBox *data_rate;102 102 size_t buf_size; 103 IplImage *img;103 char* shmemReadBuf; 104 104 }; 105 105 } // end namespace sensor -
trunk/include/FlairSensorActuator/SimuGps.h
r34 r50 19 19 namespace flair { 20 20 namespace core { 21 class FrameworkManager;22 21 class SharedMem; 23 22 } … … 40 39 * 41 40 * Construct a simulation GPS. Control part. 42 * 43 * \param parent parent 41 * It will be child of the FrameworkManager. 42 * 44 43 * \param name name 45 44 * \param NMEAFlags NMEA sentances to enable 46 * \param deviceId device id 45 * \param modelId Model id 46 * \param deviceId Gps id of the Model 47 47 * \param priority priority of the Thread 48 48 */ 49 SimuGps( const core::FrameworkManager *parent,std::string name,50 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t deviceId,uint8_t priority);49 SimuGps(std::string name, 50 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority); 51 51 52 52 /*! … … 58 58 * \param parent parent 59 59 * \param name name 60 * \param deviceId device id 60 * \param modelId Model id 61 * \param deviceId Gps id of the Model 61 62 */ 62 SimuGps(const core::IODevice *parent, std::string name, uint32_t deviceId);63 SimuGps(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId); 63 64 64 65 /*! … … 93 94 float vn; 94 95 } gps_states_t; 96 97 std::string ShMemName(uint32_t modelId,uint32_t deviceId); 95 98 96 99 core::SharedMem *shmem; … … 99 102 }; 100 103 } // end namespace sensor 101 } // end namespace f ramewor104 } // end namespace flair 102 105 #endif // SIMUGPS_H -
trunk/include/FlairSensorActuator/SimuImu.h
r32 r50 39 39 * 40 40 * Construct a SimuImu. Control part. 41 * It will be child of the FrameworkManager. 41 42 * 42 * \param parent parent43 43 * \param name name 44 * \param dev_id device id 44 * \param modelId Model id 45 * \param deviceId Imu id of the Model 45 46 * \param priority priority of the Thread 46 47 */ 47 SimuImu( const core::FrameworkManager *parent,std::string name,48 uint32_t dev_id, uint8_t priority);48 SimuImu(std::string name, 49 uint32_t modelId,uint32_t deviceId, uint8_t priority); 49 50 50 51 /*! … … 56 57 * \param parent parent 57 58 * \param name name 58 * \param dev_id device id 59 * \param modelId Model id 60 * \param deviceId Imu id of the Model 59 61 */ 60 SimuImu(const core::IODevice *parent, std::string name, uint32_t dev_id);62 SimuImu(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId); 61 63 62 64 /*! … … 93 95 float wz; 94 96 } imu_states_t; 97 98 std::string ShMemName(uint32_t modelId,uint32_t deviceId); 95 99 96 100 gui::SpinBox *dataRate; -
trunk/include/FlairSensorActuator/SimuLaser.h
r13 r50 38 38 * 39 39 * Construct a SimuUs. Control part. 40 * It will be child of the FrameworkManager. 40 41 * 41 * \param parent parent42 42 * \param name name 43 * \param dev_id device id 43 * \param modelId Model id 44 * \param deviceId LaserRangeFinder id of the Model 44 45 * \param priority priority of the Thread 45 46 */ 46 SimuLaser( const core::FrameworkManager *parent,std::string name,47 uint32_t dev_id, uint8_t priority);47 SimuLaser(std::string name, 48 uint32_t modelId,uint32_t deviceId, uint8_t priority); 48 49 49 50 /*! … … 55 56 * \param parent parent 56 57 * \param name name 57 * \param dev_id device id 58 * \param modelId Model id 59 * \param deviceId LaserRangeFinder id of the Model 58 60 */ 59 SimuLaser(const core::IODevice *parent, std::string name, uint32_t dev_id);61 SimuLaser(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId); 60 62 61 63 /*! … … 89 91 */ 90 92 void Run(void); 91 93 94 std::string ShMemName(uint32_t modelId,uint32_t deviceId); 92 95 gui::SpinBox *data_rate; 93 96 }; -
trunk/include/FlairSensorActuator/SimuUs.h
r13 r50 38 38 * 39 39 * Construct a SimuUs. Control part. 40 * It will be child of the FrameworkManager. 40 41 * 41 * \param parent parent42 42 * \param name name 43 * \param dev_id device id 43 * \param modelId Model id 44 * \param deviceId UsRangeFinder id of the Model 44 45 * \param priority priority of the Thread 45 46 */ 46 SimuUs( const core::FrameworkManager *parent,std::string name,47 uint32_t dev_id, uint8_t priority);47 SimuUs(std::string name, 48 uint32_t modelId,uint32_t deviceId, uint8_t priority); 48 49 49 50 /*! … … 55 56 * \param parent parent 56 57 * \param name name 57 * \param dev_id device id 58 * \param modelId Model id 59 * \param deviceId UsRangeFinder id of the Model 58 60 */ 59 SimuUs(const core::IODevice *parent, std::string name, uint32_t dev_id);61 SimuUs(const core::IODevice *parent, std::string name, uint32_t modelId,uint32_t deviceId); 60 62 61 63 /*! … … 89 91 */ 90 92 void Run(void); 91 93 94 std::string ShMemName(uint32_t modelId,uint32_t deviceId); 92 95 gui::SpinBox *data_rate; 93 96 }; -
trunk/include/FlairSensorActuator/Srf08.h
r32 r50 19 19 namespace flair { 20 20 namespace core { 21 class FrameworkManager;22 21 class I2cPort; 23 22 } 24 23 namespace gui { 25 24 class SpinBox; 26 ;27 25 } 28 26 } … … 41 39 * 42 40 * Construct a SRF08 sensor 41 * It will be child of the FrameworkManager. 43 42 * 44 * \param parent parent45 43 * \param name name 46 44 * \param i2cport i2c port … … 48 46 * \param priority priority of the Thread 49 47 */ 50 Srf08( const core::FrameworkManager *parent,std::string name,48 Srf08(std::string name, 51 49 core::I2cPort *i2cport, uint16_t address, uint8_t priority); 52 50 -
trunk/include/FlairSensorActuator/TargetController.h
r13 r50 49 49 class TargetController : public core::Thread, public core::IODevice { 50 50 public: 51 TargetController(const core::FrameworkManager *parent, std::string name, 52 uint8_t priority = 0); 51 TargetController(std::string name,uint8_t priority = 0); 53 52 ~TargetController(); 54 53 // void DrawUserInterface(); -
trunk/include/FlairSensorActuator/TargetEthController.h
r25 r50 29 29 class cvmatrix; 30 30 class TcpSocket; 31 class Socket;31 class UdpSocket; 32 32 } 33 33 namespace gui { … … 47 47 class TargetEthController : public TargetController { 48 48 public: 49 TargetEthController( const core::FrameworkManager *parent,std::string name,49 TargetEthController(std::string name, 50 50 uint16_t port, uint8_t priority = 0); 51 51 ~TargetEthController(); … … 78 78 int listeningPort; 79 79 core::TcpSocket *controlSocket = NULL; 80 core:: Socket *dataSocket;80 core::UdpSocket *dataSocket; 81 81 std::string *axisName = NULL; 82 82 std::string *buttonName = NULL; -
trunk/include/FlairSensorActuator/UsRangeFinder.h
r13 r50 44 44 * 45 45 * Construct a UsRangeFinder. Control part. 46 * 47 * \param parent parent 46 * It will be child of the FrameworkManager. 47 * 48 48 * \param name name 49 49 */ 50 UsRangeFinder( const core::FrameworkManager *parent,std::string name);50 UsRangeFinder(std::string name); 51 51 52 52 /*! -
trunk/include/FlairSensorActuator/V4LCamera.h
r13 r50 21 21 namespace core { 22 22 class cvimage; 23 class FrameworkManager;24 23 } 25 24 namespace gui { 26 class GridLayout;27 25 class DoubleSpinBox; 28 26 class CheckBox; … … 43 41 * 44 42 * Construct a Camera. 43 * It will be child of the FrameworkManager. 45 44 * 46 * \param parent parent47 45 * \param name name 48 46 * \param camera_index camera index … … 52 50 * \param priority priority of the Thread 53 51 */ 54 V4LCamera( const core::FrameworkManager *parent,std::string name,52 V4LCamera(std::string name, 55 53 uint8_t camera_index, uint16_t width, uint16_t height, 56 54 core::cvimage::Type::Format format, uint8_t priority); … … 61 59 */ 62 60 ~V4LCamera(); 61 62 //hack for ps3eye in hds uav 63 //TODO: put this in ps3eye class 64 bool HasProblems(void); 63 65 64 66 protected: … … 118 120 */ 119 121 virtual void SetContrast(float value); 120 122 121 123 private: 122 124 /*! … … 140 142 141 143 gui::Tab *sensor_tab; 142 gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness, 143 *sat; 144 gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,*sat; 144 145 gui::CheckBox *autogain, *awb, *autoexposure; 145 146 gui::Label *fps; 147 bool hasProblems; 146 148 }; 147 149 } // end namespace sensor -
trunk/include/FlairSensorActuator/VrpnClient.h
r44 r50 49 49 * \param name name 50 50 * \param address server address 51 * \param us_period Thread period in us52 51 * \param priority priority of the Thread 53 52 */ 54 53 VrpnClient(std::string name, 55 std::string address, uint16_t us_period,uint8_t priority);54 std::string address, uint8_t priority); 56 55 57 56 /*! -
trunk/include/FlairSensorActuator/VrpnObject.h
r44 r50 16 16 17 17 #include <IODevice.h> 18 #include <Vector3D.h> 18 19 #include <stdint.h> 19 20 … … 21 22 namespace core { 22 23 class cvmatrix; 23 class Vector3D;24 class Euler;25 24 class Quaternion; 26 25 } … … 101 100 102 101 /*! 103 * \brief Get Euler angles104 *105 * \param euler output datas106 */107 void GetEuler(core::Euler &euler) const;108 109 /*!110 102 * \brief Get Quaternion 111 103 * … … 118 110 * \param point output datas 119 111 */ 120 void GetPosition(core::Vector3D &point) const;112 void GetPosition(core::Vector3Df &point) const; 121 113 122 114 /*! … … 124 116 * 125 117 * 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 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 132 125 * 133 * \return Output m etrix126 * \return Output matrix 134 127 */ 135 128 core::cvmatrix *Output(void) const; … … 138 131 * \brief State matrix 139 132 * 133 * Used for plotting on ground station. \n 140 134 * Matrix is of type float and as follows: \n 141 135 * (0,0) roll (deg) \n … … 143 137 * (2,0) yaw (deg) \n 144 138 * 145 * \return State m etrix139 * \return State matrix 146 140 */ 147 141 core::cvmatrix *State(void) const; … … 178 172 void UpdateFrom(const core::io_data *data){}; 179 173 180 void mainloop(void);181 174 class VrpnObject_impl *pimpl_; 182 175 }; -
trunk/include/FlairSimulator/Castle.h
r13 r50 23 23 class Castle : public Gui { 24 24 public: 25 Castle( const flair::simulator::Simulator *parent,int app_width,25 Castle(int app_width, 26 26 int app_height, int scene_width, int scene_height, 27 27 std::string media_path); -
trunk/include/FlairSimulator/FixedCamera.h
r44 r50 26 26 class FixedCamera : public VisualizationCamera { 27 27 public: 28 FixedCamera(std::string name,core::Vector3D position,core::Vector3D lookat=core::Vector3D(0,0,0),float rotateSpeed = -3.0f, float zoomSpeed = .05f);28 FixedCamera(std::string name,core::Vector3Df position,core::Vector3Df lookat=core::Vector3Df(0,0,0),float rotateSpeed = -3.0f, float zoomSpeed = .05f); 29 29 ~FixedCamera(); 30 30 -
trunk/include/FlairSimulator/Gui.h
r34 r50 19 19 20 20 #include <Object.h> 21 #include <Vector3D.h> 21 22 #include <EDriverTypes.h> 22 23 #include <vector3d.h> … … 36 37 namespace core { 37 38 class Object; 38 class Vector3D;39 39 class Euler; 40 40 class Quaternion; … … 48 48 namespace flair { 49 49 namespace simulator { 50 class Simulator;51 50 52 class Gui 51 class Gui: public core::Object { 53 52 friend class ::Simulator_impl; 54 53 friend class VisualizationCamera; 55 54 56 55 public: 57 Gui( const Simulator *parent,std::string name, int app_width, int app_height,56 Gui(std::string name, int app_width, int app_height, 58 57 int scene_width, int scene_height, std::string media_path, 59 58 irr::video::E_DRIVER_TYPE driver_type = irr::video::EDT_OPENGL); … … 126 125 * \return vector in irrlicht coordinates 127 126 */ 128 irr::core::vector3df ToIrrlichtCoordinates(core::Vector3Dvect);127 template<typename T> irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<T> vect); 129 128 130 129 /*! … … 137 136 * \return vector in simulator coordinates 138 137 */ 139 core::Vector3D ToSimulatorCoordinates(irr::core::vector3df vect);138 core::Vector3Df ToSimulatorCoordinates(irr::core::vector3df vect); 140 139 141 140 /*! -
trunk/include/FlairSimulator/Man.h
r13 r50 34 34 namespace flair { 35 35 namespace simulator { 36 class Simulator;37 36 38 37 class Man : private Model { 39 38 public: 40 Man( const Simulator *parent, std::string name);39 Man(std::string name,uint32_t modelId); 41 40 ~Man(); 42 41 -
trunk/include/FlairSimulator/Model.h
r34 r50 51 51 namespace flair { 52 52 namespace simulator { 53 class Simulator;54 53 class FollowMeCamera; 55 54 … … 65 64 66 65 public: 67 Model( const Simulator *parent, std::string name);66 Model(std::string name,uint32_t modelId); 68 67 virtual ~Model(); 69 68 70 69 typedef struct simu_state { 71 70 core::Quaternion Quat; 72 core::Vector3D W;73 core::Vector3D Pos;74 core::Vector3D Vel;71 core::Vector3Df W; 72 core::Vector3D<double> Pos; 73 core::Vector3D<double> Vel; 75 74 } simu_state_t; 76 75 … … 93 92 #endif 94 93 gui::TabWidget *GetTabWidget(void) const; 94 int GetId(void) const; 95 95 96 96 protected: 97 97 DiscreteTimeVariable<simu_state_t, 3> state; 98 floatdT(void) const;98 double dT(void) const; 99 99 virtual void CalcModel(void) = 0; 100 100 #ifdef GL -
trunk/include/FlairSimulator/Parser.h
r34 r50 19 19 20 20 #include <Gui.h> 21 #include <Vector3D.h> 21 22 #include <libxml/parser.h> 22 23 #include <libxml/tree.h> 23 24 namespace flair { 25 namespace core { 26 class Vector3D; 27 } 28 } 24 #include <SColor.h> 29 25 30 26 namespace flair { … … 38 34 */ 39 35 public: 40 Parser( Simulator *parent,int app_width, int app_height, int scene_width,36 Parser(int app_width, int app_height, int scene_width, 41 37 int scene_height, std::string media_path, std::string xmlFile); 42 38 ~Parser(); … … 45 41 xmlDoc *doc; 46 42 std::string media_path; 47 Simulator *parent;48 43 void processElements(xmlNode *a_node); 49 44 void processObjects(xmlNode *a_node); 50 45 void processParams(xmlNode *a_node); 46 irr::video::SColor getScolor(xmlNode *mesh_node); 51 47 irr::core::vector3df getMeshVect(xmlNode *mesh_node, xmlChar *param); 52 48 irr::core::vector3df getSceneVect(xmlNode *mesh_node, xmlChar *param, 53 49 bool isScale = false); 54 core::Vector3D getMeshVector3D(xmlNode *mesh_node, xmlChar *param);50 core::Vector3Df getMeshVector3D(xmlNode *mesh_node, xmlChar *param); 55 51 }; 56 52 } -
trunk/include/FlairSimulator/SimuCameraGL.h
r13 r50 51 51 // top left origin 52 52 SimuCameraGL(const simulator::Model *parent, std::string name, int width, 53 int height, int x, int y, int dev_id);53 int height, int x, int y, uint32_t modelId,uint32_t deviceId); 54 54 ~SimuCameraGL(); 55 55 //! Sets the value of the near clipping plane. (default: 1.0f) … … 67 67 irr::scene::ISceneManager *newManager = 0); 68 68 void getImage(void); 69 void putImage(char *pixels );69 void putImage(char *pixels,core::Time imageTime); 70 70 irr::scene::ICameraSceneNode *camera; 71 71 irr::scene::ISceneManager *smgr; -
trunk/include/FlairSimulator/SimuLaserGL.h
r13 r50 38 38 class SimuLaserGL : public SimuLaser, public SensorGL { 39 39 public: 40 SimuLaserGL(const simulator::Model *parent, std::string name, int dev_id);40 SimuLaserGL(const simulator::Model *parent, std::string name, uint32_t modelId,uint32_t deviceId); 41 41 ~SimuLaserGL(); 42 42 -
trunk/include/FlairSimulator/SimuUsGL.h
r13 r50 38 38 class SimuUsGL : public SimuUs, public SensorGL { 39 39 public: 40 SimuUsGL(const simulator::Model *parent, std::string name, int dev_id);40 SimuUsGL(const simulator::Model *parent, std::string name, uint32_t modelId,uint32_t deviceId); 41 41 ~SimuUsGL(); 42 42 -
trunk/include/FlairSimulator/Simulator.h
r13 r50 19 19 20 20 #include <FrameworkManager.h> 21 #include <Vector3D.h> 21 22 #include <stdint.h> 22 23 23 24 class Simulator_impl; 25 class Model_impl; 24 26 25 27 namespace flair { 26 28 namespace core { 27 29 class Quaternion; 28 class Vector3D;29 30 } 30 31 } … … 36 37 37 38 class Simulator : public core::FrameworkManager { 38 friend class Model;39 friend class ::Model_impl; 39 40 friend class Gui; 40 41 friend class GenericObject; … … 52 53 // coordinate, around z axis 53 54 core::Quaternion ToVRPNReference(core::Quaternion quat_in); 54 core::Vector3D ToVRPNReference(core::Vector3Dpoint_in);55 core::Vector3D<double> ToVRPNReference(core::Vector3D<double> point_in); 55 56 56 57 private: -
trunk/include/FlairSimulator/X4.h
r34 r50 19 19 20 20 #include <Model.h> 21 #include <stdint.h>22 #include <stdio.h>23 21 24 22 namespace flair { … … 34 32 } 35 33 36 #ifdef GL37 namespace irr {38 namespace scene {39 class IMesh;40 }41 }42 #endif43 44 34 namespace flair { 45 35 namespace simulator { 46 class Simulator;47 36 class Blade; 48 class MeshSceneNode;49 37 50 38 class X4 : public Model { 51 39 public: 52 X4( const Simulator *parent, std::string name, int dev_id);40 X4(std::string name, uint32_t modelId); 53 41 ~X4(); 54 42 #ifdef GL … … 57 45 58 46 protected: 59 irr::scene::IMesh *red_arm, *black_arm, *motor;60 MeshSceneNode *fl_arm, *fr_arm, *rl_arm, *rr_arm;61 MeshSceneNode *fl_motor, *fr_motor, *rl_motor, *rr_motor;62 47 Blade *fl_blade, *fr_blade, *rl_blade, *rr_blade; 63 48 core::Mutex *motor_speed_mutex; -
trunk/include/FlairSimulator/X8.h
r34 r50 19 19 20 20 #include <Model.h> 21 #include <stdint.h>22 21 23 22 namespace flair { … … 33 32 } 34 33 35 #ifdef GL36 namespace irr {37 namespace scene {38 class IMesh;39 }40 }41 #endif42 43 34 namespace flair { 44 35 namespace simulator { 45 class Simulator;46 36 class Blade; 47 class MeshSceneNode;48 37 49 38 class X8 : public Model { 50 39 public: 51 X8( const Simulator *parent, std::string name, int dev_id);40 X8(std::string name, uint32_t modelId); 52 41 ~X8(); 53 42 virtual void Draw(void); … … 56 45 protected: 57 46 #ifdef GL 58 irr::scene::IMesh *red_arm, *black_arm, *motor;59 MeshSceneNode *fl_arm, *fr_arm, *rl_arm, *rr_arm;60 MeshSceneNode *tfl_motor, *tfr_motor, *trl_motor, *trr_motor;61 MeshSceneNode *bfl_motor, *bfr_motor, *brl_motor, *brr_motor;62 47 Blade *tfl_blade, *tfr_blade, *trl_blade, *trr_blade; 63 48 Blade *bfl_blade, *bfr_blade, *brl_blade, *brr_blade; -
trunk/include/FlairVisionFilter/OpticalFlowSpeed.h
r44 r50 31 31 * \brief Optical flow speed calculation 32 32 * 33 * Speed is the mean of all optical flow values .33 * Speed is the mean of all optical flow values divided by the delta time between images. 34 34 */ 35 35 class OpticalFlowSpeed : public core::IODevice … … 67 67 * \brief Output matrix 68 68 * 69 * Matrix is of s ze (2,1). \n69 * Matrix is of size (2,1). \n 70 70 * First line is speed along x axis. \n 71 71 * Second line is speed along y axis. \n
Note:
See TracChangeset
for help on using the changeset viewer.