Changeset 44 in flair-dev for trunk/include
- Timestamp:
- Jan 6, 2017, 1:58:28 PM (8 years ago)
- Location:
- trunk/include
- Files:
-
- 9 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/FlairCore/FrameworkManager.h
r29 r44 121 121 */ 122 122 void AddDeviceToLog(IODevice *device); 123 124 /*! 125 * \brief Is device logged 126 * 127 * Check if AddDeviceToLog was called for an IODevice 128 * 129 * \param device IODevice to check 130 * \return true if AddDeviceToLog was called for this IODevice 131 */ 132 bool IsDeviceLogged(const IODevice *device) const; 123 133 124 134 /*! -
trunk/include/FlairCore/IODevice.h
r36 r44 115 115 virtual DataType const &GetOutputDataType() const; 116 116 117 Time lastUpdate;118 117 protected: 119 118 /*! -
trunk/include/FlairMeta/HdsX8.h
r15 r44 24 24 class HdsX8 : public Uav { 25 25 public: 26 HdsX8( core::FrameworkManager *parent, std::string uav_name,26 HdsX8(std::string name, 27 27 filter::UavMultiplex *multiplex = NULL); 28 28 ~HdsX8(); 29 29 void StartSensors(void); 30 std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";} 30 31 31 32 private: -
trunk/include/FlairMeta/MetaVrpnObject.h
r13 r44 18 18 19 19 namespace flair { 20 namespace core { 21 class Vector3D; 22 class FloatType; 23 } 24 namespace gui { 25 class DataPlot1D; 26 class DataPlot2D; 27 class Tab; 28 } 29 namespace filter { 30 class EulerDerivative; 31 class LowPassFilter; 32 } 33 namespace sensor { 34 class VrpnClient; 35 } 20 namespace core { 21 class Vector3D; 22 class FloatType; 23 } 24 namespace gui { 25 class DataPlot1D; 26 class DataPlot2D; 27 class Tab; 28 } 29 namespace filter { 30 class EulerDerivative; 31 class LowPassFilter; 32 } 36 33 } 37 34 … … 47 44 class MetaVrpnObject : public sensor::VrpnObject { 48 45 public: 49 MetaVrpnObject(const sensor::VrpnClient *parent, std::string name); 50 MetaVrpnObject(const sensor::VrpnClient *parent, std::string name, 51 uint8_t id); 46 MetaVrpnObject(std::string name); 47 MetaVrpnObject(std::string name,uint8_t id); 52 48 ~MetaVrpnObject(); 53 49 gui::DataPlot1D *VxPlot(void) const; // 1,0 … … 58 54 59 55 private: 60 void ConstructorCommon( const sensor::VrpnClient *parent,std::string name);56 void ConstructorCommon(std::string name); 61 57 filter::LowPassFilter *pbas; 62 58 filter::EulerDerivative *euler; -
trunk/include/FlairMeta/SimuX4.h
r15 r44 26 26 // simu_id: 0 if simulating only one UAV 27 27 //>0 otherwise 28 SimuX4( core::FrameworkManager *parent, std::string uav_name, int simu_id = 0,28 SimuX4(std::string name, int simu_id = 0, 29 29 filter::UavMultiplex *multiplex = NULL); 30 30 ~SimuX4(); 31 31 void StartSensors(void); 32 void SetupVRPNAutoIP(std::string name);33 32 }; 34 33 } // end namespace meta -
trunk/include/FlairMeta/SimuX8.h
r15 r44 26 26 // simu_id: 0 if simulating only one UAV 27 27 //>0 otherwise 28 SimuX8( core::FrameworkManager *parent, std::string uav_name, int simu_id = 0,28 SimuX8(std::string name, int simu_id = 0, 29 29 filter::UavMultiplex *multiplex = NULL); 30 30 ~SimuX8(); 31 31 void StartSensors(void); 32 void SetupVRPNAutoIP(std::string name);33 32 }; 34 33 } // end namespace meta -
trunk/include/FlairMeta/Uav.h
r13 r44 17 17 18 18 namespace flair { 19 namespace core { 20 class FrameworkManager; 21 } 22 namespace filter { 23 class Ahrs; 24 class UavMultiplex; 25 } 26 namespace actuator { 27 class Bldc; 28 } 29 namespace sensor { 30 class UsRangeFinder; 31 class BatteryMonitor; 32 class VrpnClient; 33 class Imu; 34 class Camera; 35 } 19 namespace filter { 20 class Ahrs; 21 class UavMultiplex; 22 } 23 namespace actuator { 24 class Bldc; 25 } 26 namespace sensor { 27 class UsRangeFinder; 28 class BatteryMonitor; 29 class Imu; 30 class Camera; 31 } 36 32 } 37 33 … … 39 35 namespace meta { 40 36 class MetaUsRangeFinder; 41 class MetaVrpnObject;42 37 43 38 /*! \class Uav 44 39 * 45 * \brief Base class to construct sensors/actuators depending on uav type 40 * \brief Base class to construct sensors/actuators depending on uav type. 41 * The Object is created with 42 * the FrameworkManager as parent. FrameworkManager must be created before. 43 * Only one instance of this class is allowed by program. 46 44 */ 47 45 class Uav : public core::Object { 48 46 public: 49 /* 50 typedef enum { 51 None, 52 Auto,//rt serial if hds x4 ou x8, auto ip sinon 53 AutoIP, 54 UserDefinedIP, 55 AutoSerialPort, 56 } VRPNType_t; 57 */ 58 // uav_name: for optitrack 59 Uav(core::FrameworkManager *parent, std::string name, 47 48 Uav(std::string name, 60 49 filter::UavMultiplex *multiplex = NULL); 61 50 ~Uav(); 62 void SetupVRPN(std::string optitrack_address, std::string name);63 // vrpn serial: broken, need to add serial port in uav specific code64 // void SetupVRPNSerial(core::SerialPort *vrpn_port,std::string name,int65 // VRPNSerialObjectId);66 virtual void SetupVRPNAutoIP(std::string name);67 51 68 virtual void StartSensors(void) ;52 virtual void StartSensors(void)=0; 69 53 void UseDefaultPlot(void); 70 54 actuator::Bldc *GetBldc(void) const; … … 75 59 sensor::UsRangeFinder *GetUsRangeFinder(void) const; 76 60 sensor::BatteryMonitor *GetBatteryMonitor(void) const; 77 sensor::VrpnClient *GetVrpnClient(void) const;78 meta::MetaVrpnObject *GetVrpnObject(void) const;79 61 sensor::Camera *GetVerticalCamera(void) const; 62 sensor::Camera *GetHorizontalCamera(void) const; 63 virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";} 80 64 81 65 protected: … … 86 70 void SetBatteryMonitor(const sensor::BatteryMonitor *battery); 87 71 void SetVerticalCamera(const sensor::Camera *verticalCamera); 72 void SetHorizontalCamera(const sensor::Camera *verticalCamera); 88 73 89 74 private: … … 94 79 sensor::UsRangeFinder *us; 95 80 MetaUsRangeFinder *meta_us; 96 sensor::VrpnClient *vrpnclient;97 MetaVrpnObject *uav_vrpn;98 81 sensor::BatteryMonitor *battery; 99 sensor::Camera *verticalCamera ;82 sensor::Camera *verticalCamera,*horizontalCamera; 100 83 }; 84 85 /*! 86 * \brief get Uav 87 * 88 * \return the Uav 89 */ 90 Uav *GetUav(void); 91 101 92 } // end namespace meta 102 93 } // end namespace flair -
trunk/include/FlairMeta/UavFactory.h
r26 r44 21 21 #include <Uav.h> 22 22 23 flair::meta::Uav *CreateUav(flair::core::FrameworkManager *parent, 24 std::string uav_name, std::string uav_type, 23 flair::meta::Uav *CreateUav(std::string name, std::string type, 25 24 flair::filter::UavMultiplex *multiplex = NULL); 26 25 27 void RegisterUavCreator(flair::meta::Uav*(*func)(flair::core::FrameworkManager *parent, 28 std::string uav_name, std::string uav_type, 26 void RegisterUavCreator(flair::meta::Uav*(*func)(std::string name, std::string type, 29 27 flair::filter::UavMultiplex *multiplex)); 30 28 #endif // UAVFACTORY -
trunk/include/FlairMeta/UavStateMachine.h
r27 r44 59 59 * 60 60 * \brief State machine for UAV 61 * 62 * thread synchronized with ahrs, unless a period is set with SetPeriodUS or 63 *SetPeriodMS 61 * The Thread is created with 62 * the FrameworkManager as parent. FrameworkManager must be created before. 63 * The Thread is synchronized with Ahrs, unless a period is set with SetPeriodUS or 64 * SetPeriodMS 64 65 */ 65 66 … … 101 102 }; 102 103 103 UavStateMachine( meta::Uav* uav,sensor::TargetController* controller);104 UavStateMachine(sensor::TargetController* controller); 104 105 ~UavStateMachine(); 105 106 … … 107 108 108 109 const core::Vector3D &GetCurrentAngularSpeed(void) const; 109 110 const meta::Uav *GetUav(void) const;111 110 112 111 void Land(void); -
trunk/include/FlairMeta/XAir.h
r15 r44 24 24 class XAir : public Uav { 25 25 public: 26 XAir( core::FrameworkManager *parent, std::string uav_name,26 XAir(std::string name, 27 27 filter::UavMultiplex *multiplex = NULL); 28 28 ~XAir(); 29 29 void StartSensors(void); 30 std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";} 30 31 31 32 private: -
trunk/include/FlairSensorActuator/Camera.h
r13 r44 19 19 20 20 namespace flair { 21 namespace gui {22 class GroupBox;23 class Tab;24 class TabWidget;25 class Picture;26 class GridLayout;27 }21 namespace gui { 22 class GroupBox; 23 class Tab; 24 class TabWidget; 25 class Picture; 26 class GridLayout; 27 } 28 28 } 29 29 … … 122 122 123 123 core::DataType const &GetOutputDataType() const; 124 124 125 /*! 126 \enum LogFormat 127 \brief log formats 128 */ 129 enum class LogFormat { 130 NONE, /*!< by default, no logging */ 131 RAW, /*!< raw format */ 132 JPG, /*!< jpg format */ 133 }; 134 135 /*! 136 * \brief Set log format 137 * 138 * Set the log format. \n 139 * Logging of the camera will be disabled if this method is not called. \n 140 * Calling this method enables logging of camera. 141 * 142 * \param LogFormat log format 143 */ 144 void SetLogFormat(LogFormat logFormat); 145 void ProcessUpdate(core::io_data* data); 125 146 protected: 126 147 /*! … … 138 159 gui::GroupBox *setup_groupbox; 139 160 gui::GridLayout *setup_layout; 161 LogFormat logFormat; 140 162 }; 141 163 } // end namespace sensor -
trunk/include/FlairSensorActuator/VrpnClient.h
r13 r44 18 18 19 19 namespace flair { 20 namespace core { 21 class FrameworkManager; 22 class SerialPort; 23 } 24 namespace gui { 25 class TabWidget; 26 class Layout; 27 } 20 namespace core { 21 class SerialPort; 22 } 23 namespace gui { 24 class TabWidget; 25 class Layout; 26 } 28 27 } 29 28 … … 35 34 /*! \class VrpnClient 36 35 * 37 * \brief Class to connect to a Vrpn server 36 * \brief Class to connect to a Vrpn server. The Thread is created with 37 * the FrameworkManager as parent. FrameworkManager must be created before. 38 * Only one instance of this class is allowed by program. 38 39 */ 39 40 class VrpnClient : public core::Thread { … … 46 47 * Construct a VrpnClient. Connection is done by IP. 47 48 * 48 * \param parent parent49 49 * \param name name 50 50 * \param address server address … … 52 52 * \param priority priority of the Thread 53 53 */ 54 VrpnClient( const core::FrameworkManager *parent,std::string name,54 VrpnClient(std::string name, 55 55 std::string address, uint16_t us_period, uint8_t priority); 56 56 … … 60 60 * Construct a VrpnClient. Connection is done by XBee modem. 61 61 * 62 * \param parent parent63 62 * \param name name 64 63 * \param serialport SerialPort for XBee modem … … 66 65 * \param priority priority of the Thread 67 66 */ 68 VrpnClient( const core::FrameworkManager *parent,std::string name,67 VrpnClient(std::string name, 69 68 core::SerialPort *serialport, uint16_t us_period, 70 69 uint8_t priority); … … 108 107 class VrpnClient_impl *pimpl_; 109 108 }; 109 110 /*! 111 * \brief get VrpnClient 112 * 113 * \return the VrpnClient 114 */ 115 VrpnClient *GetVrpnClient(void); 116 110 117 } // end namespace sensor 111 118 } // end namespace flair -
trunk/include/FlairSensorActuator/VrpnObject.h
r13 r44 19 19 20 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 }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 } 32 32 } 33 33 … … 41 41 /*! \class VrpnObject 42 42 * 43 * \brief Class for VRPN object 43 * \brief Class for VRPN object. The IODevice is created with 44 * the VrpnClient as parent. VrpnClient must be created before. 44 45 */ 45 46 class VrpnObject : public core::IODevice { … … 53 54 * Construct a VrpnObject. Connection is done by IP. 54 55 * 55 * \param parent parent56 56 * \param name VRPN object name, should be the same as defined in the server 57 57 * \param tab Tab for the user interface 58 58 */ 59 VrpnObject( const VrpnClient *parent,std::string name,59 VrpnObject(std::string name, 60 60 const gui::TabWidget *tab); 61 61 … … 65 65 * Construct a VrpnObject. Connection is done by IP. 66 66 * 67 * \param parent parent68 67 * \param name name 69 68 * \param id VRPN object id, should be the same as defined in the server 70 69 * \param tab Tab for the user interface 71 70 */ 72 VrpnObject( const VrpnClient *parent,std::string name, uint8_t id,71 VrpnObject(std::string name, uint8_t id, 73 72 const gui::TabWidget *tab); 74 73 -
trunk/include/FlairSimulator/FixedCamera.h
r36 r44 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 = - 500.0f, float zoomSpeed = .05f);28 FixedCamera(std::string name,core::Vector3D position,core::Vector3D lookat=core::Vector3D(0,0,0),float rotateSpeed = -3.0f, float zoomSpeed = .05f); 29 29 ~FixedCamera(); 30 30 … … 32 32 33 33 private: 34 float sat(float value);35 34 irr::core::position2df RotateStart; 36 irr::core::vector3df rotation,target;37 35 bool Rotating; 38 36 float rotateSpeed; 39 37 float zoomSpeed; 40 38 float fov; 41 bool init;39 irr::core::vector3df target,cameraAxeY; 42 40 }; 43 41
Note:
See TracChangeset
for help on using the changeset viewer.