Changeset 44 in flair-dev for trunk/include


Ignore:
Timestamp:
Jan 6, 2017, 1:58:28 PM (8 years ago)
Author:
Sanahuja Guillaume
Message:

m

Location:
trunk/include
Files:
9 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/FlairCore/FrameworkManager.h

    r29 r44  
    121121  */
    122122  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;
    123133
    124134  /*!
  • trunk/include/FlairCore/IODevice.h

    r36 r44  
    115115  virtual DataType const &GetOutputDataType() const;
    116116
    117             Time lastUpdate;
    118117        protected:
    119118            /*!
  • trunk/include/FlairMeta/HdsX8.h

    r15 r44  
    2424class HdsX8 : public Uav {
    2525public:
    26   HdsX8(core::FrameworkManager *parent, std::string uav_name,
     26  HdsX8(std::string name,
    2727        filter::UavMultiplex *multiplex = NULL);
    2828  ~HdsX8();
    2929  void StartSensors(void);
     30        std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
    3031
    3132private:
  • trunk/include/FlairMeta/MetaVrpnObject.h

    r13 r44  
    1818
    1919namespace 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        }
    3633}
    3734
     
    4744class MetaVrpnObject : public sensor::VrpnObject {
    4845public:
    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);
    5248  ~MetaVrpnObject();
    5349  gui::DataPlot1D *VxPlot(void) const; // 1,0
     
    5854
    5955private:
    60   void ConstructorCommon(const sensor::VrpnClient *parent, std::string name);
     56  void ConstructorCommon(std::string name);
    6157  filter::LowPassFilter *pbas;
    6258  filter::EulerDerivative *euler;
  • trunk/include/FlairMeta/SimuX4.h

    r15 r44  
    2626  // simu_id: 0 if simulating only one UAV
    2727  //>0 otherwise
    28   SimuX4(core::FrameworkManager *parent, std::string uav_name, int simu_id = 0,
     28  SimuX4(std::string name, int simu_id = 0,
    2929         filter::UavMultiplex *multiplex = NULL);
    3030  ~SimuX4();
    3131  void StartSensors(void);
    32   void SetupVRPNAutoIP(std::string name);
    3332};
    3433} // end namespace meta
  • trunk/include/FlairMeta/SimuX8.h

    r15 r44  
    2626  // simu_id: 0 if simulating only one UAV
    2727  //>0 otherwise
    28   SimuX8(core::FrameworkManager *parent, std::string uav_name, int simu_id = 0,
     28  SimuX8(std::string name, int simu_id = 0,
    2929         filter::UavMultiplex *multiplex = NULL);
    3030  ~SimuX8();
    3131  void StartSensors(void);
    32   void SetupVRPNAutoIP(std::string name);
    3332};
    3433} // end namespace meta
  • trunk/include/FlairMeta/Uav.h

    r13 r44  
    1717
    1818namespace 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        }
    3632}
    3733
     
    3935namespace meta {
    4036class MetaUsRangeFinder;
    41 class MetaVrpnObject;
    4237
    4338/*! \class Uav
    4439*
    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.
    4644*/
    4745class Uav : public core::Object {
    4846public:
    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,
    6049      filter::UavMultiplex *multiplex = NULL);
    6150  ~Uav();
    62   void SetupVRPN(std::string optitrack_address, std::string name);
    63   // vrpn serial: broken, need to add serial port in uav specific code
    64   // void SetupVRPNSerial(core::SerialPort *vrpn_port,std::string name,int
    65   // VRPNSerialObjectId);
    66   virtual void SetupVRPNAutoIP(std::string name);
    6751
    68   virtual void StartSensors(void);
     52  virtual void StartSensors(void)=0;
    6953  void UseDefaultPlot(void);
    7054  actuator::Bldc *GetBldc(void) const;
     
    7559  sensor::UsRangeFinder *GetUsRangeFinder(void) const;
    7660  sensor::BatteryMonitor *GetBatteryMonitor(void) const;
    77   sensor::VrpnClient *GetVrpnClient(void) const;
    78   meta::MetaVrpnObject *GetVrpnObject(void) const;
    7961  sensor::Camera *GetVerticalCamera(void) const;
     62  sensor::Camera *GetHorizontalCamera(void) const;
     63        virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
    8064
    8165protected:
     
    8670  void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
    8771  void SetVerticalCamera(const sensor::Camera *verticalCamera);
     72  void SetHorizontalCamera(const sensor::Camera *verticalCamera);
    8873
    8974private:
     
    9479  sensor::UsRangeFinder *us;
    9580  MetaUsRangeFinder *meta_us;
    96   sensor::VrpnClient *vrpnclient;
    97   MetaVrpnObject *uav_vrpn;
    9881  sensor::BatteryMonitor *battery;
    99   sensor::Camera *verticalCamera;
     82  sensor::Camera *verticalCamera,*horizontalCamera;
    10083};
     84
     85/*!
     86* \brief get Uav
     87*
     88* \return the Uav
     89*/
     90Uav *GetUav(void);
     91
    10192} // end namespace meta
    10293} // end namespace flair
  • trunk/include/FlairMeta/UavFactory.h

    r26 r44  
    2121#include <Uav.h>
    2222
    23 flair::meta::Uav *CreateUav(flair::core::FrameworkManager *parent,
    24                             std::string uav_name, std::string uav_type,
     23flair::meta::Uav *CreateUav(std::string name, std::string type,
    2524                            flair::filter::UavMultiplex *multiplex = NULL);
    2625
    27 void RegisterUavCreator(flair::meta::Uav*(*func)(flair::core::FrameworkManager *parent,
    28                                    std::string uav_name, std::string uav_type,
     26void RegisterUavCreator(flair::meta::Uav*(*func)(std::string name, std::string type,
    2927                                   flair::filter::UavMultiplex *multiplex));
    3028#endif // UAVFACTORY
  • trunk/include/FlairMeta/UavStateMachine.h

    r27 r44  
    5959*
    6060* \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
    6465*/
    6566
     
    101102  };
    102103
    103         UavStateMachine(meta::Uav* uav, sensor::TargetController* controller);
     104        UavStateMachine(sensor::TargetController* controller);
    104105        ~UavStateMachine();
    105106
     
    107108
    108109  const core::Vector3D &GetCurrentAngularSpeed(void) const;
    109 
    110   const meta::Uav *GetUav(void) const;
    111110
    112111        void Land(void);
  • trunk/include/FlairMeta/XAir.h

    r15 r44  
    2424class XAir : public Uav {
    2525public:
    26   XAir(core::FrameworkManager *parent, std::string uav_name,
     26  XAir(std::string name,
    2727       filter::UavMultiplex *multiplex = NULL);
    2828  ~XAir();
    2929  void StartSensors(void);
     30        std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";}
    3031
    3132private:
  • trunk/include/FlairSensorActuator/Camera.h

    r13 r44  
    1919
    2020namespace 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        }
    2828}
    2929
     
    122122
    123123  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);
     145void ProcessUpdate(core::io_data* data);
    125146protected:
    126147  /*!
     
    138159  gui::GroupBox *setup_groupbox;
    139160  gui::GridLayout *setup_layout;
     161        LogFormat logFormat;
    140162};
    141163} // end namespace sensor
  • trunk/include/FlairSensorActuator/VrpnClient.h

    r13 r44  
    1818
    1919namespace 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        }
    2827}
    2928
     
    3534/*! \class VrpnClient
    3635*
    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.
    3839*/
    3940class VrpnClient : public core::Thread {
     
    4647  * Construct a VrpnClient. Connection is done by IP.
    4748  *
    48   * \param parent parent
    4949  * \param name name
    5050  * \param address server address
     
    5252  * \param priority priority of the Thread
    5353  */
    54   VrpnClient(const core::FrameworkManager *parent, std::string name,
     54  VrpnClient(std::string name,
    5555             std::string address, uint16_t us_period, uint8_t priority);
    5656
     
    6060  * Construct a VrpnClient. Connection is done by XBee modem.
    6161  *
    62   * \param parent parent
    6362  * \param name name
    6463  * \param serialport SerialPort for XBee modem
     
    6665  * \param priority priority of the Thread
    6766  */
    68   VrpnClient(const core::FrameworkManager *parent, std::string name,
     67  VrpnClient(std::string name,
    6968             core::SerialPort *serialport, uint16_t us_period,
    7069             uint8_t priority);
     
    108107  class VrpnClient_impl *pimpl_;
    109108};
     109
     110/*!
     111* \brief get VrpnClient
     112*
     113* \return the VrpnClient
     114*/
     115VrpnClient *GetVrpnClient(void);
     116
    110117} // end namespace sensor
    111118} // end namespace flair
  • trunk/include/FlairSensorActuator/VrpnObject.h

    r13 r44  
    1919
    2020namespace 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        }
    3232}
    3333
     
    4141/*! \class VrpnObject
    4242*
    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.
    4445*/
    4546class VrpnObject : public core::IODevice {
     
    5354  * Construct a VrpnObject. Connection is done by IP.
    5455  *
    55   * \param parent parent
    5656  * \param name VRPN object name, should be the same as defined in the server
    5757  * \param tab Tab for the user interface
    5858  */
    59   VrpnObject(const VrpnClient *parent, std::string name,
     59  VrpnObject(std::string name,
    6060             const gui::TabWidget *tab);
    6161
     
    6565  * Construct a VrpnObject. Connection is done by IP.
    6666  *
    67   * \param parent parent
    6867  * \param name name
    6968  * \param id VRPN object id, should be the same as defined in the server
    7069  * \param tab Tab for the user interface
    7170  */
    72   VrpnObject(const VrpnClient *parent, std::string name, uint8_t id,
     71  VrpnObject(std::string name, uint8_t id,
    7372             const gui::TabWidget *tab);
    7473
  • trunk/include/FlairSimulator/FixedCamera.h

    r36 r44  
    2626class FixedCamera : public VisualizationCamera {
    2727public:
    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);
    2929  ~FixedCamera();
    3030
     
    3232
    3333private:
    34   float sat(float value);
    3534  irr::core::position2df RotateStart;
    36   irr::core::vector3df rotation,target;
    3735  bool Rotating;
    3836  float rotateSpeed;
    3937  float zoomSpeed;
    4038  float fov;
    41   bool init;
     39  irr::core::vector3df target,cameraAxeY;
    4240};
    4341
Note: See TracChangeset for help on using the changeset viewer.