Changeset 13 in flair-dev for trunk/include/FlairSensorActuator


Ignore:
Timestamp:
04/08/16 15:39:24 (8 years ago)
Author:
Bayard Gildas
Message:

formatting script + include reformatted

Location:
trunk/include/FlairSensorActuator
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/FlairSensorActuator/AfroBldc.h

    r4 r13  
    1616#include "Bldc.h"
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class FrameworkManager;
    23         class I2cPort;
    24     }
    25     namespace sensor
    26     {
    27         class BatteryMonitor;
    28     }
     18namespace flair {
     19namespace core {
     20class FrameworkManager;
     21class I2cPort;
     22}
     23namespace sensor {
     24class BatteryMonitor;
     25}
    2926}
    3027
    3128class AfroBldc_impl;
    3229
    33 namespace flair
    34 {
    35 namespace actuator
    36 {
    37     /*! \class AfroBldc
    38     *
    39     * \brief Class for Mikrokopter's blctrlv2
    40     *
    41     * blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
    42     */
    43     class AfroBldc : public Bldc
    44     {
    45         friend class ::AfroBldc_impl;
     30namespace flair {
     31namespace actuator {
     32/*! \class AfroBldc
     33*
     34* \brief Class for Mikrokopter's blctrlv2
     35*
     36* blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
     37*/
     38class AfroBldc : public Bldc {
     39  friend class ::AfroBldc_impl;
    4640
    47         public:
    48             /*!
    49             * \brief Constructor
    50             *
    51             * Construct a AfroBldc.
    52             *
    53             * \param parent parent
    54             * \param layout layout
    55             * \param name name
    56             * \param motors_count number of motors
    57             * \param i2cport I2cPort
    58             */
    59             AfroBldc(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count,core::I2cPort* i2cport);
     41public:
     42  /*!
     43  * \brief Constructor
     44  *
     45  * Construct a AfroBldc.
     46  *
     47  * \param parent parent
     48  * \param layout layout
     49  * \param name name
     50  * \param motors_count number of motors
     51  * \param i2cport I2cPort
     52  */
     53  AfroBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
     54           uint8_t motors_count, core::I2cPort *i2cport);
    6055
    61             /*!
    62             * \brief Destructor
    63             *
    64             */
    65             ~AfroBldc();
     56  /*!
     57  * \brief Destructor
     58  *
     59  */
     60  ~AfroBldc();
    6661
    67             /*!
    68             * \brief Has speed measurement
    69             *
    70             * Reimplemented from Bldc. \n
    71             *
    72             * \return true if it has speed measurement
    73             */
    74             bool HasSpeedMeasurement(void) const{return false;};
     62  /*!
     63  * \brief Has speed measurement
     64  *
     65  * Reimplemented from Bldc. \n
     66  *
     67  * \return true if it has speed measurement
     68  */
     69  bool HasSpeedMeasurement(void) const { return false; };
    7570
    76             /*!
    77             * \brief Has current measurement
    78             *
    79             * Reimplemented from Bldc. \n
    80             *
    81             * \return true if it has current measurement
    82             */
    83             bool HasCurrentMeasurement(void) const{return false;};
     71  /*!
     72  * \brief Has current measurement
     73  *
     74  * Reimplemented from Bldc. \n
     75  *
     76  * \return true if it has current measurement
     77  */
     78  bool HasCurrentMeasurement(void) const { return false; };
    8479
    85         private:
    86             /*!
    87             * \brief Set motors values
    88             *
    89             * Reimplemented from Bldc. \n
    90             * Values size must be the same as MotorsCount()
    91             *
    92             * \param values motor values
    93             */
    94             void SetMotors(float* values);
     80private:
     81  /*!
     82  * \brief Set motors values
     83  *
     84  * Reimplemented from Bldc. \n
     85  * Values size must be the same as MotorsCount()
     86  *
     87  * \param values motor values
     88  */
     89  void SetMotors(float *values);
    9590
    96             class AfroBldc_impl* pimpl_;
    97     };
     91  class AfroBldc_impl *pimpl_;
     92};
    9893} // end namespace actuator
    9994} // end namespace flair
  • trunk/include/FlairSensorActuator/BatteryMonitor.h

    r4 r13  
    1616#include <GroupBox.h>
    1717
    18 namespace flair
    19 {
    20     namespace gui
    21     {
    22         class LayoutPosition;
    23         class Label;
    24         class DoubleSpinBox;
    25     }
     18namespace flair {
     19namespace gui {
     20class LayoutPosition;
     21class Label;
     22class DoubleSpinBox;
     23}
    2624}
    2725
    28 namespace flair
    29 {
    30 namespace sensor
    31 {
     26namespace flair {
     27namespace sensor {
    3228
    33     /*! \class BatteryMonitor
    34     *
    35     * \brief Base class for battery monitor
    36     */
     29/*! \class BatteryMonitor
     30*
     31* \brief Base class for battery monitor
     32*/
    3733
    38     class BatteryMonitor : public gui::GroupBox
    39     {
    40         public:
    41             /*!
    42             * \brief Constructor
    43             *
    44             * Construct a BatteryMonitor at given position.
    45             *
    46             * \param position position
    47             * \param name name
    48             */
    49             BatteryMonitor(const gui::LayoutPosition* position,std::string name);
     34class BatteryMonitor : public gui::GroupBox {
     35public:
     36  /*!
     37  * \brief Constructor
     38  *
     39  * Construct a BatteryMonitor at given position.
     40  *
     41  * \param position position
     42  * \param name name
     43  */
     44  BatteryMonitor(const gui::LayoutPosition *position, std::string name);
    5045
    51             /*!
    52             * \brief Destructor
    53             *
    54             */
    55             ~BatteryMonitor();
     46  /*!
     47  * \brief Destructor
     48  *
     49  */
     50  ~BatteryMonitor();
    5651
    57             /*!
    58             * \brief Is batteru low?
    59             *
    60             * \return true if battery is below threshold
    61             *
    62             */
    63             bool IsBatteryLow(void) const;
     52  /*!
     53  * \brief Is batteru low?
     54  *
     55  * \return true if battery is below threshold
     56  *
     57  */
     58  bool IsBatteryLow(void) const;
    6459
    65             /*!
    66             * \brief Set battery value
    67             *
    68             * \param battery value
    69             *
    70             */
    71             void SetBatteryValue(float value);
     60  /*!
     61  * \brief Set battery value
     62  *
     63  * \param battery value
     64  *
     65  */
     66  void SetBatteryValue(float value);
    7267
    73             /*!
    74             * \brief Get battery voltage
    75             *
    76             * \return battery voltage
    77             *
    78             */
    79             float GetVoltage(void) const;
     68  /*!
     69  * \brief Get battery voltage
     70  *
     71  * \return battery voltage
     72  *
     73  */
     74  float GetVoltage(void) const;
    8075
    81         private:
    82             float batteryvalue;
    83             gui::DoubleSpinBox *battery_thresh;
    84             gui::Label *battery;
    85     };
     76private:
     77  float batteryvalue;
     78  gui::DoubleSpinBox *battery_thresh;
     79  gui::Label *battery;
     80};
    8681} // end namespace sensor
    8782} // end namespace flair
  • trunk/include/FlairSensorActuator/BlCtrlV2.h

    r4 r13  
    1616#include "Bldc.h"
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class FrameworkManager;
    23         class I2cPort;
    24     }
    25     namespace sensor
    26     {
    27         class BatteryMonitor;
    28     }
     18namespace flair {
     19namespace core {
     20class FrameworkManager;
     21class I2cPort;
     22}
     23namespace sensor {
     24class BatteryMonitor;
     25}
    2926}
    3027
    3128class BlCtrlV2_impl;
    3229
    33 namespace flair
    34 {
    35 namespace actuator
    36 {
    37     /*! \class BlCtrlV2
    38     *
    39     * \brief Class for Mikrokopter's blctrlv2
    40     *
    41     * blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
    42     */
    43     class BlCtrlV2 : public Bldc
    44     {
    45         friend class ::BlCtrlV2_impl;
     30namespace flair {
     31namespace actuator {
     32/*! \class BlCtrlV2
     33*
     34* \brief Class for Mikrokopter's blctrlv2
     35*
     36* blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
     37*/
     38class BlCtrlV2 : public Bldc {
     39  friend class ::BlCtrlV2_impl;
    4640
    47         public:
    48             /*!
    49             * \brief Constructor
    50             *
    51             * Construct a BlCtrlV2.
    52             *
    53             * \param parent parent
    54             * \param layout layout
    55             * \param name name
    56             * \param motors_count number of motors
    57             * \param i2cport I2cPort
    58             */
    59             BlCtrlV2(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count,core::I2cPort* i2cport);
     41public:
     42  /*!
     43  * \brief Constructor
     44  *
     45  * Construct a BlCtrlV2.
     46  *
     47  * \param parent parent
     48  * \param layout layout
     49  * \param name name
     50  * \param motors_count number of motors
     51  * \param i2cport I2cPort
     52  */
     53  BlCtrlV2(const core::IODevice *parent, gui::Layout *layout, std::string name,
     54           uint8_t motors_count, core::I2cPort *i2cport);
    6055
    61             /*!
    62             * \brief Destructor
    63             *
    64             */
    65             ~BlCtrlV2();
     56  /*!
     57  * \brief Destructor
     58  *
     59  */
     60  ~BlCtrlV2();
    6661
    67             /*!
    68             * \brief Get battery monitor
    69             *
    70             * \return BatteryMonitor
    71             */
    72             sensor::BatteryMonitor* GetBatteryMonitor(void) const;
     62  /*!
     63  * \brief Get battery monitor
     64  *
     65  * \return BatteryMonitor
     66  */
     67  sensor::BatteryMonitor *GetBatteryMonitor(void) const;
    7368
    74             /*!
    75             * \brief Has speed measurement
    76             *
    77             * Reimplemented from Bldc. \n
    78             *
    79             * \return true if it has speed measurement
    80             */
    81             bool HasSpeedMeasurement(void) const{return true;};
     69  /*!
     70  * \brief Has speed measurement
     71  *
     72  * Reimplemented from Bldc. \n
     73  *
     74  * \return true if it has speed measurement
     75  */
     76  bool HasSpeedMeasurement(void) const { return true; };
    8277
    83             /*!
    84             * \brief Has current measurement
    85             *
    86             * Reimplemented from Bldc. \n
    87             *
    88             * \return true if it has current measurement
    89             */
    90             bool HasCurrentMeasurement(void) const{return true;};
     78  /*!
     79  * \brief Has current measurement
     80  *
     81  * Reimplemented from Bldc. \n
     82  *
     83  * \return true if it has current measurement
     84  */
     85  bool HasCurrentMeasurement(void) const { return true; };
    9186
    92         private:
    93             /*!
    94             * \brief Set motors values
    95             *
    96             * Reimplemented from Bldc. \n
    97             * Values size must be the same as MotorsCount()
    98             *
    99             * \param values motor values
    100             */
    101             void SetMotors(float* values);
     87private:
     88  /*!
     89  * \brief Set motors values
     90  *
     91  * Reimplemented from Bldc. \n
     92  * Values size must be the same as MotorsCount()
     93  *
     94  * \param values motor values
     95  */
     96  void SetMotors(float *values);
    10297
    103             class BlCtrlV2_impl* pimpl_;
    104     };
     98  class BlCtrlV2_impl *pimpl_;
     99};
    105100} // end namespace actuator
    106101} // end namespace flair
  • trunk/include/FlairSensorActuator/BlCtrlV2_x4_speed.h

    r4 r13  
    1616/*********************************************************************/
    1717
    18 
    1918#ifndef BLCTRLV2_X4_SPEED_H
    2019#define BLCTRLV2_X4_SPEED_H
     
    2322#include <Thread.h>
    2423
    25 namespace flair
    26 {
    27     namespace core
    28     {
    29         class cvmatrix;
    30         class FrameworkManager;
    31         class I2cPort;
    32 
    33     }
    34     namespace gui
    35     {
    36         class TabWidget;
    37         class Tab;
    38         class SpinBox;
    39         class DoubleSpinBox;
    40         class ComboBox;
    41         class PushButton;
    42         class GroupBox;
    43     }
     24namespace flair {
     25namespace core {
     26class cvmatrix;
     27class FrameworkManager;
     28class I2cPort;
     29}
     30namespace gui {
     31class TabWidget;
     32class Tab;
     33class SpinBox;
     34class DoubleSpinBox;
     35class ComboBox;
     36class PushButton;
     37class GroupBox;
     38}
    4439}
    4540
    46 namespace flair
    47 {
    48 namespace actuator
    49 {
    50     class BlCtrlV2_x4_speed : public core::Thread,public core::IODevice
    51     {
     41namespace flair {
     42namespace actuator {
     43class BlCtrlV2_x4_speed : public core::Thread, public core::IODevice {
    5244
    53         public:
    54             BlCtrlV2_x4_speed(core::FrameworkManager* parent,std::string name,core::I2cPort* i2cport,uint8_t base_address,uint8_t priority);
    55             ~BlCtrlV2_x4_speed();
    56             void UseDefaultPlot(void);
    57             void LockUserInterface(void);
    58             void UnlockUserInterface(void);
    59             void SetEnabled(bool status);
    60             void SetUroll(float value);
    61             void SetUpitch(float value);
    62             void SetUyaw(float value);
    63             void SetUgaz(float value);
    64             void SetRollTrim(float value);
    65             void SetPitchTrim(float value);
    66             void SetYawTrim(float value);
    67             void SetGazTrim(float value);
    68             float TrimValue(void);
    69             int StartValue(void);
     45public:
     46  BlCtrlV2_x4_speed(core::FrameworkManager *parent, std::string name,
     47                    core::I2cPort *i2cport, uint8_t base_address,
     48                    uint8_t priority);
     49  ~BlCtrlV2_x4_speed();
     50  void UseDefaultPlot(void);
     51  void LockUserInterface(void);
     52  void UnlockUserInterface(void);
     53  void SetEnabled(bool status);
     54  void SetUroll(float value);
     55  void SetUpitch(float value);
     56  void SetUyaw(float value);
     57  void SetUgaz(float value);
     58  void SetRollTrim(float value);
     59  void SetPitchTrim(float value);
     60  void SetYawTrim(float value);
     61  void SetGazTrim(float value);
     62  float TrimValue(void);
     63  int StartValue(void);
    7064
    71         private:
    72             /*!
    73             * \brief Update using provided datas
    74             *
    75             * Reimplemented from IODevice.
    76             *
    77             * \param data data from the parent to process
    78             */
    79             void UpdateFrom(core::io_data *data){};
    80             void WriteValue(uint16_t value);
    81             float GetSpeed(void);
    82             void StartTest(void);
    83             void StopTest(void);
    84             /*!
    85             * \brief Run function
    86             *
    87             * Reimplemented from Thread.
    88             *
    89             */
    90             void Run(void);
    91             void Update(void);
    92             gui::Tab* main_tab;
    93             gui::TabWidget* tab;
    94             gui::GroupBox* reglages_groupbox;
    95             gui::SpinBox *min,*max,*test;
    96             gui::PushButton *button_avg,*button_avd,*button_arg,*button_ard;
    97             gui::ComboBox *av_g,*av_d,*ar_g,*ar_d,*pas;
    98             gui::DoubleSpinBox *trim,*kp,*ki;
    99             gui::SpinBox *start_value,*poles;
    100             core::Time start_time,flight_start_time;
    101             int time_sec;
    102             float speed_av_g,speed_av_d,speed_ar_g,speed_ar_d;
    103             float int_av_g,int_av_d,int_ar_g,int_ar_d;
     65private:
     66  /*!
     67  * \brief Update using provided datas
     68  *
     69  * Reimplemented from IODevice.
     70  *
     71  * \param data data from the parent to process
     72  */
     73  void UpdateFrom(core::io_data *data){};
     74  void WriteValue(uint16_t value);
     75  float GetSpeed(void);
     76  void StartTest(void);
     77  void StopTest(void);
     78  /*!
     79  * \brief Run function
     80  *
     81  * Reimplemented from Thread.
     82  *
     83  */
     84  void Run(void);
     85  void Update(void);
     86  gui::Tab *main_tab;
     87  gui::TabWidget *tab;
     88  gui::GroupBox *reglages_groupbox;
     89  gui::SpinBox *min, *max, *test;
     90  gui::PushButton *button_avg, *button_avd, *button_arg, *button_ard;
     91  gui::ComboBox *av_g, *av_d, *ar_g, *ar_d, *pas;
     92  gui::DoubleSpinBox *trim, *kp, *ki;
     93  gui::SpinBox *start_value, *poles;
     94  core::Time start_time, flight_start_time;
     95  int time_sec;
     96  float speed_av_g, speed_av_d, speed_ar_g, speed_ar_d;
     97  float int_av_g, int_av_d, int_ar_g, int_ar_d;
    10498
    105             //matrix
    106             core::cvmatrix *input;
    107             core::cvmatrix *output;
     99  // matrix
     100  core::cvmatrix *input;
     101  core::cvmatrix *output;
    108102
    109             int tested_motor;
    110             core::I2cPort* i2cport;
    111             uint8_t slave_address;
     103  int tested_motor;
     104  core::I2cPort *i2cport;
     105  uint8_t slave_address;
    112106
    113             bool enabled;
     107  bool enabled;
    114108
    115             uint16_t SatPWM(float vel_cons,uint16_t min,uint16_t max);
    116     };
     109  uint16_t SatPWM(float vel_cons, uint16_t min, uint16_t max);
     110};
    117111} // end namespace actuator
    118112} // end namespace flair
  • trunk/include/FlairSensorActuator/Bldc.h

    r4 r13  
    1717#include <stdint.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class FrameworkManager;
    24         class cvmatrix;
    25     }
    26     namespace gui
    27     {
    28         class Layout;
    29         class TabWidget;
    30     }
     19namespace flair {
     20namespace core {
     21class FrameworkManager;
     22class cvmatrix;
     23}
     24namespace gui {
     25class Layout;
     26class TabWidget;
     27}
    3128}
    3229
    3330class Bldc_impl;
    3431
    35 namespace flair
    36 {
    37 namespace actuator
    38 {
    39     /*! \class Bldc
    40     *
    41     * \brief Base class for brushless motors drivers
    42     */
    43     class Bldc : public core::IODevice
    44     {
    45         friend class ::Bldc_impl;
     32namespace flair {
     33namespace actuator {
     34/*! \class Bldc
     35*
     36* \brief Base class for brushless motors drivers
     37*/
     38class Bldc : public core::IODevice {
     39  friend class ::Bldc_impl;
    4640
    47         public:
    48             /*!
    49             * \brief Constructor
    50             *
    51             * Construct a Bldc.
    52             *
    53             * \param parent parent
    54             * \param layout layout
    55             * \param name name
    56             * \param motors_count number of motors
    57             */
    58             Bldc(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count);
     41public:
     42  /*!
     43  * \brief Constructor
     44  *
     45  * Construct a Bldc.
     46  *
     47  * \param parent parent
     48  * \param layout layout
     49  * \param name name
     50  * \param motors_count number of motors
     51  */
     52  Bldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
     53       uint8_t motors_count);
    5954
    60             /*!
    61             * \brief Constructor
    62             *
    63             * Construct a Bldc. \n
    64             * This contructor must only be called for a simulated device.
    65             *
    66             * \param parent parent
    67             * \param name name
    68             * \param motors_count number of motors
    69             */
    70             Bldc(const core::Object* parent,std::string name,uint8_t motors_count);
     55  /*!
     56  * \brief Constructor
     57  *
     58  * Construct a Bldc. \n
     59  * This contructor must only be called for a simulated device.
     60  *
     61  * \param parent parent
     62  * \param name name
     63  * \param motors_count number of motors
     64  */
     65  Bldc(const core::Object *parent, std::string name, uint8_t motors_count);
    7166
    72             /*!
    73             * \brief Destructor
    74             *
    75             */
    76             ~Bldc();
     67  /*!
     68  * \brief Destructor
     69  *
     70  */
     71  ~Bldc();
    7772
    78             /*!
    79             * \brief Lock user interface
    80             *
    81             */
    82             void LockUserInterface(void) const;
     73  /*!
     74  * \brief Lock user interface
     75  *
     76  */
     77  void LockUserInterface(void) const;
    8378
    84             /*!
    85             * \brief Unlock user interface
    86             *
    87             */
    88             void UnlockUserInterface(void) const;
     79  /*!
     80  * \brief Unlock user interface
     81  *
     82  */
     83  void UnlockUserInterface(void) const;
    8984
    90             /*!
    91             * \brief Use default plot
    92             *
    93             * \param tabwidget TabWidget to draw plots
    94             */
    95             void UseDefaultPlot(gui::TabWidget* tabwidget);
     85  /*!
     86  * \brief Use default plot
     87  *
     88  * \param tabwidget TabWidget to draw plots
     89  */
     90  void UseDefaultPlot(gui::TabWidget *tabwidget);
    9691
    97             /*!
    98             * \brief Output from motors
    99             *
    100             * First column is real speed if available, secund column is current if available
    101             *
    102             */
    103             core::cvmatrix *Output(void) const;
     92  /*!
     93  * \brief Output from motors
     94  *
     95  * First column is real speed if available, secund column is current if
     96  *available
     97  *
     98  */
     99  core::cvmatrix *Output(void) const;
    104100
    105             /*!
    106             * \brief Motors count
    107             *
    108             * \return number of motors
    109             */
    110             uint8_t MotorsCount(void) const;
     101  /*!
     102  * \brief Motors count
     103  *
     104  * \return number of motors
     105  */
     106  uint8_t MotorsCount(void) const;
    111107
    112             /*!
    113             * \brief Enable motors
    114             *
    115             * \param true to enable all motors
    116             */
    117             void SetEnabled(bool status);
     108  /*!
     109  * \brief Enable motors
     110  *
     111  * \param true to enable all motors
     112  */
     113  void SetEnabled(bool status);
    118114
    119             /*!
    120             * \brief Are motors enabled?
    121             *
    122             * \return true if motors are enabled
    123             */
    124             bool AreEnabled(void) const;
     115  /*!
     116  * \brief Are motors enabled?
     117  *
     118  * \return true if motors are enabled
     119  */
     120  bool AreEnabled(void) const;
    125121
    126             /*!
    127             * \brief Set motor power
    128             *
    129             * Changes the power (from 0 to 1) of a specific motor. \n
    130             * By default power is set to 1 for each motor which has no effect. \n
    131             * A value <1 will decrease the power of a motor sent to the reimplemented Bldc class through SetMotors. \n
    132             * The power value is applied after applying saturation between min value and max value.
    133             * So the resulting value cannot be higher than max value
    134             * but it can be lower than min value.
    135             *
    136             * \param motor_id id of the motor
    137             * \param value power value (from 0 to 1)
    138             *
    139             */
    140             void SetPower(int motor_id,float value);
     122  /*!
     123  * \brief Set motor power
     124  *
     125  * Changes the power (from 0 to 1) of a specific motor. \n
     126  * By default power is set to 1 for each motor which has no effect. \n
     127  * A value <1 will decrease the power of a motor sent to the reimplemented Bldc
     128  *class through SetMotors. \n
     129  * The power value is applied after applying saturation between min value and
     130  *max value.
     131  * So the resulting value cannot be higher than max value
     132  * but it can be lower than min value.
     133  *
     134  * \param motor_id id of the motor
     135  * \param value power value (from 0 to 1)
     136  *
     137  */
     138  void SetPower(int motor_id, float value);
    141139
    142             /*!
    143             * \brief Layout
    144             *
    145             * This the same Layout as passed to the constructor
    146             *
    147             * \return a Layout
    148             */
    149             gui::Layout* GetLayout(void) const;
     140  /*!
     141  * \brief Layout
     142  *
     143  * This the same Layout as passed to the constructor
     144  *
     145  * \return a Layout
     146  */
     147  gui::Layout *GetLayout(void) const;
    150148
    151             /*!
    152             * \brief Has speed measurement
    153             *
    154             * \return true if it has speed measurement
    155             */
    156             virtual bool HasSpeedMeasurement(void) const=0;
     149  /*!
     150  * \brief Has speed measurement
     151  *
     152  * \return true if it has speed measurement
     153  */
     154  virtual bool HasSpeedMeasurement(void) const = 0;
    157155
    158             /*!
    159             * \brief Has current measurement
    160             *
    161             * \return true if it has current measurement
    162             */
    163             virtual bool HasCurrentMeasurement(void) const=0;
     156  /*!
     157  * \brief Has current measurement
     158  *
     159  * \return true if it has current measurement
     160  */
     161  virtual bool HasCurrentMeasurement(void) const = 0;
    164162
    165         protected:
    166             core::cvmatrix *output;
     163protected:
     164  core::cvmatrix *output;
    167165
    168         private:
    169             /*!
    170             * \brief Update using provided datas
    171             *
    172             * Reimplemented from IODevice.
    173             *
    174             * \param data data from the parent to process
    175             */
    176             void UpdateFrom(const core::io_data *data);
     166private:
     167  /*!
     168  * \brief Update using provided datas
     169  *
     170  * Reimplemented from IODevice.
     171  *
     172  * \param data data from the parent to process
     173  */
     174  void UpdateFrom(const core::io_data *data);
    177175
    178             /*!
    179             * \brief Set motors values
    180             *
    181             * values size must be the same as MotorsCount()
    182             *
    183             * \param values set motors values
    184             */
    185             virtual void SetMotors(float* values)=0;
     176  /*!
     177  * \brief Set motors values
     178  *
     179  * values size must be the same as MotorsCount()
     180  *
     181  * \param values set motors values
     182  */
     183  virtual void SetMotors(float *values) = 0;
    186184
    187             class Bldc_impl* pimpl_;
    188     };
     185  class Bldc_impl *pimpl_;
     186};
    189187} // end namespace actuator
    190188} // end namespace framewor
  • trunk/include/FlairSensorActuator/Camera.h

    r4 r13  
    1818#include <cvimage.h>
    1919
    20 namespace flair
    21 {
    22     namespace gui
    23     {
    24         class GroupBox;
    25         class Tab;
    26         class TabWidget;
    27         class Picture;
    28         class GridLayout;
    29     }
     20namespace flair {
     21namespace gui {
     22class GroupBox;
     23class Tab;
     24class TabWidget;
     25class Picture;
     26class GridLayout;
     27}
    3028}
    3129
    32 namespace flair
    33 {
    34 namespace sensor
    35 {
    36     /*! \class Camera
    37     *
    38     * \brief Base class for Camera
    39     *
    40     * Use this class to define a custom Camera.
    41     *
    42     */
    43     class Camera : public core::IODevice
    44     {
    45         public:
    46             /*!
    47             * \brief Constructor
    48             *
    49             * Construct a Camera.
    50             *
    51             * \param parent parent
    52             * \param name name
    53             * \param width width
    54             * \param height height
    55             * \param format image format
    56             */
    57             Camera(const core::FrameworkManager* parent,std::string name,uint16_t width,uint16_t height,core::cvimage::Type::Format format);
     30namespace flair {
     31namespace sensor {
     32/*! \class Camera
     33*
     34* \brief Base class for Camera
     35*
     36* Use this class to define a custom Camera.
     37*
     38*/
     39class Camera : public core::IODevice {
     40public:
     41  /*!
     42  * \brief Constructor
     43  *
     44  * Construct a Camera.
     45  *
     46  * \param parent parent
     47  * \param name name
     48  * \param width width
     49  * \param height height
     50  * \param format image format
     51  */
     52  Camera(const core::FrameworkManager *parent, std::string name, uint16_t width,
     53         uint16_t height, core::cvimage::Type::Format format);
    5854
    59             /*!
    60             * \brief Constructor
    61             *
    62             * Construct a Camera. \n
    63             * This contructor must only be called for a simulated device.
    64             *
    65             * \param parent parent
    66             * \param name name
    67             */
    68             Camera(const core::IODevice* parent,std::string name);
     55  /*!
     56  * \brief Constructor
     57  *
     58  * Construct a Camera. \n
     59  * This contructor must only be called for a simulated device.
     60  *
     61  * \param parent parent
     62  * \param name name
     63  */
     64  Camera(const core::IODevice *parent, std::string name);
    6965
    70             /*!
    71             * \brief Destructor
    72             *
    73             */
    74             ~Camera();
     66  /*!
     67  * \brief Destructor
     68  *
     69  */
     70  ~Camera();
    7571
    76             /*!
    77             * \brief Use default plot
    78             *
    79             * \param image image to display
    80             */
    81             void UseDefaultPlot(const core::cvimage *image);
     72  /*!
     73  * \brief Use default plot
     74  *
     75  * \param image image to display
     76  */
     77  void UseDefaultPlot(const core::cvimage *image);
    8278
    83             /*!
    84             * \brief get Layout
    85             *
    86             * \return a Layout available
    87             */
    88             gui::GridLayout* GetLayout(void) const;
     79  /*!
     80  * \brief get Layout
     81  *
     82  * \return a Layout available
     83  */
     84  gui::GridLayout *GetLayout(void) const;
    8985
    90             /*!
    91             * \brief plot tab
    92             *
    93             * \return plot tab
    94             */
    95             gui::Tab* GetPlotTab(void) const;
     86  /*!
     87  * \brief plot tab
     88  *
     89  * \return plot tab
     90  */
     91  gui::Tab *GetPlotTab(void) const;
    9692
    97             /*!
    98             * \brief Save picture to file
    99             *
    100             * \param filename filename
    101             */
    102             void SaveToFile(std::string filename) const;
     93  /*!
     94  * \brief Save picture to file
     95  *
     96  * \param filename filename
     97  */
     98  void SaveToFile(std::string filename) const;
    10399
    104             /*!
    105             * \brief Width
    106             *
    107             * \return width
    108             */
    109             uint16_t Width(void) const;
     100  /*!
     101  * \brief Width
     102  *
     103  * \return width
     104  */
     105  uint16_t Width(void) const;
    110106
    111             /*!
    112             * \brief Height
    113             *
    114             * \return height
    115             */
    116             uint16_t Height(void) const;
     107  /*!
     108  * \brief Height
     109  *
     110  * \return height
     111  */
     112  uint16_t Height(void) const;
    117113
    118              /*!
    119             * \brief Output matrix
    120             *
    121             * Output matrix is of the same size as declared in constructor. \n
    122             *
    123             * \return the output matrix
    124             */
    125             core::cvimage* Output(void);
     114  /*!
     115 * \brief Output matrix
     116 *
     117 * Output matrix is of the same size as declared in constructor. \n
     118 *
     119 * \return the output matrix
     120 */
     121  core::cvimage *Output(void);
    126122
    127             core::DataType const &GetOutputDataType() const;
     123  core::DataType const &GetOutputDataType() const;
    128124
    129         protected:
    130             /*!
    131             * \brief get GroupBox
    132             *
    133             * \return a GroupBox available
    134             */
    135             gui::GroupBox* GetGroupBox(void) const;
     125protected:
     126  /*!
     127  * \brief get GroupBox
     128  *
     129  * \return a GroupBox available
     130  */
     131  gui::GroupBox *GetGroupBox(void) const;
    136132
    137             core::cvimage *output;
     133  core::cvimage *output;
    138134
    139         private:
    140             gui::Tab *main_tab,*sensor_tab,*plot_tab;
    141             gui::TabWidget *tab;
    142             gui::GroupBox* setup_groupbox;
    143             gui::GridLayout* setup_layout;
    144     };
     135private:
     136  gui::Tab *main_tab, *sensor_tab, *plot_tab;
     137  gui::TabWidget *tab;
     138  gui::GroupBox *setup_groupbox;
     139  gui::GridLayout *setup_layout;
     140};
    145141} // end namespace sensor
    146142} // end namespace flair
  • trunk/include/FlairSensorActuator/Controller.h

    r4 r13  
    2323
    2424namespace flair {
    25     namespace core {
    26         class Message;
    27     }
     25namespace core {
     26class Message;
     27}
    2828}
    2929
    30 namespace flair { namespace sensor {
     30namespace flair {
     31namespace sensor {
    3132
    32     enum class ControllerAction {
    33         SetLedOn,
    34         SetLedOff,
    35         Rumble,
    36         FlashLed,
    37         Exit
    38     };
     33enum class ControllerAction { SetLedOn, SetLedOff, Rumble, FlashLed, Exit };
    3934
    40     class RumbleMessage: public core::Message {
    41     public:
    42         RumbleMessage(unsigned int leftForce,unsigned int leftTimeout,unsigned int rightForce,unsigned int rightTimeout);
    43         unsigned int GetLeftForce() const;
    44         unsigned int GetLeftTimeout() const;
    45         unsigned int GetRightForce() const;
    46         unsigned int GetRightTimeout() const;
    47         void SetLeftForce(unsigned int leftForce);
    48         void SetLeftTimeout(unsigned int leftTimeout);
    49         void SetRightForce(unsigned int rightForce);
    50         void SetRightTimeout(unsigned int rightTimeout);
    51     private:
    52         static const unsigned int leftForceOffset=sizeof(ControllerAction);
    53         static const unsigned int leftTimeoutOffset=sizeof(ControllerAction)+sizeof(unsigned int);
    54         static const unsigned int rightForceOffset=sizeof(ControllerAction)+2*sizeof(unsigned int);
    55         static const unsigned int rightTimeoutOffset=sizeof(ControllerAction)+3*sizeof(unsigned int);
    56     };
     35class RumbleMessage : public core::Message {
     36public:
     37  RumbleMessage(unsigned int leftForce, unsigned int leftTimeout,
     38                unsigned int rightForce, unsigned int rightTimeout);
     39  unsigned int GetLeftForce() const;
     40  unsigned int GetLeftTimeout() const;
     41  unsigned int GetRightForce() const;
     42  unsigned int GetRightTimeout() const;
     43  void SetLeftForce(unsigned int leftForce);
     44  void SetLeftTimeout(unsigned int leftTimeout);
     45  void SetRightForce(unsigned int rightForce);
     46  void SetRightTimeout(unsigned int rightTimeout);
    5747
    58     class SwitchLedMessage: public core::Message {
    59     public:
    60         SwitchLedMessage(bool isOn,unsigned int ledId);
    61         bool IsOn() const;
    62         unsigned int GetLedId() const;
    63         void SetOn();
    64         void SetOff();
    65         void SetLedId(unsigned int ledId);
    66     private:
    67         static const unsigned int isOnOffset=sizeof(ControllerAction);
    68         static const unsigned int ledIdOffset=sizeof(ControllerAction)+sizeof(bool);
    69     };
     48private:
     49  static const unsigned int leftForceOffset = sizeof(ControllerAction);
     50  static const unsigned int leftTimeoutOffset =
     51      sizeof(ControllerAction) + sizeof(unsigned int);
     52  static const unsigned int rightForceOffset =
     53      sizeof(ControllerAction) + 2 * sizeof(unsigned int);
     54  static const unsigned int rightTimeoutOffset =
     55      sizeof(ControllerAction) + 3 * sizeof(unsigned int);
     56};
    7057
    71     class FlashLedMessage: public core::Message {
    72     public:
    73         FlashLedMessage(unsigned int ledId,unsigned int onTime,unsigned int offTime);
    74         unsigned int GetLedId() const;
    75         unsigned int GetOnTime() const;
    76         unsigned int GetOffTime() const;
    77         void SetLedId(unsigned int ledId);
    78         void SetOnTime(unsigned int onTime);
    79         void SetOffTime(unsigned int offTime);
    80     private:
    81         static const unsigned int ledIdOffset=sizeof(ControllerAction);
    82         static const unsigned int onTimeOffset=sizeof(ControllerAction)+sizeof(unsigned int);
    83         static const unsigned int offTimeOffset=sizeof(ControllerAction)+2*sizeof(unsigned int);
    84     };
     58class SwitchLedMessage : public core::Message {
     59public:
     60  SwitchLedMessage(bool isOn, unsigned int ledId);
     61  bool IsOn() const;
     62  unsigned int GetLedId() const;
     63  void SetOn();
     64  void SetOff();
     65  void SetLedId(unsigned int ledId);
    8566
    86 }}
     67private:
     68  static const unsigned int isOnOffset = sizeof(ControllerAction);
     69  static const unsigned int ledIdOffset =
     70      sizeof(ControllerAction) + sizeof(bool);
     71};
     72
     73class FlashLedMessage : public core::Message {
     74public:
     75  FlashLedMessage(unsigned int ledId, unsigned int onTime,
     76                  unsigned int offTime);
     77  unsigned int GetLedId() const;
     78  unsigned int GetOnTime() const;
     79  unsigned int GetOffTime() const;
     80  void SetLedId(unsigned int ledId);
     81  void SetOnTime(unsigned int onTime);
     82  void SetOffTime(unsigned int offTime);
     83
     84private:
     85  static const unsigned int ledIdOffset = sizeof(ControllerAction);
     86  static const unsigned int onTimeOffset =
     87      sizeof(ControllerAction) + sizeof(unsigned int);
     88  static const unsigned int offTimeOffset =
     89      sizeof(ControllerAction) + 2 * sizeof(unsigned int);
     90};
     91}
     92}
    8793
    8894#endif // CONTROLLER_H
  • trunk/include/FlairSensorActuator/Gps.h

    r4 r13  
    1717#include <nmea/nmea.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class cvmatrix;
    24         class FrameworkManager;
    25         class GeoCoordinate;
    26         class Vector3D;
    27     }
    28     namespace gui
    29     {
    30         class Layout;
    31         class DataPlot1D;
    32         class Tab;
    33         class TabWidget;
    34         class PushButton;
    35         class Map;
    36         class Label;
    37     }
     19namespace flair {
     20namespace core {
     21class cvmatrix;
     22class FrameworkManager;
     23class GeoCoordinate;
     24class Vector3D;
    3825}
    39 
    40 namespace flair
    41 {
    42 namespace sensor
    43 {
    44     /*! \class Gps
    45     *
    46     * \brief Base class for GPS
    47     */
    48     class Gps : public core::IODevice
    49     {
    50         public:
    51             /*!
    52             \enum FixQuality_t
    53             \brief Fix qualty indicators
    54             */
    55             enum class FixQuality_t {
    56                 Invalid=0,/*!< invalid */
    57                 Gps=1,/*!< Gps */
    58                 DGps=2,/*!< Differential Gps */
    59                 Pps=3,/*!< Pps */
    60                 Rtk=4,/*!< RTK */
    61                 RtkFloat=5,/*!< RTK float */
    62                 Estimated=6,/*!< Estimated */
    63                 Manual=7,/*!< Manual */
    64                 Simulation=8,/*!< Simulation */
    65                 };
    66 
    67             /*!
    68             \enum NMEAFlags_t
    69             \brief NMEA flags
    70             */
    71             enum NMEAFlags_t {
    72                 GGA=0x01,/*!< GGA */
    73                 VTG=0x02,/*!< VTG */
    74                 GST=0x04,/*!< GST */
    75                 };
    76 
    77             /*!
    78             * \brief Constructor
    79             *
    80             * Construct a Gps.
    81             *
    82             * \param parent parent
    83             * \param name name
    84             * \param NMEAFlags NMEA sentances to enable
    85             */
    86             Gps(const core::FrameworkManager* parent,std::string name,NMEAFlags_t NMEAFlags);
    87 
    88             /*!
    89             * \brief Destructor
    90             *
    91             */
    92             ~Gps();
    93 
    94             /*!
    95             * \brief Use default plot
    96             *
    97             */
    98             void UseDefaultPlot(void);
    99 
    100             /*!
    101             * \brief East plot
    102             *
    103             * \return east plot
    104             */
    105             gui::DataPlot1D* EPlot(void) const;
    106 
    107             /*!
    108             * \brief North plot
    109             *
    110             * \return north plot
    111             */
    112             gui::DataPlot1D* NPlot(void) const;
    113 
    114             /*!
    115             * \brief Up plot
    116             *
    117             * \return up plot
    118             */
    119             gui::DataPlot1D* UPlot(void) const;
    120 
    121             /*!
    122             * \brief East velocity plot
    123             *
    124             * \return east velocity plot
    125             */
    126             gui::DataPlot1D* VEPlot(void) const;
    127 
    128             /*!
    129             * \brief North velocity plot
    130             *
    131             * \return north velocity plot
    132             */
    133             gui::DataPlot1D* VNPlot(void) const;
    134 
    135             /*!
    136             * \brief Main tab
    137             *
    138             * \return main tab
    139             */
    140             gui::TabWidget* GetTab(void) const;
    141 
    142             /*!
    143             * \brief Setup Layout
    144             *
    145             * \return setup Layout
    146             */
    147             gui::Layout* GetLayout(void) const;
    148 
    149             /*!
    150             * \brief Plot tab
    151             *
    152             * \return plot Tab
    153             */
    154             gui::Tab* GetPlotTab(void) const;
    155 
    156             /*!
    157             * \brief Number of used satellites
    158             *
    159             * \return number of used satellites
    160             */
    161             uint16_t NbSat(void) const;
    162 
    163             /*!
    164             * \brief Fix Quality
    165             *
    166             * \return fix quality
    167             */
    168             FixQuality_t FixQuality(void) const;
    169 
    170             /*!
    171             * \brief Set reference for ENU coordinates
    172             *
    173             * The actual position is used as reference to calculate
    174             * ENU coordinates.
    175             *
    176             * \return fix quality
    177             */
    178             void SetRef(void);
    179 
    180             /*!
    181             * \brief Get ENU position
    182             *
    183             * \param point to store position
    184             */
    185             void GetENUPosition(core::Vector3D *point);
    186 
    187         protected:
    188             /*!
    189             * \brief Parse a NMEA frame
    190             *
    191             * This function must be called by the reimplemented class. \n
    192             * When a frame is parsed, GPS datas are filled.
    193             *
    194             * \param frame NMEA frame
    195             * \param frame_size frame size
    196             *
    197             */
    198             void parseFrame(const char *frame, int frame_size);
    199 
    200             NMEAFlags_t NMEAFlags;
    201 
    202         protected:
    203             core::GeoCoordinate *position;
    204 
    205         private:
    206             /*!
    207             * \brief Update using provided datas
    208             *
    209             * Reimplemented from IODevice.
    210             *
    211             * \param data data from the parent to process
    212             */
    213             void UpdateFrom(const core::io_data *data){};
    214 
    215             gui::Tab *main_tab,*sensor_tab;
    216             gui::TabWidget* tab;
    217             gui::PushButton *button_ref;
    218             gui::DataPlot1D* e_plot;
    219             gui::DataPlot1D* n_plot;
    220             gui::DataPlot1D* u_plot;
    221             gui::DataPlot1D* ve_plot;
    222             gui::DataPlot1D* vn_plot;
    223             gui::Tab* plot_tab;
    224             gui::Map *map;
    225             gui::Label *nb_sat_label,*fix_label;
    226             uint16_t nb_sat;
    227             FixQuality_t fix;
    228             bool take_ref;
    229             nmeaINFO info;
    230             nmeaPARSER parser;
    231             nmeaGPGGA pack;
    232             nmeaPOS pos;
    233             double lat_ref,long_ref,alt_ref;
    234 
    235             //matrix
    236             core::cvmatrix *output;
    237     };
     26namespace gui {
     27class Layout;
     28class DataPlot1D;
     29class Tab;
     30class TabWidget;
     31class PushButton;
     32class Map;
     33class Label;
     34}
     35}
     36
     37namespace flair {
     38namespace sensor {
     39/*! \class Gps
     40*
     41* \brief Base class for GPS
     42*/
     43class Gps : public core::IODevice {
     44public:
     45  /*!
     46  \enum FixQuality_t
     47  \brief Fix qualty indicators
     48  */
     49  enum class FixQuality_t {
     50    Invalid = 0,    /*!< invalid */
     51    Gps = 1,        /*!< Gps */
     52    DGps = 2,       /*!< Differential Gps */
     53    Pps = 3,        /*!< Pps */
     54    Rtk = 4,        /*!< RTK */
     55    RtkFloat = 5,   /*!< RTK float */
     56    Estimated = 6,  /*!< Estimated */
     57    Manual = 7,     /*!< Manual */
     58    Simulation = 8, /*!< Simulation */
     59  };
     60
     61  /*!
     62  \enum NMEAFlags_t
     63  \brief NMEA flags
     64  */
     65  enum NMEAFlags_t {
     66    GGA = 0x01, /*!< GGA */
     67    VTG = 0x02, /*!< VTG */
     68    GST = 0x04, /*!< GST */
     69  };
     70
     71  /*!
     72  * \brief Constructor
     73  *
     74  * Construct a Gps.
     75  *
     76  * \param parent parent
     77  * \param name name
     78  * \param NMEAFlags NMEA sentances to enable
     79  */
     80  Gps(const core::FrameworkManager *parent, std::string name,
     81      NMEAFlags_t NMEAFlags);
     82
     83  /*!
     84  * \brief Destructor
     85  *
     86  */
     87  ~Gps();
     88
     89  /*!
     90  * \brief Use default plot
     91  *
     92  */
     93  void UseDefaultPlot(void);
     94
     95  /*!
     96  * \brief East plot
     97  *
     98  * \return east plot
     99  */
     100  gui::DataPlot1D *EPlot(void) const;
     101
     102  /*!
     103  * \brief North plot
     104  *
     105  * \return north plot
     106  */
     107  gui::DataPlot1D *NPlot(void) const;
     108
     109  /*!
     110  * \brief Up plot
     111  *
     112  * \return up plot
     113  */
     114  gui::DataPlot1D *UPlot(void) const;
     115
     116  /*!
     117  * \brief East velocity plot
     118  *
     119  * \return east velocity plot
     120  */
     121  gui::DataPlot1D *VEPlot(void) const;
     122
     123  /*!
     124  * \brief North velocity plot
     125  *
     126  * \return north velocity plot
     127  */
     128  gui::DataPlot1D *VNPlot(void) const;
     129
     130  /*!
     131  * \brief Main tab
     132  *
     133  * \return main tab
     134  */
     135  gui::TabWidget *GetTab(void) const;
     136
     137  /*!
     138  * \brief Setup Layout
     139  *
     140  * \return setup Layout
     141  */
     142  gui::Layout *GetLayout(void) const;
     143
     144  /*!
     145  * \brief Plot tab
     146  *
     147  * \return plot Tab
     148  */
     149  gui::Tab *GetPlotTab(void) const;
     150
     151  /*!
     152  * \brief Number of used satellites
     153  *
     154  * \return number of used satellites
     155  */
     156  uint16_t NbSat(void) const;
     157
     158  /*!
     159  * \brief Fix Quality
     160  *
     161  * \return fix quality
     162  */
     163  FixQuality_t FixQuality(void) const;
     164
     165  /*!
     166  * \brief Set reference for ENU coordinates
     167  *
     168  * The actual position is used as reference to calculate
     169  * ENU coordinates.
     170  *
     171  * \return fix quality
     172  */
     173  void SetRef(void);
     174
     175  /*!
     176  * \brief Get ENU position
     177  *
     178  * \param point to store position
     179  */
     180  void GetENUPosition(core::Vector3D *point);
     181
     182protected:
     183  /*!
     184  * \brief Parse a NMEA frame
     185  *
     186  * This function must be called by the reimplemented class. \n
     187  * When a frame is parsed, GPS datas are filled.
     188  *
     189  * \param frame NMEA frame
     190  * \param frame_size frame size
     191  *
     192  */
     193  void parseFrame(const char *frame, int frame_size);
     194
     195  NMEAFlags_t NMEAFlags;
     196
     197protected:
     198  core::GeoCoordinate *position;
     199
     200private:
     201  /*!
     202  * \brief Update using provided datas
     203  *
     204  * Reimplemented from IODevice.
     205  *
     206  * \param data data from the parent to process
     207  */
     208  void UpdateFrom(const core::io_data *data){};
     209
     210  gui::Tab *main_tab, *sensor_tab;
     211  gui::TabWidget *tab;
     212  gui::PushButton *button_ref;
     213  gui::DataPlot1D *e_plot;
     214  gui::DataPlot1D *n_plot;
     215  gui::DataPlot1D *u_plot;
     216  gui::DataPlot1D *ve_plot;
     217  gui::DataPlot1D *vn_plot;
     218  gui::Tab *plot_tab;
     219  gui::Map *map;
     220  gui::Label *nb_sat_label, *fix_label;
     221  uint16_t nb_sat;
     222  FixQuality_t fix;
     223  bool take_ref;
     224  nmeaINFO info;
     225  nmeaPARSER parser;
     226  nmeaGPGGA pack;
     227  nmeaPOS pos;
     228  double lat_ref, long_ref, alt_ref;
     229
     230  // matrix
     231  core::cvmatrix *output;
     232};
    238233} // end namespace sensor
    239234} // end namespace framewor
  • trunk/include/FlairSensorActuator/Gx3_25_imu.h

    r4 r13  
    1818
    1919namespace flair {
    20     namespace core {
    21         class FrameworkManager;
    22         class SerialPort;
    23     }
     20namespace core {
     21class FrameworkManager;
     22class SerialPort;
     23}
    2424}
    2525
    2626class Gx3_25_imu_impl;
    2727
    28 namespace flair { namespace sensor {
    29     /*! \class Gx3_25_imu
    30     *
    31     * \brief Class for 3dmgx3-25 Imu
    32     */
    33     class Gx3_25_imu : public Imu, public core::Thread {
    34         friend class ::Gx3_25_imu_impl;
     28namespace flair {
     29namespace sensor {
     30/*! \class Gx3_25_imu
     31*
     32* \brief Class for 3dmgx3-25 Imu
     33*/
     34class Gx3_25_imu : public Imu, public core::Thread {
     35  friend class ::Gx3_25_imu_impl;
    3536
    36         public:
    37             /*!
    38             \enum Command_t
    39             \brief Command for the continuous mode
    40             */
    41             enum Command_t{
    42                 EulerAnglesAndAngularRates=0xcf,/*!< Euler angles and angular rates */
    43                 AccelerationAngularRateAndOrientationMatrix=0xc8,/*!< Acceleration, angular rate and orientation matrix */
    44                 };
     37public:
     38  /*!
     39  \enum Command_t
     40  \brief Command for the continuous mode
     41  */
     42  enum Command_t {
     43    EulerAnglesAndAngularRates = 0xcf, /*!< Euler angles and angular rates */
     44    AccelerationAngularRateAndOrientationMatrix =
     45        0xc8, /*!< Acceleration, angular rate and orientation matrix */
     46  };
    4547
    46             /*!
    47             * \brief Constructor
    48             *
    49             * Construct a Gx3_25_imu.
    50             *
    51             * \param parent parent
    52             * \param name name
    53             * \param serialport SerialPort
    54             * \param command command for continuous mode
    55             * \param priority priority of the Thread
    56             */
    57             Gx3_25_imu(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,Command_t command,uint8_t priority);
     48  /*!
     49  * \brief Constructor
     50  *
     51  * Construct a Gx3_25_imu.
     52  *
     53  * \param parent parent
     54  * \param name name
     55  * \param serialport SerialPort
     56  * \param command command for continuous mode
     57  * \param priority priority of the Thread
     58  */
     59  Gx3_25_imu(const core::FrameworkManager *parent, std::string name,
     60             core::SerialPort *serialport, Command_t command, uint8_t priority);
    5861
    59             /*!
    60             * \brief Destructor
    61             *
    62             */
    63             ~Gx3_25_imu();
     62  /*!
     63  * \brief Destructor
     64  *
     65  */
     66  ~Gx3_25_imu();
    6467
    65         private:
    66             /*!
    67             * \brief Run function
    68             *
    69             * Reimplemented from Thread.
    70             *
    71             */
    72             void Run(void);
     68private:
     69  /*!
     70  * \brief Run function
     71  *
     72  * Reimplemented from Thread.
     73  *
     74  */
     75  void Run(void);
    7376
    74             /*!
    75             * \brief Update using provided datas
    76             *
    77             * Reimplemented from IODevice.
    78             *
    79             * \param data data from the parent to process
    80             */
    81             void UpdateFrom(const core::io_data *data){};
     77  /*!
     78  * \brief Update using provided datas
     79  *
     80  * Reimplemented from IODevice.
     81  *
     82  * \param data data from the parent to process
     83  */
     84  void UpdateFrom(const core::io_data *data){};
    8285
    83             class Gx3_25_imu_impl* pimpl_;
    84     };
     86  class Gx3_25_imu_impl *pimpl_;
     87};
    8588} // end namespace sensor
    8689} // end namespace flair
  • trunk/include/FlairSensorActuator/HokuyoUTM30Lx.h

    r4 r13  
    2121#include <vector>
    2222
    23 namespace flair
    24 {
    25     namespace core
    26     {
    27         class cvmatrix;
    28         class FrameworkManager;
    29         class SerialPort;
    30         class Mutex;
    31     }
    32     namespace gui
    33     {
    34         class Tab;
    35         class TabWidget;
    36         class RangeFinderPlot;
    37     }
     23namespace flair {
     24namespace core {
     25class cvmatrix;
     26class FrameworkManager;
     27class SerialPort;
     28class Mutex;
     29}
     30namespace gui {
     31class Tab;
     32class TabWidget;
     33class RangeFinderPlot;
     34}
    3835}
    3936
    40 namespace flair
    41 {
    42 namespace sensor
    43 {
    44     /*! \class HokuyoUTM30Lx
    45     *
    46     * \brief Classe intégrant le telemetre laser Hokuyo UTM 30lx
    47     */
    48     class HokuyoUTM30Lx : public core::Thread, public LaserRangeFinder
    49     {
    50         public:
     37namespace flair {
     38namespace sensor {
     39/*! \class HokuyoUTM30Lx
     40*
     41* \brief Classe intégrant le telemetre laser Hokuyo UTM 30lx
     42*/
     43class HokuyoUTM30Lx : public core::Thread, public LaserRangeFinder {
     44public:
     45  /*!
     46 * \brief Constructor
     47 *
     48 * Construct a Hokuyo UTM30-Lx.
     49 *
     50 * \param parent parent
     51 * \param name name
     52 * \param serialport serialport
     53 * \param priority priority of the Thread
     54 */
     55  HokuyoUTM30Lx(const core::FrameworkManager *parent, std::string name,
     56                core::SerialPort *serialport, uint8_t priority);
     57  void getMesure(int startStep, int endStep, int clusterCount, int interval,
     58                 int scanNumber = 0);
     59  core::cvmatrix *getDatas(void);
    5160
    52              /*!
    53             * \brief Constructor
    54             *
    55             * Construct a Hokuyo UTM30-Lx.
    56             *
    57             * \param parent parent
    58             * \param name name
    59             * \param serialport serialport
    60             * \param priority priority of the Thread
    61             */
    62             HokuyoUTM30Lx(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,uint8_t priority);
    63             void getMesure(int startStep, int endStep,int clusterCount, int interval, int scanNumber=0);
    64             core::cvmatrix* getDatas(void);
     61  /*!
     62  * \brief Use default plot
     63  *
     64  */
     65  void UseDefaultPlot(void);
     66  /*!
     67  * \brief Destructor
     68  *
     69  */
     70  ~HokuyoUTM30Lx();
    6571
    66             /*!
    67             * \brief Use default plot
    68             *
    69             */
    70             void UseDefaultPlot(void);
    71             /*!
    72             * \brief Destructor
    73             *
    74             */
    75             ~HokuyoUTM30Lx();
     72private:
     73  core::SerialPort *serialport;
     74  core::Mutex *bufRetMut;
     75  core::Mutex *sendingCmdMut;
     76  gui::Tab *main_tab;
     77  gui::TabWidget *tab;
     78  gui::RangeFinderPlot *plot;
    7679
    77         private:
    78             core::SerialPort *serialport;
    79             core::Mutex* bufRetMut;
    80             core::Mutex* sendingCmdMut;
    81             gui::Tab* main_tab;
    82             gui::TabWidget* tab;
    83             gui::RangeFinderPlot* plot;
     80  // matrix
     81  core::cvmatrix *output;
    8482
    85             //matrix
    86             core::cvmatrix *output;
     83  std::queue<std::string> bufRet;
    8784
    88                         std::queue<std::string> bufRet;
     85  /*!
     86  * \brief Run function
     87  *
     88  * Reimplemented from Thread.
     89  *
     90  */
     91  void Run(void);
     92  /*!
     93  * \brief Send a command
     94  * \param command Command to send (see Hokuyo UTM 30-LX doc for more
     95  * informations)
     96  * \return Return code
     97  */
     98  std::string sendCommand(std::string command);
     99  /*!
     100  * \brief Start the laser
     101  *
     102  */
     103  void startLaser(void);
     104  /*!
     105  * \brief Stop the laser
     106  *
     107  */
     108  void stopLaser(void);
     109  /*!
     110* \brief Stop and reset the laser's settings
     111*
     112*/
     113  void resetConfig(void);
     114  /*!
     115* \brief Decode incomming datas
     116* \param datas Datas to decode
     117* \param startStep Set the first mesured point
     118* Decode mesured points from incoming datas and fill the output matrix
     119*/
     120  void decodeDatas(std::vector<std::string> datas, int startStep);
     121  /*!
     122  * \brief Explode a string into a vector
     123  * \param str The string to explode
     124  * \param delimiter The character separating elements
     125  * \return A vector containing the elements
     126  */
     127  static std::vector<std::string> explode(const std::string str,
     128                                          char delimiter);
     129  /*!
     130* \brief Calculate the checksum
     131* \param code Data from which calculate
     132* \param byte Data's size
     133* \return A character corresponding to the code's checksum
     134*/
     135  static int encodeSum(const char *code, int byte);
     136  /*!
     137* \brief Check if a data correspond to its checksum
     138* \param data Datas to check
     139*/
     140  static bool checkSum(std::string data);
     141  /*!
     142* \brief Decode datas using the 2 character encoding
     143* \param data Datas to decode
     144* \return Decoded datas
     145*/
     146  static float decode2car(const char *data);
     147  /*!
     148* \brief Decode datas using the 3 character encoding
     149* \param data Datas to decode
     150* \return Decoded datas
     151*/
     152  static float decode3car(const char *data);
     153  /*!
     154* \brief Decode datas using the 4 character encoding
     155* \param data Datas to decode
     156* \return Decoded datas
     157*/
     158  static float decode4car(const char *data);
    89159
    90             /*!
    91             * \brief Run function
    92             *
    93             * Reimplemented from Thread.
    94             *
    95             */
    96             void Run(void);
    97             /*!
    98             * \brief Send a command
    99             * \param command Command to send (see Hokuyo UTM 30-LX doc for more informations)
    100             * \return Return code
    101             */
    102             std::string sendCommand(std::string command);
    103             /*!
    104             * \brief Start the laser
    105             *
    106             */
    107             void startLaser(void);
    108             /*!
    109             * \brief Stop the laser
    110             *
    111             */
    112                         void stopLaser(void);
    113                         /*!
    114             * \brief Stop and reset the laser's settings
    115             *
    116             */
    117                     void resetConfig(void);
    118                     /*!
    119             * \brief Decode incomming datas
    120             * \param datas Datas to decode
    121             * \param startStep Set the first mesured point
    122             * Decode mesured points from incoming datas and fill the output matrix
    123             */
    124                     void decodeDatas(std::vector<std::string> datas, int startStep);
    125             /*!
    126             * \brief Explode a string into a vector
    127             * \param str The string to explode
    128             * \param delimiter The character separating elements
    129             * \return A vector containing the elements
    130             */
    131                         static std::vector<std::string> explode(const std::string str, char delimiter);
    132                         /*!
    133             * \brief Calculate the checksum
    134             * \param code Data from which calculate
    135             * \param byte Data's size
    136             * \return A character corresponding to the code's checksum
    137             */
    138                         static int encodeSum(const char* code, int byte);
    139                         /*!
    140             * \brief Check if a data correspond to its checksum
    141             * \param data Datas to check
    142             */
    143                         static bool checkSum(std::string data);
    144                         /*!
    145             * \brief Decode datas using the 2 character encoding
    146             * \param data Datas to decode
    147             * \return Decoded datas
    148             */
    149                         static float decode2car(const char* data);
    150                         /*!
    151             * \brief Decode datas using the 3 character encoding
    152             * \param data Datas to decode
    153             * \return Decoded datas
    154             */
    155                         static float decode3car(const char* data);
    156                         /*!
    157             * \brief Decode datas using the 4 character encoding
    158             * \param data Datas to decode
    159             * \return Decoded datas
    160             */
    161                         static float decode4car(const char* data);
    162 
    163                         /*!
    164             * \brief Update using provided datas
    165             *
    166             * Reimplemented from IODevice.
    167             *
    168             * \param data data from the parent to process
    169             */
    170             void UpdateFrom(const core::io_data *data){};
    171 
    172     };
     160  /*!
     161* \brief Update using provided datas
     162*
     163* Reimplemented from IODevice.
     164*
     165* \param data data from the parent to process
     166*/
     167  void UpdateFrom(const core::io_data *data){};
     168};
    173169} // end namespace sensor
    174170} // end namespace framewor
  • trunk/include/FlairSensorActuator/HostEthController.h

    r4 r13  
    1111//  version:    $Id: $
    1212//
    13 //  purpose:    Base class for host side remote controls that talks to target side through ethernet connection
     13//  purpose:    Base class for host side remote controls that talks to target
     14//  side through ethernet connection
    1415//
    1516//
     
    2425
    2526namespace flair {
    26     namespace core {
    27         class FrameworkManager;
    28         class cvmatrix;
    29         class TcpSocket;
    30         class Socket;
    31         class Mutex;
    32     }
    33     namespace gui {
    34         class Tab;
    35         class TabWidget;
    36         class DataPlot1D;
    37     }
     27namespace core {
     28class FrameworkManager;
     29class cvmatrix;
     30class TcpSocket;
     31class Socket;
     32class Mutex;
     33}
     34namespace gui {
     35class Tab;
     36class TabWidget;
     37class DataPlot1D;
     38}
    3839}
    3940
    40 namespace flair { namespace sensor {
    41     enum class ControllerAction;
     41namespace flair {
     42namespace sensor {
     43enum class ControllerAction;
    4244
    43     /*! \class HostEthController
    44     *
    45     * \brief Base Class for host side remote controls that talks to target side through ethernet connection
    46     *
    47     * There are 2 communication channels:
    48     *   - 1 connection with the ground station to display the values. Output for analog sticks is normalized in the range [-1, 1] (float values)
    49     *   - 1 connection with the target to send the controller values (and receive controller state modification requests)
    50     */
    51     class HostEthController : public core::Thread, public core::IODevice {
    52     public:
    53         HostEthController(const core::FrameworkManager* parent,std::string name,std::string address,int port,uint32_t period=10,uint32_t _bitsPerAxis=7,uint8_t priority=0);
    54         ~HostEthController();
    55         void DrawUserInterface();
    56     protected:
    57         std::string controllerName;
    58         core::TcpSocket *controlSocket; //connection to the target
    59         core::Socket *dataSocket;
    60         std::string targetAddress;
    61         int targetPort;
    62         gui::Tab *tab;
    63         gui::TabWidget *tabWidget;
    64         virtual bool IsDataFrameReady() { return true;};
    65         virtual void CompleteDataFrameGrab() {};
    66 //        int8_t *datas;
    67 //        uint8_t dataSize;
    68         char *dataFrameBuffer;
    69         size_t dataFrameSize;
    70         virtual void ProcessMessage(core::Message *controllerAction) {};
     45/*! \class HostEthController
     46*
     47* \brief Base Class for host side remote controls that talks to target side
     48*through ethernet connection
     49*
     50* There are 2 communication channels:
     51*   - 1 connection with the ground station to display the values. Output for
     52*analog sticks is normalized in the range [-1, 1] (float values)
     53*   - 1 connection with the target to send the controller values (and receive
     54*controller state modification requests)
     55*/
     56class HostEthController : public core::Thread, public core::IODevice {
     57public:
     58  HostEthController(const core::FrameworkManager *parent, std::string name,
     59                    std::string address, int port, uint32_t period = 10,
     60                    uint32_t _bitsPerAxis = 7, uint8_t priority = 0);
     61  ~HostEthController();
     62  void DrawUserInterface();
    7163
    72         virtual std::string GetAxisDescription(unsigned int axis);
    73         virtual void GetAxisData()=0; //responsible for getting the axis data from the hardware
    74         unsigned int axisNumber;
    75         core::cvmatrix* axis;
    76         gui::DataPlot1D **axisPlot;
    77         uint32_t bitsPerAxis;
    78         uint32_t nativeBitsPerAxis;
     64protected:
     65  std::string controllerName;
     66  core::TcpSocket *controlSocket; // connection to the target
     67  core::Socket *dataSocket;
     68  std::string targetAddress;
     69  int targetPort;
     70  gui::Tab *tab;
     71  gui::TabWidget *tabWidget;
     72  virtual bool IsDataFrameReady() { return true; };
     73  virtual void CompleteDataFrameGrab(){};
     74  //        int8_t *datas;
     75  //        uint8_t dataSize;
     76  char *dataFrameBuffer;
     77  size_t dataFrameSize;
     78  virtual void ProcessMessage(core::Message *controllerAction){};
    7979
    80         virtual std::string GetButtonDescription(unsigned int button);
    81         virtual void GetButtonData()=0; //responsible for getting the button data from the hardware
    82         unsigned int buttonNumber;
    83         core::cvmatrix* button;
    84         uint8_t buttonOffset;
    85         bool meaningfulDataAvailable;
     80  virtual std::string GetAxisDescription(unsigned int axis);
     81  virtual void
     82  GetAxisData() = 0; // responsible for getting the axis data from the hardware
     83  unsigned int axisNumber;
     84  core::cvmatrix *axis;
     85  gui::DataPlot1D **axisPlot;
     86  uint32_t bitsPerAxis;
     87  uint32_t nativeBitsPerAxis;
    8688
    87     private:
    88         class DataSender : public core::Thread {
    89         public:
    90             DataSender(Object* parent,HostEthController* hostEthController,std::string name,uint8_t priority=0);
    91             void Run();
    92         private:
    93             HostEthController* hostEthController;
    94         };
    95         DataSender *dataSender;
     89  virtual std::string GetButtonDescription(unsigned int button);
     90  virtual void GetButtonData() = 0; // responsible for getting the button data
     91                                    // from the hardware
     92  unsigned int buttonNumber;
     93  core::cvmatrix *button;
     94  uint8_t buttonOffset;
     95  bool meaningfulDataAvailable;
    9696
    97         bool ControllerInitialization();
    98         bool ConnectedWithTarget();
    99         void SendControllerInfo();
    100         void Run();
    101         void BuildDataFrame();
    102         bool writeBits(uint16_t value,uint8_t valueSizeInBits,char *buffer,uint8_t offsetInBits);
    103         core::Mutex *connectionEstablishedMutex;
    104     };
     97private:
     98  class DataSender : public core::Thread {
     99  public:
     100    DataSender(Object *parent, HostEthController *hostEthController,
     101               std::string name, uint8_t priority = 0);
     102    void Run();
    105103
    106 }}
     104  private:
     105    HostEthController *hostEthController;
     106  };
     107  DataSender *dataSender;
     108
     109  bool ControllerInitialization();
     110  bool ConnectedWithTarget();
     111  void SendControllerInfo();
     112  void Run();
     113  void BuildDataFrame();
     114  bool writeBits(uint16_t value, uint8_t valueSizeInBits, char *buffer,
     115                 uint8_t offsetInBits);
     116  core::Mutex *connectionEstablishedMutex;
     117};
     118}
     119}
    107120
    108121#endif // HOSTETHCONTROLLER_H
  • trunk/include/FlairSensorActuator/Imu.h

    r4 r13  
    1717
    1818namespace flair {
    19     namespace core {
    20         class ImuData;
    21         class OneAxisRotation;
    22     }
    23     namespace gui {
    24         class Tab;
    25         class TabWidget;
    26         class GroupBox;
    27         class Layout;
    28         class DataPlot1D;
    29     }
     19namespace core {
     20class ImuData;
     21class OneAxisRotation;
     22}
     23namespace gui {
     24class Tab;
     25class TabWidget;
     26class GroupBox;
     27class Layout;
     28class DataPlot1D;
     29}
    3030}
    3131
    3232class Ahrs_impl;
    3333
    34 namespace flair { namespace sensor {
    35     /*! \class Imu
    36     *
    37     * \brief Base class for Imu
    38     *
    39     * Use this class to define a custom Imu.
    40     *
    41     */
    42     class Imu : public core::IODevice {
    43         friend class ::Ahrs_impl;
     34namespace flair {
     35namespace sensor {
     36/*! \class Imu
     37*
     38* \brief Base class for Imu
     39*
     40* Use this class to define a custom Imu.
     41*
     42*/
     43class Imu : public core::IODevice {
     44  friend class ::Ahrs_impl;
    4445
    45         public:
    46             /*!
    47             * \brief Constructor
    48             *
    49             * Construct an Imu.
    50             *
    51             * \param parent parent
    52             * \param name name
    53             */
    54             Imu(const core::FrameworkManager *parent,std::string name);
     46public:
     47  /*!
     48  * \brief Constructor
     49  *
     50  * Construct an Imu.
     51  *
     52  * \param parent parent
     53  * \param name name
     54  */
     55  Imu(const core::FrameworkManager *parent, std::string name);
    5556
    56             /*!
    57             * \brief Constructor
    58             *
    59             * Construct an Imu. \n
    60             * This contructor must only be called for a simulated device.
    61             *
    62             * \param parent parent
    63             * \param name name
    64             */
    65             Imu(const core::IODevice *parent,std::string name);
     57  /*!
     58  * \brief Constructor
     59  *
     60  * Construct an Imu. \n
     61  * This contructor must only be called for a simulated device.
     62  *
     63  * \param parent parent
     64  * \param name name
     65  */
     66  Imu(const core::IODevice *parent, std::string name);
    6667
    67             /*!
    68             * \brief Destructor
    69             *
    70             */
    71             ~Imu();
     68  /*!
     69  * \brief Destructor
     70  *
     71  */
     72  ~Imu();
    7273
    73             /*!
    74             * \brief Setup Layout
    75             *
    76             * \return setup Layout
    77             */
    78             gui::Layout *GetLayout(void) const;
     74  /*!
     75  * \brief Setup Layout
     76  *
     77  * \return setup Layout
     78  */
     79  gui::Layout *GetLayout(void) const;
    7980
    80             /*!
    81             * \brief Lock user interface
    82             *
    83             */
    84             void LockUserInterface(void) const;
     81  /*!
     82  * \brief Lock user interface
     83  *
     84  */
     85  void LockUserInterface(void) const;
    8586
    86             /*!
    87             * \brief Unlock user interface
    88             *
    89             */
    90             void UnlockUserInterface(void) const;
     87  /*!
     88  * \brief Unlock user interface
     89  *
     90  */
     91  void UnlockUserInterface(void) const;
    9192
    92             /*!
    93             * \brief Use default plot
    94             *
    95             */
    96             void UseDefaultPlot(void);
     93  /*!
     94  * \brief Use default plot
     95  *
     96  */
     97  void UseDefaultPlot(void);
    9798
    98             /*!
    99             * \brief Plot tab
    100             *
    101             * \return plot Tab
    102             */
    103             gui::Tab *GetPlotTab(void) const;
     99  /*!
     100  * \brief Plot tab
     101  *
     102  * \return plot Tab
     103  */
     104  gui::Tab *GetPlotTab(void) const;
    104105
    105         protected:
    106             /*!
    107             * \brief Setup GroupBox
    108             *
    109             * \return setup GroupBox
    110             */
    111             gui::GroupBox *GetGroupBox(void) const;
     106protected:
     107  /*!
     108  * \brief Setup GroupBox
     109  *
     110  * \return setup GroupBox
     111  */
     112  gui::GroupBox *GetGroupBox(void) const;
    112113
    113             /*!
    114             * \brief UpdateImu
    115             *
    116             * The reimplemented class must call this function as soon as IMU datas are available. \n
    117             * It handles the data rotation if it was defined.
    118             *
    119             */
    120             void UpdateImu();
     114  /*!
     115  * \brief UpdateImu
     116  *
     117  * The reimplemented class must call this function as soon as IMU datas are
     118  *available. \n
     119  * It handles the data rotation if it was defined.
     120  *
     121  */
     122  void UpdateImu();
    121123
    122             /*!
    123             * \brief Get imu datas
    124             *
    125             * \param imuData imu datas
    126             */
    127             void GetDatas(core::ImuData **imuData) const;
     124  /*!
     125  * \brief Get imu datas
     126  *
     127  * \param imuData imu datas
     128  */
     129  void GetDatas(core::ImuData **imuData) const;
    128130
     131private:
     132  gui::Tab *mainTab, *sensorTab, *plotTab;
     133  gui::TabWidget *tab;
     134  gui::GroupBox *setupGroupbox;
     135  core::OneAxisRotation *rotation;
     136  core::ImuData *imuData;
    129137
    130         private:
    131             gui::Tab *mainTab,*sensorTab,*plotTab;
    132             gui::TabWidget* tab;
    133             gui::GroupBox *setupGroupbox;
    134             core::OneAxisRotation* rotation;
    135             core::ImuData *imuData;
    136 
    137             gui::DataPlot1D *axPlot,*ayPlot,*azPlot;
    138             gui::DataPlot1D *gxPlot,*gyPlot,*gzPlot;
    139             gui::DataPlot1D *mxPlot,*myPlot,*mzPlot;
    140     };
     138  gui::DataPlot1D *axPlot, *ayPlot, *azPlot;
     139  gui::DataPlot1D *gxPlot, *gyPlot, *gzPlot;
     140  gui::DataPlot1D *mxPlot, *myPlot, *mzPlot;
     141};
    141142} // end namespace sensor
    142143} // end namespace flair
  • trunk/include/FlairSensorActuator/LaserRangeFinder.h

    r4 r13  
    1616#include <IODevice.h>
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class FrameworkManager;
    23         class cvmatrix;
    24 
    25     }
    26     namespace gui
    27     {
    28         class Tab;
    29         class TabWidget;
    30         class GroupBox;
    31         class Layout;
    32         class RangeFinderPlot;
    33     }
     18namespace flair {
     19namespace core {
     20class FrameworkManager;
     21class cvmatrix;
     22}
     23namespace gui {
     24class Tab;
     25class TabWidget;
     26class GroupBox;
     27class Layout;
     28class RangeFinderPlot;
     29}
    3430}
    3531
    36 namespace flair
    37 {
    38 namespace sensor
    39 {
    40     /*! \class LaserRangeFinder
    41     *
    42     * \brief Classe generique intégrant les telemetres laser
    43     */
    44     class LaserRangeFinder : public core::IODevice
    45     {
    46         public:
    47             /*!
    48             * \brief Constructor
    49             *
    50             * Construct a Laser Range Finder.
    51             *
    52             * \param parent parent
    53             * \param name name
    54             */
    55             LaserRangeFinder(const core::FrameworkManager* parent,std::string name);
    56             /*!
    57             * \brief Constructor
    58             *
    59             * Construct a UsRangeFinder. Simulation part.
    60             *
    61             * \param parent parent
    62             * \param name name
    63             */
    64             LaserRangeFinder(const core::IODevice* parent,std::string name);
    65             /*!
    66             * \brief Destructor
    67             *
    68             */
    69             ~LaserRangeFinder();
     32namespace flair {
     33namespace sensor {
     34/*! \class LaserRangeFinder
     35*
     36* \brief Classe generique intégrant les telemetres laser
     37*/
     38class LaserRangeFinder : public core::IODevice {
     39public:
     40  /*!
     41  * \brief Constructor
     42  *
     43  * Construct a Laser Range Finder.
     44  *
     45  * \param parent parent
     46  * \param name name
     47  */
     48  LaserRangeFinder(const core::FrameworkManager *parent, std::string name);
     49  /*!
     50  * \brief Constructor
     51  *
     52  * Construct a UsRangeFinder. Simulation part.
     53  *
     54  * \param parent parent
     55  * \param name name
     56  */
     57  LaserRangeFinder(const core::IODevice *parent, std::string name);
     58  /*!
     59  * \brief Destructor
     60  *
     61  */
     62  ~LaserRangeFinder();
    7063
    71             /*!
    72             * \brief Use default plot
    73             *
    74             */
    75             void UseDefaultPlot(void);
     64  /*!
     65  * \brief Use default plot
     66  *
     67  */
     68  void UseDefaultPlot(void);
    7669
    77             /*!
    78             * \brief Plot
    79             *
    80             * \return DataPlot1D
    81             */
    82             gui::RangeFinderPlot* GetPlot(void) const;
     70  /*!
     71  * \brief Plot
     72  *
     73  * \return DataPlot1D
     74  */
     75  gui::RangeFinderPlot *GetPlot(void) const;
    8376
    84             /*!
    85             * \brief Setup Layout
    86             *
    87             * \return a Layout available
    88             */
    89             gui::Layout* GetLayout(void) const;
     77  /*!
     78  * \brief Setup Layout
     79  *
     80  * \return a Layout available
     81  */
     82  gui::Layout *GetLayout(void) const;
    9083
    91             /*!
    92             * \brief Plot tab
    93             *
    94             * \return plot Tab
    95             */
    96             gui::Tab* GetPlotTab(void) const;
     84  /*!
     85  * \brief Plot tab
     86  *
     87  * \return plot Tab
     88  */
     89  gui::Tab *GetPlotTab(void) const;
    9790
    98             /*!
    99             * \brief Value
    100             *
    101             * \return output value
    102             */
    103             float Value(void) const;
     91  /*!
     92  * \brief Value
     93  *
     94  * \return output value
     95  */
     96  float Value(void) const;
    10497
    105         protected:
    106         /*!
    107             * \brief Output matrix
    108             *
    109             * \return output matrix
    110             */
    111             core::cvmatrix *output;
     98protected:
     99  /*!
     100      * \brief Output matrix
     101      *
     102      * \return output matrix
     103      */
     104  core::cvmatrix *output;
    112105
    113             /*!
    114             * \brief Setup GroupBox
    115             *
    116             * \return a GroupBox available
    117             */
    118             gui::GroupBox* GetGroupBox(void) const;
     106  /*!
     107  * \brief Setup GroupBox
     108  *
     109  * \return a GroupBox available
     110  */
     111  gui::GroupBox *GetGroupBox(void) const;
    119112
    120         private:
    121             /*!
    122             * \brief Update using provided datas
    123             *
    124             * Reimplemented from IODevice.
    125             *
    126             * \param data data from the parent to process
    127             */
    128             void UpdateFrom(const core::io_data *data){};
     113private:
     114  /*!
     115  * \brief Update using provided datas
     116  *
     117  * Reimplemented from IODevice.
     118  *
     119  * \param data data from the parent to process
     120  */
     121  void UpdateFrom(const core::io_data *data){};
    129122
    130             gui::Tab* main_tab;
    131             gui::TabWidget *tab;
    132             gui::GroupBox* setup_groupbox;
    133             gui::Tab* sensor_tab;
    134             gui::RangeFinderPlot* plot;
    135             gui::Tab* plot_tab;
    136 
    137     };
     123  gui::Tab *main_tab;
     124  gui::TabWidget *tab;
     125  gui::GroupBox *setup_groupbox;
     126  gui::Tab *sensor_tab;
     127  gui::RangeFinderPlot *plot;
     128  gui::Tab *plot_tab;
     129};
    138130} // end namespace sensor
    139131} // end namespace framewor
  • trunk/include/FlairSensorActuator/Mb800.h

    r4 r13  
    1717#include <Gps.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class FrameworkManager;
    24         class SerialPort;
    25     }
     19namespace flair {
     20namespace core {
     21class FrameworkManager;
     22class SerialPort;
     23}
    2624}
    2725
    28 namespace flair
    29 {
    30 namespace sensor
    31 {
    32     /*! \class Mb800
    33     *
    34     * \brief Class for mb800 gps receiver
    35     */
    36     class Mb800 : public core::Thread, public Gps
    37     {
    38         public:
    39             /*!
    40             * \brief Constructor
    41             *
    42             * Construct a Mb800.
    43             *
    44             * \param parent parent
    45             * \param name name
    46             * \param serialport serialport
    47             * \param NMEAFlags NMEA sentances to enable
    48             * \param priority priority of the Thread
    49             */
    50             Mb800(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,Gps::NMEAFlags_t NMEAFlags,uint8_t priority);
     26namespace flair {
     27namespace sensor {
     28/*! \class Mb800
     29*
     30* \brief Class for mb800 gps receiver
     31*/
     32class Mb800 : public core::Thread, public Gps {
     33public:
     34  /*!
     35  * \brief Constructor
     36  *
     37  * Construct a Mb800.
     38  *
     39  * \param parent parent
     40  * \param name name
     41  * \param serialport serialport
     42  * \param NMEAFlags NMEA sentances to enable
     43  * \param priority priority of the Thread
     44  */
     45  Mb800(const core::FrameworkManager *parent, std::string name,
     46        core::SerialPort *serialport, Gps::NMEAFlags_t NMEAFlags,
     47        uint8_t priority);
    5148
    52             /*!
    53             * \brief Destructor
    54             *
    55             */
    56             ~Mb800();
     49  /*!
     50  * \brief Destructor
     51  *
     52  */
     53  ~Mb800();
    5754
    58         private:
    59             /*!
    60             * \brief Update using provided datas
    61             *
    62             * Reimplemented from IODevice.
    63             *
    64             * \param data data from the parent to process
    65             */
    66             void UpdateFrom(const core::io_data *data){};
     55private:
     56  /*!
     57  * \brief Update using provided datas
     58  *
     59  * Reimplemented from IODevice.
     60  *
     61  * \param data data from the parent to process
     62  */
     63  void UpdateFrom(const core::io_data *data){};
    6764
    68             /*!
    69             * \brief Run function
    70             *
    71             * Reimplemented from Thread.
    72             *
    73             */
    74             void Run(void);
     65  /*!
     66  * \brief Run function
     67  *
     68  * Reimplemented from Thread.
     69  *
     70  */
     71  void Run(void);
    7572
    76             void Sync(void);
    77             core::SerialPort *serialport;
    78     };
     73  void Sync(void);
     74  core::SerialPort *serialport;
     75};
    7976} // end namespace sensor
    8077} // end namespace framewor
  • trunk/include/FlairSensorActuator/Novatel.h

    r4 r13  
    1717#include <Gps.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class FrameworkManager;
    24         class SerialPort;
    25     }
     19namespace flair {
     20namespace core {
     21class FrameworkManager;
     22class SerialPort;
     23}
    2624}
    2725
    28 namespace flair
    29 {
    30 namespace sensor
    31 {
    32     /*! \class Novatel
    33     *
    34     * \brief Class for Novatel gps receiver
    35     */
    36     class Novatel : public core::Thread, public Gps
    37     {
    38         public:
    39             /*!
    40             * \brief Constructor
    41             *
    42             * Construct a Novatel.
    43             *
    44             * \param parent parent
    45             * \param name name
    46             * \param serialport serialport
    47             * \param NMEAFlags NMEA sentances to enable
    48             * \param priority priority of the Thread
    49             */
    50             Novatel(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,Gps::NMEAFlags_t NMEAFlags,uint8_t priority);
     26namespace flair {
     27namespace sensor {
     28/*! \class Novatel
     29*
     30* \brief Class for Novatel gps receiver
     31*/
     32class Novatel : public core::Thread, public Gps {
     33public:
     34  /*!
     35  * \brief Constructor
     36  *
     37  * Construct a Novatel.
     38  *
     39  * \param parent parent
     40  * \param name name
     41  * \param serialport serialport
     42  * \param NMEAFlags NMEA sentances to enable
     43  * \param priority priority of the Thread
     44  */
     45  Novatel(const core::FrameworkManager *parent, std::string name,
     46          core::SerialPort *serialport, Gps::NMEAFlags_t NMEAFlags,
     47          uint8_t priority);
    5148
    52             /*!
    53             * \brief Destructor
    54             *
    55             */
    56             ~Novatel();
     49  /*!
     50  * \brief Destructor
     51  *
     52  */
     53  ~Novatel();
    5754
    58         private:
    59             /*!
    60             * \brief Update using provided datas
    61             *
    62             * Reimplemented from IODevice.
    63             *
    64             * \param data data from the parent to process
    65             */
    66             void UpdateFrom(const core::io_data *data){};
     55private:
     56  /*!
     57  * \brief Update using provided datas
     58  *
     59  * Reimplemented from IODevice.
     60  *
     61  * \param data data from the parent to process
     62  */
     63  void UpdateFrom(const core::io_data *data){};
    6764
    68             /*!
    69             * \brief Run function
    70             *
    71             * Reimplemented from Thread.
    72             *
    73             */
    74             void Run(void);
     65  /*!
     66  * \brief Run function
     67  *
     68  * Reimplemented from Thread.
     69  *
     70  */
     71  void Run(void);
    7572
    76             core::SerialPort *serialport;
    77             void Sync(void);
    78     };
     73  core::SerialPort *serialport;
     74  void Sync(void);
     75};
    7976} // end namespace sensor
    8077} // end namespace framewor
  • trunk/include/FlairSensorActuator/Ps3Eye.h

    r4 r13  
    1616#include "V4LCamera.h"
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class cvimage;
    23         class FrameworkManager;
    24     }
    25     namespace gui
    26     {
    27         class GridLayout;
    28         class DoubleSpinBox;
    29         class CheckBox;
    30     }
     18namespace flair {
     19namespace core {
     20class cvimage;
     21class FrameworkManager;
     22}
     23namespace gui {
     24class GridLayout;
     25class DoubleSpinBox;
     26class CheckBox;
     27}
    3128}
    3229
    33 namespace flair
    34 {
    35 namespace sensor
    36 {
    37     /*! \class Ps3Eye
    38     *
    39     * \brief Class for Ps3Eye camera
    40     */
    41     class Ps3Eye : public V4LCamera
    42     {
     30namespace flair {
     31namespace sensor {
     32/*! \class Ps3Eye
     33*
     34* \brief Class for Ps3Eye camera
     35*/
     36class Ps3Eye : public V4LCamera {
    4337
    44         public:
    45             /*!
    46             * \brief Constructor
    47             *
    48             * Construct a Ps3Eye.
    49             *
    50             * \param parent parent
    51             * \param name name
    52             * \param camera_index index of the camera, ie /dev/videox
    53             * \param priority priority of the Thread
    54             */
    55             Ps3Eye(const core::FrameworkManager* parent,std::string name,int camera_index,uint8_t priority);
     38public:
     39  /*!
     40  * \brief Constructor
     41  *
     42  * Construct a Ps3Eye.
     43  *
     44  * \param parent parent
     45  * \param name name
     46  * \param camera_index index of the camera, ie /dev/videox
     47  * \param priority priority of the Thread
     48  */
     49  Ps3Eye(const core::FrameworkManager *parent, std::string name,
     50         int camera_index, uint8_t priority);
    5651
    57             /*!
    58             * \brief Destructor
    59             *
    60             */
    61             ~Ps3Eye();
     52  /*!
     53  * \brief Destructor
     54  *
     55  */
     56  ~Ps3Eye();
    6257
    63         private:
    64     };
     58private:
     59};
    6560} // end namespace sensor
    6661} // end namespace flair
  • trunk/include/FlairSensorActuator/RadioReceiver.h

    r4 r13  
    1717#include <stdint.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class FrameworkManager;
    24         class cvmatrix;
    25     }
    26     namespace gui
    27     {
    28         class Tab;
    29         class TabWidget;
    30         class Layout;
    31     }
     19namespace flair {
     20namespace core {
     21class FrameworkManager;
     22class cvmatrix;
     23}
     24namespace gui {
     25class Tab;
     26class TabWidget;
     27class Layout;
     28}
    3229}
    3330
    34 namespace flair
    35 {
    36 namespace sensor
    37 {
    38     /*! \class RadioReceiver
    39     *
    40     * \brief Base class for radio receiver
    41     */
    42     class RadioReceiver : public core::IODevice
    43     {
    44         public:
    45             /*!
    46             * \brief Constructor
    47             *
    48             * Construct a RadioReceiver.
    49             *
    50             * \param parent parent
    51             * \param name name
    52             * \param nb_channels number of supported channels
    53             */
    54             RadioReceiver(const core::FrameworkManager* parent,std::string name,unsigned int nb_channels);
     31namespace flair {
     32namespace sensor {
     33/*! \class RadioReceiver
     34*
     35* \brief Base class for radio receiver
     36*/
     37class RadioReceiver : public core::IODevice {
     38public:
     39  /*!
     40  * \brief Constructor
     41  *
     42  * Construct a RadioReceiver.
     43  *
     44  * \param parent parent
     45  * \param name name
     46  * \param nb_channels number of supported channels
     47  */
     48  RadioReceiver(const core::FrameworkManager *parent, std::string name,
     49                unsigned int nb_channels);
    5550
    56             /*!
    57             * \brief Destructor
    58             *
    59             */
    60             ~RadioReceiver();
     51  /*!
     52  * \brief Destructor
     53  *
     54  */
     55  ~RadioReceiver();
    6156
    62             /*!
    63             * \brief get channel value
    64             *
    65             * \param id channel id
    66             * \return value of the channel, between 0 and 1.
    67             *  Returns -1 if channel is out of bound
    68             */
    69             float ChannelValue(unsigned int id) const;
     57  /*!
     58  * \brief get channel value
     59  *
     60  * \param id channel id
     61  * \return value of the channel, between 0 and 1.
     62  *  Returns -1 if channel is out of bound
     63  */
     64  float ChannelValue(unsigned int id) const;
    7065
    71             /*!
    72             * \brief Is transmitter connected?
    73             *
    74             * \return true if transmitter is connected
    75             */
    76             bool IsConnected(void) const;
     66  /*!
     67  * \brief Is transmitter connected?
     68  *
     69  * \return true if transmitter is connected
     70  */
     71  bool IsConnected(void) const;
    7772
    78             /*!
    79             * \brief Setup Layout
    80             *
    81             * \return a Layout available
    82             */
    83             gui::Layout* GetLayout(void) const;
     73  /*!
     74  * \brief Setup Layout
     75  *
     76  * \return a Layout available
     77  */
     78  gui::Layout *GetLayout(void) const;
    8479
    85         private:
    86             /*!
    87             * \brief Update using provided datas
    88             *
    89             * Reimplemented from IODevice.
    90             *
    91             * \param data data from the parent to process
    92             */
    93             void UpdateFrom(const core::io_data *data){};
     80private:
     81  /*!
     82  * \brief Update using provided datas
     83  *
     84  * Reimplemented from IODevice.
     85  *
     86  * \param data data from the parent to process
     87  */
     88  void UpdateFrom(const core::io_data *data){};
    9489
    95             core::cvmatrix *output;
    96             bool is_connected;
    97             unsigned int nb_channels;
    98             gui::Tab* main_tab;
    99             gui::TabWidget* tab;
    100             gui::Tab* setup_tab;
    101     };
     90  core::cvmatrix *output;
     91  bool is_connected;
     92  unsigned int nb_channels;
     93  gui::Tab *main_tab;
     94  gui::TabWidget *tab;
     95  gui::Tab *setup_tab;
     96};
    10297} // end namespace sensor
    10398} // end namespace flair
  • trunk/include/FlairSensorActuator/SimuBldc.h

    r4 r13  
    1616#include <Bldc.h>
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class SharedMem;
    23         class IODevice;
    24         class cvmatrix;
    25     }
    26     namespace gui
    27     {
    28         class DoubleSpinBox;
    29         class Layout;
    30     }
     18namespace flair {
     19namespace core {
     20class SharedMem;
     21class IODevice;
     22class cvmatrix;
     23}
     24namespace gui {
     25class DoubleSpinBox;
     26class Layout;
     27}
    3128}
    3229
    33 namespace flair
    34 {
    35 namespace actuator
    36 {
    37     /*! \class SimuBldc
    38     *
    39     * \brief Class for a simulation bldc
    40     *
    41     */
    42     class SimuBldc : public Bldc
    43     {
    44         public:
    45             /*!
    46             * \brief Constructor
    47             *
    48             * Construct a SimuBldc. Control part.
    49             *
    50             * \param parent parent
    51             * \param layout layout
    52             * \param name name
    53             * \param motors_count number of motors
    54             * \param dev_id device id
    55             */
    56             SimuBldc(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count,uint32_t dev_id);
     30namespace flair {
     31namespace actuator {
     32/*! \class SimuBldc
     33*
     34* \brief Class for a simulation bldc
     35*
     36*/
     37class SimuBldc : public Bldc {
     38public:
     39  /*!
     40  * \brief Constructor
     41  *
     42  * Construct a SimuBldc. Control part.
     43  *
     44  * \param parent parent
     45  * \param layout layout
     46  * \param name name
     47  * \param motors_count number of motors
     48  * \param dev_id device id
     49  */
     50  SimuBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
     51           uint8_t motors_count, uint32_t dev_id);
    5752
    58             /*!
    59             * \brief Constructor
    60             *
    61             * Construct a SimuBldc. Simulation part.
    62             *
    63             * \param parent parent
    64             * \param name name
    65             * \param motors_count number of motors
    66             * \param dev_id device id
    67             */
    68             SimuBldc(const core::Object* parent,std::string name,uint8_t motors_count,uint32_t dev_id);
     53  /*!
     54  * \brief Constructor
     55  *
     56  * Construct a SimuBldc. Simulation part.
     57  *
     58  * \param parent parent
     59  * \param name name
     60  * \param motors_count number of motors
     61  * \param dev_id device id
     62  */
     63  SimuBldc(const core::Object *parent, std::string name, uint8_t motors_count,
     64           uint32_t dev_id);
    6965
    70             /*!
    71             * \brief Destructor
    72             *
    73             */
    74             ~SimuBldc();
     66  /*!
     67  * \brief Destructor
     68  *
     69  */
     70  ~SimuBldc();
    7571
    76             /*!
    77             * \brief Get motors speeds.
    78             *
    79             * This function should only be used for the simulation part.
    80             *
    81             * \param value array to store motors speeds
    82             */
    83             void GetSpeeds(float* value) const;
     72  /*!
     73  * \brief Get motors speeds.
     74  *
     75  * This function should only be used for the simulation part.
     76  *
     77  * \param value array to store motors speeds
     78  */
     79  void GetSpeeds(float *value) const;
    8480
    85             /*!
    86             * \brief Has speed measurement
    87             *
    88             * Reimplemented from Bldc. \n
    89             *
    90             * \return true if it has speed measurement
    91             */
    92             bool HasSpeedMeasurement(void) const{return false;};
     81  /*!
     82  * \brief Has speed measurement
     83  *
     84  * Reimplemented from Bldc. \n
     85  *
     86  * \return true if it has speed measurement
     87  */
     88  bool HasSpeedMeasurement(void) const { return false; };
    9389
    94             /*!
    95             * \brief Has current measurement
    96             *
    97             * Reimplemented from Bldc. \n
    98             *
    99             * \return true if it has current measurement
    100             */
    101             bool HasCurrentMeasurement(void) const{return false;};
     90  /*!
     91  * \brief Has current measurement
     92  *
     93  * Reimplemented from Bldc. \n
     94  *
     95  * \return true if it has current measurement
     96  */
     97  bool HasCurrentMeasurement(void) const { return false; };
    10298
    103         private:
    104             /*!
    105             * \brief Set motors values
    106             *
    107             * Reimplemented from Bldc. \n
    108             * Values size must be the same as MotorsCount()
    109             *
    110             * \param values motor values
    111             */
    112             void SetMotors(float* value);
     99private:
     100  /*!
     101  * \brief Set motors values
     102  *
     103  * Reimplemented from Bldc. \n
     104  * Values size must be the same as MotorsCount()
     105  *
     106  * \param values motor values
     107  */
     108  void SetMotors(float *value);
    113109
    114             core::SharedMem *shmem;
    115             gui::DoubleSpinBox *k;
    116     };
     110  core::SharedMem *shmem;
     111  gui::DoubleSpinBox *k;
     112};
    117113} // end namespace actuator
    118114} // end namespace flair
  • trunk/include/FlairSensorActuator/SimuCamera.h

    r4 r13  
    1818#include <cxcore.h>
    1919
    20 namespace flair
    21 {
    22     namespace core
    23     {
    24         class SharedMem;
    25     }
    26     namespace gui
    27     {
    28         class SpinBox;
    29     }
     20namespace flair {
     21namespace core {
     22class SharedMem;
     23}
     24namespace gui {
     25class SpinBox;
     26}
    3027}
    3128
    32 namespace flair
    33 {
    34 namespace sensor
    35 {
    36     /*! \class SimuCamera
    37     *
    38     * \brief Class for a simulation camera
    39     */
    40     class SimuCamera : public core::Thread, public Camera
    41     {
    42         public:
    43             /*!
    44             * \brief Constructor
    45             *
    46             * Construct a SimuCamera. Control part.
    47             *
    48             * \param parent parent
    49             * \param name name
    50             * \param width width
    51             * \param height height
    52             * \param channels number of channels
    53             * \param dev_id device id
    54             * \param priority priority of the Thread
    55             */
    56             SimuCamera(const core::FrameworkManager* parent,std::string name,uint16_t width,uint16_t height,uint8_t channels,uint32_t dev_id,uint8_t priority);
     29namespace flair {
     30namespace sensor {
     31/*! \class SimuCamera
     32*
     33* \brief Class for a simulation camera
     34*/
     35class SimuCamera : public core::Thread, public Camera {
     36public:
     37  /*!
     38  * \brief Constructor
     39  *
     40  * Construct a SimuCamera. Control part.
     41  *
     42  * \param parent parent
     43  * \param name name
     44  * \param width width
     45  * \param height height
     46  * \param channels number of channels
     47  * \param dev_id device id
     48  * \param priority priority of the Thread
     49  */
     50  SimuCamera(const core::FrameworkManager *parent, std::string name,
     51             uint16_t width, uint16_t height, uint8_t channels, uint32_t dev_id,
     52             uint8_t priority);
    5753
    58             /*!
    59             * \brief Constructor
    60             *
    61             * Construct a SimuCamera. Simulation part.\n
    62             * The Thread of this class should not be run.
    63             *
    64             * \param parent parent
    65             * \param name name
    66             * \param width width
    67             * \param height height
    68             * \param channels number of channels
    69             * \param dev_id device id
    70             */
    71             SimuCamera(const core::IODevice* parent,std::string name,uint16_t width,uint16_t height,uint8_t channels,uint32_t dev_id);
     54  /*!
     55  * \brief Constructor
     56  *
     57  * Construct a SimuCamera. Simulation part.\n
     58  * The Thread of this class should not be run.
     59  *
     60  * \param parent parent
     61  * \param name name
     62  * \param width width
     63  * \param height height
     64  * \param channels number of channels
     65  * \param dev_id device id
     66  */
     67  SimuCamera(const core::IODevice *parent, std::string name, uint16_t width,
     68             uint16_t height, uint8_t channels, uint32_t dev_id);
    7269
    73             /*!
    74             * \brief Destructor
    75             *
    76             */
    77             ~SimuCamera();
     70  /*!
     71  * \brief Destructor
     72  *
     73  */
     74  ~SimuCamera();
    7875
    79         protected:
    80             /*!
    81             * \brief SharedMem to access datas
    82             *
    83             */
    84             core::SharedMem *shmem;
     76protected:
     77  /*!
     78  * \brief SharedMem to access datas
     79  *
     80  */
     81  core::SharedMem *shmem;
    8582
    86         private:
    87             /*!
    88             * \brief Run function
    89             *
    90             * Reimplemented from Thread.
    91             *
    92             */
    93             void Run(void);
     83private:
     84  /*!
     85  * \brief Run function
     86  *
     87  * Reimplemented from Thread.
     88  *
     89  */
     90  void Run(void);
    9491
    95             /*!
    96             * \brief Update using provided datas
    97             *
    98             * Reimplemented from IODevice.
    99             *
    100             * \param data data from the parent to process
    101             */
    102             void UpdateFrom(const core::io_data *data){};
     92  /*!
     93  * \brief Update using provided datas
     94  *
     95  * Reimplemented from IODevice.
     96  *
     97  * \param data data from the parent to process
     98  */
     99  void UpdateFrom(const core::io_data *data){};
    103100
    104             gui::SpinBox *data_rate;
    105             size_t buf_size;
    106             IplImage* img;
    107     };
     101  gui::SpinBox *data_rate;
     102  size_t buf_size;
     103  IplImage *img;
     104};
    108105} // end namespace sensor
    109106} // end namespace flair
  • trunk/include/FlairSensorActuator/SimuGps.h

    r4 r13  
    1717#include <Gps.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class FrameworkManager;
    24     }
     19namespace flair {
     20namespace core {
     21class FrameworkManager;
     22}
    2523}
    2624
    27 namespace flair
    28 {
    29 namespace sensor
    30 {
    31     /*! \class SimuGps
    32     *
    33     * \brief Class for a simulation GPS
    34     */
    35     class SimuGps : public core::Thread, public Gps
    36     {
    37         public:
    38             /*!
    39             * \brief Constructor
    40             *
    41             * Construct a Novatel.
    42             *
    43             * \param parent parent
    44             * \param name name
    45             * \param NMEAFlags NMEA sentances to enable
    46             * \param priority priority of the Thread
    47             */
    48             SimuGps(const core::FrameworkManager* parent,std::string name,Gps::NMEAFlags_t NMEAFlags,uint8_t priority);
     25namespace flair {
     26namespace sensor {
     27/*! \class SimuGps
     28*
     29* \brief Class for a simulation GPS
     30*/
     31class SimuGps : public core::Thread, public Gps {
     32public:
     33  /*!
     34  * \brief Constructor
     35  *
     36  * Construct a Novatel.
     37  *
     38  * \param parent parent
     39  * \param name name
     40  * \param NMEAFlags NMEA sentances to enable
     41  * \param priority priority of the Thread
     42  */
     43  SimuGps(const core::FrameworkManager *parent, std::string name,
     44          Gps::NMEAFlags_t NMEAFlags, uint8_t priority);
    4945
    50             /*!
    51             * \brief Destructor
    52             *
    53             */
    54             ~SimuGps();
     46  /*!
     47  * \brief Destructor
     48  *
     49  */
     50  ~SimuGps();
    5551
    56         private:
    57             /*!
    58             * \brief Update using provided datas
    59             *
    60             * Reimplemented from IODevice.
    61             *
    62             * \param data data from the parent to process
    63             */
    64             void UpdateFrom(const core::io_data *data){};
     52private:
     53  /*!
     54  * \brief Update using provided datas
     55  *
     56  * Reimplemented from IODevice.
     57  *
     58  * \param data data from the parent to process
     59  */
     60  void UpdateFrom(const core::io_data *data){};
    6561
    66             /*!
    67             * \brief Run function
    68             *
    69             * Reimplemented from Thread.
    70             *
    71             */
    72             void Run(void);
    73     };
     62  /*!
     63  * \brief Run function
     64  *
     65  * Reimplemented from Thread.
     66  *
     67  */
     68  void Run(void);
     69};
    7470} // end namespace sensor
    7571} // end namespace framewor
  • trunk/include/FlairSensorActuator/SimuImu.h

    r4 r13  
    1818
    1919namespace flair {
    20     namespace core    {
    21         class SharedMem;
    22         class AhrsData;
    23     }
    24     namespace gui {
    25         class SpinBox;
    26     }
     20namespace core {
     21class SharedMem;
     22class AhrsData;
     23}
     24namespace gui {
     25class SpinBox;
     26}
    2727}
    2828
    29 namespace flair { namespace sensor {
    30     /*! \class SimuImu
    31     *
    32     * \brief Class for a simulation Imu
    33     */
    34     class SimuImu : public Imu, public core::Thread {
    35         public:
    36             /*!
    37             * \brief Constructor
    38             *
    39             * Construct a SimuImu. Control part.
    40             *
    41             * \param parent parent
    42             * \param name name
    43             * \param dev_id device id
    44             * \param priority priority of the Thread
    45             */
    46             SimuImu(const core::FrameworkManager* parent,std::string name,uint32_t dev_id,uint8_t priority);
     29namespace flair {
     30namespace sensor {
     31/*! \class SimuImu
     32*
     33* \brief Class for a simulation Imu
     34*/
     35class SimuImu : public Imu, public core::Thread {
     36public:
     37  /*!
     38  * \brief Constructor
     39  *
     40  * Construct a SimuImu. Control part.
     41  *
     42  * \param parent parent
     43  * \param name name
     44  * \param dev_id device id
     45  * \param priority priority of the Thread
     46  */
     47  SimuImu(const core::FrameworkManager *parent, std::string name,
     48          uint32_t dev_id, uint8_t priority);
    4749
    48             /*!
    49             * \brief Constructor
    50             *
    51             * Construct a SimuImu. Simulation part.\n
    52             * The Thread of this class should not be run.
    53             *
    54             * \param parent parent
    55             * \param name name
    56             * \param dev_id device id
    57             */
    58             SimuImu(const core::IODevice* parent,std::string name,uint32_t dev_id);
     50  /*!
     51  * \brief Constructor
     52  *
     53  * Construct a SimuImu. Simulation part.\n
     54  * The Thread of this class should not be run.
     55  *
     56  * \param parent parent
     57  * \param name name
     58  * \param dev_id device id
     59  */
     60  SimuImu(const core::IODevice *parent, std::string name, uint32_t dev_id);
    5961
    60             /*!
    61             * \brief Destructor
    62             *
    63             */
    64             ~SimuImu();
     62  /*!
     63  * \brief Destructor
     64  *
     65  */
     66  ~SimuImu();
    6567
    66         private:
    67             /*!
    68             * \brief Run function
    69             *
    70             * Reimplemented from Thread.
    71             *
    72             */
    73             void Run(void);
     68private:
     69  /*!
     70  * \brief Run function
     71  *
     72  * Reimplemented from Thread.
     73  *
     74  */
     75  void Run(void);
    7476
    75             /*!
    76             * \brief Update using provided datas
    77             *
    78             * Reimplemented from IODevice.
    79             *
    80             * \param data data from the parent to process
    81             */
    82             void UpdateFrom(const core::io_data *data);
     77  /*!
     78  * \brief Update using provided datas
     79  *
     80  * Reimplemented from IODevice.
     81  *
     82  * \param data data from the parent to process
     83  */
     84  void UpdateFrom(const core::io_data *data);
    8385
    84             typedef struct {
    85                 float q0;
    86                 float q1;
    87                 float q2;
    88                 float q3;
    89                 float wx;
    90                 float wy;
    91                 float wz;
    92             } imu_states_t;
    93             gui::SpinBox *data_rate;
    94             core::SharedMem *shmem;
    95             core::AhrsData *ahrsData;
    96     };
     86  typedef struct {
     87    float q0;
     88    float q1;
     89    float q2;
     90    float q3;
     91    float wx;
     92    float wy;
     93    float wz;
     94  } imu_states_t;
     95  gui::SpinBox *data_rate;
     96  core::SharedMem *shmem;
     97  core::AhrsData *ahrsData;
     98};
    9799} // end namespace sensor
    98100} // end namespace flair
  • trunk/include/FlairSensorActuator/SimuLaser.h

    r4 r13  
    1717#include <Thread.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class SharedMem;
    24     }
    25     namespace gui
    26     {
    27         class SpinBox;
    28     }
     19namespace flair {
     20namespace core {
     21class SharedMem;
     22}
     23namespace gui {
     24class SpinBox;
     25}
    2926}
    3027
    31 namespace flair
    32 {
    33 namespace sensor
    34 {
    35     /*! \class SimuUs
    36     *
    37     * \brief Class for a simulation UsRangeFinder
    38     */
    39     class SimuLaser : public core::Thread, public LaserRangeFinder
    40     {
    41         public:
    42             /*!
    43             * \brief Constructor
    44             *
    45             * Construct a SimuUs. Control part.
    46             *
    47             * \param parent parent
    48             * \param name name
    49             * \param dev_id device id
    50             * \param priority priority of the Thread
    51             */
    52             SimuLaser(const core::FrameworkManager* parent,std::string name,uint32_t dev_id,uint8_t priority);
     28namespace flair {
     29namespace sensor {
     30/*! \class SimuUs
     31*
     32* \brief Class for a simulation UsRangeFinder
     33*/
     34class SimuLaser : public core::Thread, public LaserRangeFinder {
     35public:
     36  /*!
     37  * \brief Constructor
     38  *
     39  * Construct a SimuUs. Control part.
     40  *
     41  * \param parent parent
     42  * \param name name
     43  * \param dev_id device id
     44  * \param priority priority of the Thread
     45  */
     46  SimuLaser(const core::FrameworkManager *parent, std::string name,
     47            uint32_t dev_id, uint8_t priority);
    5348
    54             /*!
    55             * \brief Constructor
    56             *
    57             * Construct a SimuUs. Simulation part.\n
    58             * The Thread of this class should not be run.
    59             *
    60             * \param parent parent
    61             * \param name name
    62             * \param dev_id device id
    63             */
    64             SimuLaser(const core::IODevice* parent,std::string name,uint32_t dev_id);
     49  /*!
     50  * \brief Constructor
     51  *
     52  * Construct a SimuUs. Simulation part.\n
     53  * The Thread of this class should not be run.
     54  *
     55  * \param parent parent
     56  * \param name name
     57  * \param dev_id device id
     58  */
     59  SimuLaser(const core::IODevice *parent, std::string name, uint32_t dev_id);
    6560
    66             /*!
    67             * \brief Destructor
    68             *
    69             */
    70             ~SimuLaser();
     61  /*!
     62  * \brief Destructor
     63  *
     64  */
     65  ~SimuLaser();
    7166
    72         protected:
    73             /*!
    74             * \brief SharedMem to access datas
    75             *
    76             */
    77             core::SharedMem *shmem;
     67protected:
     68  /*!
     69  * \brief SharedMem to access datas
     70  *
     71  */
     72  core::SharedMem *shmem;
    7873
    79         private:
    80             /*!
    81             * \brief Update using provided datas
    82             *
    83             * Reimplemented from IODevice.
    84             *
    85             * \param data data from the parent to process
    86             */
    87             void UpdateFrom(const core::io_data *data){};
     74private:
     75  /*!
     76  * \brief Update using provided datas
     77  *
     78  * Reimplemented from IODevice.
     79  *
     80  * \param data data from the parent to process
     81  */
     82  void UpdateFrom(const core::io_data *data){};
    8883
    89             /*!
    90             * \brief Run function
    91             *
    92             * Reimplemented from Thread.
    93             *
    94             */
    95             void Run(void);
     84  /*!
     85  * \brief Run function
     86  *
     87  * Reimplemented from Thread.
     88  *
     89  */
     90  void Run(void);
    9691
    97             gui::SpinBox *data_rate;
    98     };
     92  gui::SpinBox *data_rate;
     93};
    9994} // end namespace sensor
    10095} // end namespace flair
  • trunk/include/FlairSensorActuator/SimuUs.h

    r4 r13  
    1717#include <Thread.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class SharedMem;
    24     }
    25     namespace gui
    26     {
    27         class SpinBox;
    28     }
     19namespace flair {
     20namespace core {
     21class SharedMem;
     22}
     23namespace gui {
     24class SpinBox;
     25}
    2926}
    3027
    31 namespace flair
    32 {
    33 namespace sensor
    34 {
    35     /*! \class SimuUs
    36     *
    37     * \brief Class for a simulation UsRangeFinder
    38     */
    39     class SimuUs : public core::Thread, public UsRangeFinder
    40     {
    41         public:
    42             /*!
    43             * \brief Constructor
    44             *
    45             * Construct a SimuUs. Control part.
    46             *
    47             * \param parent parent
    48             * \param name name
    49             * \param dev_id device id
    50             * \param priority priority of the Thread
    51             */
    52             SimuUs(const core::FrameworkManager* parent,std::string name,uint32_t dev_id,uint8_t priority);
     28namespace flair {
     29namespace sensor {
     30/*! \class SimuUs
     31*
     32* \brief Class for a simulation UsRangeFinder
     33*/
     34class SimuUs : public core::Thread, public UsRangeFinder {
     35public:
     36  /*!
     37  * \brief Constructor
     38  *
     39  * Construct a SimuUs. Control part.
     40  *
     41  * \param parent parent
     42  * \param name name
     43  * \param dev_id device id
     44  * \param priority priority of the Thread
     45  */
     46  SimuUs(const core::FrameworkManager *parent, std::string name,
     47         uint32_t dev_id, uint8_t priority);
    5348
    54             /*!
    55             * \brief Constructor
    56             *
    57             * Construct a SimuUs. Simulation part.\n
    58             * The Thread of this class should not be run.
    59             *
    60             * \param parent parent
    61             * \param name name
    62             * \param dev_id device id
    63             */
    64             SimuUs(const core::IODevice* parent,std::string name,uint32_t dev_id);
     49  /*!
     50  * \brief Constructor
     51  *
     52  * Construct a SimuUs. Simulation part.\n
     53  * The Thread of this class should not be run.
     54  *
     55  * \param parent parent
     56  * \param name name
     57  * \param dev_id device id
     58  */
     59  SimuUs(const core::IODevice *parent, std::string name, uint32_t dev_id);
    6560
    66             /*!
    67             * \brief Destructor
    68             *
    69             */
    70             ~SimuUs();
     61  /*!
     62  * \brief Destructor
     63  *
     64  */
     65  ~SimuUs();
    7166
    72         protected:
    73             /*!
    74             * \brief SharedMem to access datas
    75             *
    76             */
    77             core::SharedMem *shmem;
     67protected:
     68  /*!
     69  * \brief SharedMem to access datas
     70  *
     71  */
     72  core::SharedMem *shmem;
    7873
    79         private:
    80             /*!
    81             * \brief Update using provided datas
    82             *
    83             * Reimplemented from IODevice.
    84             *
    85             * \param data data from the parent to process
    86             */
    87             void UpdateFrom(const core::io_data *data){};
     74private:
     75  /*!
     76  * \brief Update using provided datas
     77  *
     78  * Reimplemented from IODevice.
     79  *
     80  * \param data data from the parent to process
     81  */
     82  void UpdateFrom(const core::io_data *data){};
    8883
    89             /*!
    90             * \brief Run function
    91             *
    92             * Reimplemented from Thread.
    93             *
    94             */
    95             void Run(void);
     84  /*!
     85  * \brief Run function
     86  *
     87  * Reimplemented from Thread.
     88  *
     89  */
     90  void Run(void);
    9691
    97             gui::SpinBox *data_rate;
    98     };
     92  gui::SpinBox *data_rate;
     93};
    9994} // end namespace sensor
    10095} // end namespace flair
  • trunk/include/FlairSensorActuator/Srf08.h

    r4 r13  
    1717#include <UsRangeFinder.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class FrameworkManager;
    24         class I2cPort;
    25     }
    26     namespace gui
    27     {
    28         class SpinBox;;
    29     }
     19namespace flair {
     20namespace core {
     21class FrameworkManager;
     22class I2cPort;
     23}
     24namespace gui {
     25class SpinBox;
     26;
     27}
    3028}
    3129
    32 namespace flair
    33 {
    34 namespace sensor
    35 {
    36     /*! \class Srf08
    37     *
    38     * \brief Class for ultra sonic SRF08
    39     */
    40     class Srf08 : public core::Thread, public UsRangeFinder
    41     {
     30namespace flair {
     31namespace sensor {
     32/*! \class Srf08
     33*
     34* \brief Class for ultra sonic SRF08
     35*/
     36class Srf08 : public core::Thread, public UsRangeFinder {
    4237
    43         public:
    44             /*!
    45             * \brief Constructor
    46             *
    47             * Construct a SimuUs. Control part.
    48             *
    49             * \param parent parent
    50             * \param name name
    51             * \param i2cport i2c port
    52             * \param address i2c slave address
    53             * \param priority priority of the Thread
    54             */
    55             Srf08(const core::FrameworkManager* parent,std::string name,core::I2cPort* i2cport,uint16_t address,uint8_t priority);
     38public:
     39  /*!
     40  * \brief Constructor
     41  *
     42  * Construct a SimuUs. Control part.
     43  *
     44  * \param parent parent
     45  * \param name name
     46  * \param i2cport i2c port
     47  * \param address i2c slave address
     48  * \param priority priority of the Thread
     49  */
     50  Srf08(const core::FrameworkManager *parent, std::string name,
     51        core::I2cPort *i2cport, uint16_t address, uint8_t priority);
    5652
    57             /*!
    58             * \brief Destructor
    59             *
    60             */
    61             ~Srf08();
     53  /*!
     54  * \brief Destructor
     55  *
     56  */
     57  ~Srf08();
    6258
    63             /*!
    64             * \brief Set Range
    65             *
    66             * check datasheet for values
    67             */
    68             void SetRange(void);
     59  /*!
     60  * \brief Set Range
     61  *
     62  * check datasheet for values
     63  */
     64  void SetRange(void);
    6965
    70             /*!
    71             * \brief Set Max Gain
    72             *
    73             * check datasheet for values
    74             */
    75             void SetMaxGain(void);
     66  /*!
     67  * \brief Set Max Gain
     68  *
     69  * check datasheet for values
     70  */
     71  void SetMaxGain(void);
    7672
    77         private:
    78             /*!
    79             * \brief Update using provided datas
    80             *
    81             * Reimplemented from IODevice.
    82             *
    83             * \param data data from the parent to process
    84             */
    85             void UpdateFrom(const core::io_data *data){};
     73private:
     74  /*!
     75  * \brief Update using provided datas
     76  *
     77  * Reimplemented from IODevice.
     78  *
     79  * \param data data from the parent to process
     80  */
     81  void UpdateFrom(const core::io_data *data){};
    8682
    87             /*!
    88             * \brief Run function
    89             *
    90             * Reimplemented from Thread.
    91             *
    92             */
    93             void Run(void);
     83  /*!
     84  * \brief Run function
     85  *
     86  * Reimplemented from Thread.
     87  *
     88  */
     89  void Run(void);
    9490
    95             void SendEcho(void);
    96             void GetEcho(void);
     91  void SendEcho(void);
     92  void GetEcho(void);
    9793
    98             bool is_init;
    99             core::Time echo_time;
    100             float z_1,z_2;
    101             gui::SpinBox *gain,*range;
    102             uint16_t address;
    103             core::I2cPort* i2cport;
    104     };
     94  bool is_init;
     95  core::Time echo_time;
     96  float z_1, z_2;
     97  gui::SpinBox *gain, *range;
     98  uint16_t address;
     99  core::I2cPort *i2cport;
     100};
    105101} // end namespace sensor
    106102} // end namespace flair
  • trunk/include/FlairSensorActuator/TargetController.h

    r4 r13  
    2525
    2626namespace flair {
    27     namespace core {
    28         class FrameworkManager;
    29         class cvmatrix;
    30         class Socket;
    31         class io_data;
    32     }
    33     namespace gui {
    34         class Tab;
    35         class TabWidget;
    36         class DataPlot1D;
    37     }
     27namespace core {
     28class FrameworkManager;
     29class cvmatrix;
     30class Socket;
     31class io_data;
     32}
     33namespace gui {
     34class Tab;
     35class TabWidget;
     36class DataPlot1D;
     37}
    3838}
    3939
    40 namespace flair { namespace sensor {
    41     enum class ControllerAction;
     40namespace flair {
     41namespace sensor {
     42enum class ControllerAction;
    4243
    43     /*! \class TargetController
    44     *
    45     * \brief Base Class for target side remote controls
    46     *
    47     */
    48     class TargetController : public core::Thread, public core::IODevice {
    49     public:
    50         TargetController(const core::FrameworkManager* parent,std::string name,uint8_t priority=0);
    51         ~TargetController();
    52         //void DrawUserInterface();
    53         virtual bool IsConnected() const=0;
    54         virtual bool IsDataFrameReady()=0;
    55         //axis stuff
    56         unsigned int GetAxisNumber() const;
    57         virtual std::string GetAxisName(unsigned int axisId) const;
    58         float GetAxisValue(unsigned int axisId) const;// always in the range [-1.0,1.0]
    59         //button stuff
    60         unsigned int GetButtonNumber() const;
    61         bool IsButtonPressed(unsigned int buttonId) const;
    62         virtual std::string GetButtonName(unsigned int axisId) const;
    63         //controller state stuff
    64         virtual bool IsControllerActionSupported(ControllerAction action) const {return false;};
    65         bool SetLedOn(unsigned int ledId);
    66         bool SetLedOff(unsigned int ledId);
    67         bool Rumble(unsigned int left_force,unsigned int left_timeout,unsigned int right_force,unsigned int right_timeout);
    68         bool FlashLed(unsigned int ledId,unsigned int on_timeout,unsigned int off_timeout);
    69         void UpdateFrom(const core::io_data *data){}; //TODO
    70         gui::Tab* GetTab(void) const;
     44/*! \class TargetController
     45*
     46* \brief Base Class for target side remote controls
     47*
     48*/
     49class TargetController : public core::Thread, public core::IODevice {
     50public:
     51  TargetController(const core::FrameworkManager *parent, std::string name,
     52                   uint8_t priority = 0);
     53  ~TargetController();
     54  // void DrawUserInterface();
     55  virtual bool IsConnected() const = 0;
     56  virtual bool IsDataFrameReady() = 0;
     57  // axis stuff
     58  unsigned int GetAxisNumber() const;
     59  virtual std::string GetAxisName(unsigned int axisId) const;
     60  float
     61  GetAxisValue(unsigned int axisId) const; // always in the range [-1.0,1.0]
     62  // button stuff
     63  unsigned int GetButtonNumber() const;
     64  bool IsButtonPressed(unsigned int buttonId) const;
     65  virtual std::string GetButtonName(unsigned int axisId) const;
     66  // controller state stuff
     67  virtual bool IsControllerActionSupported(ControllerAction action) const {
     68    return false;
     69  };
     70  bool SetLedOn(unsigned int ledId);
     71  bool SetLedOff(unsigned int ledId);
     72  bool Rumble(unsigned int left_force, unsigned int left_timeout,
     73              unsigned int right_force, unsigned int right_timeout);
     74  bool FlashLed(unsigned int ledId, unsigned int on_timeout,
     75                unsigned int off_timeout);
     76  void UpdateFrom(const core::io_data *data){}; // TODO
     77  gui::Tab *GetTab(void) const;
    7178
    72     protected:
    73         virtual bool ProcessMessage(core::Message *msg)=0;
    74         void QueueMessage(core::Message msg);
    75         virtual bool ControllerInitialization()=0;// {return true;};
    76         //axis stuff
    77         unsigned int axisNumber;
    78         core::cvmatrix* axis=NULL;
    79         virtual void AcquireAxisData(core::cvmatrix &axis)=0; //responsible for getting the axis data from the hardware
    80         uint16_t bitsPerAxis;
    81         //button stuff
    82         unsigned int buttonNumber;
    83         core::cvmatrix* button=NULL;
    84         virtual void AcquireButtonData(core::cvmatrix &button)=0; //responsible for getting the button data from the hardware
    85         //controller state stuff
    86         unsigned int ledNumber;
    87     private:
    88         void Run();
    89         std::queue<core::Message *> changeStateQueue;
    90         flair::gui::Tab* main_tab;
    91         flair::gui::Tab* setup_tab;
    92     };
     79protected:
     80  virtual bool ProcessMessage(core::Message *msg) = 0;
     81  void QueueMessage(core::Message msg);
     82  virtual bool ControllerInitialization() = 0; // {return true;};
     83  // axis stuff
     84  unsigned int axisNumber;
     85  core::cvmatrix *axis = NULL;
     86  virtual void AcquireAxisData(core::cvmatrix &axis) = 0; // responsible for
     87                                                          // getting the axis
     88                                                          // data from the
     89                                                          // hardware
     90  uint16_t bitsPerAxis;
     91  // button stuff
     92  unsigned int buttonNumber;
     93  core::cvmatrix *button = NULL;
     94  virtual void AcquireButtonData(core::cvmatrix &button) = 0; // responsible for
     95                                                              // getting the
     96                                                              // button data
     97                                                              // from the
     98                                                              // hardware
     99  // controller state stuff
     100  unsigned int ledNumber;
    93101
    94 }}
     102private:
     103  void Run();
     104  std::queue<core::Message *> changeStateQueue;
     105  flair::gui::Tab *main_tab;
     106  flair::gui::Tab *setup_tab;
     107};
     108}
     109}
    95110
    96111#endif // TARGETCONTROLLER_H
  • trunk/include/FlairSensorActuator/TargetEthController.h

    r4 r13  
    1212//
    1313//  purpose:    class that gets remote controls through an ethernet connection.
    14 //              Typical use case: a remote control is plugged in a workstation and sends remote control
     14//              Typical use case: a remote control is plugged in a workstation
     15//              and sends remote control
    1516//              data to a distant target (this class) through Wifi
    1617//
     
    2425
    2526namespace flair {
    26     namespace core {
    27         class FrameworkManager;
    28         class cvmatrix;
    29         class TcpSocket;
    30         class Socket;
    31     }
    32     namespace gui {
    33         class Tab;
    34         class TabWidget;
    35         class DataPlot1D;
    36     }
     27namespace core {
     28class FrameworkManager;
     29class cvmatrix;
     30class TcpSocket;
     31class Socket;
     32}
     33namespace gui {
     34class Tab;
     35class TabWidget;
     36class DataPlot1D;
     37}
    3738}
    3839
    39 namespace flair { namespace sensor {
    40     /*! \class TargetController
    41     *
    42     * \brief Base Class for target side remote controls
    43     *
    44     */
    45     class TargetEthController : public TargetController {
    46     public:
    47         TargetEthController(const core::FrameworkManager* parent,std::string name,uint16_t port,uint8_t priority=0);
    48         ~TargetEthController();
    49         //void DrawUserInterface();
    50     protected:
    51         bool IsConnected() const;
    52         //axis stuff
    53         std::string GetAxisName(unsigned int axisId) const;
    54         //button stuff
    55         std::string GetButtonName(unsigned int axisId) const;
    56         //controller state stuff
    57         bool ProcessMessage(core::Message *msg);
    58         bool IsControllerActionSupported(ControllerAction action) const;
     40namespace flair {
     41namespace sensor {
     42/*! \class TargetController
     43*
     44* \brief Base Class for target side remote controls
     45*
     46*/
     47class TargetEthController : public TargetController {
     48public:
     49  TargetEthController(const core::FrameworkManager *parent, std::string name,
     50                      uint16_t port, uint8_t priority = 0);
     51  ~TargetEthController();
     52  // void DrawUserInterface();
     53protected:
     54  bool IsConnected() const;
     55  // axis stuff
     56  std::string GetAxisName(unsigned int axisId) const;
     57  // button stuff
     58  std::string GetButtonName(unsigned int axisId) const;
     59  // controller state stuff
     60  bool ProcessMessage(core::Message *msg);
     61  bool IsControllerActionSupported(ControllerAction action) const;
    5962
    60         bool IsDataFrameReady();
    61         void AcquireAxisData(core::cvmatrix &axis); //responsible for getting the axis data from the hardware
    62         void AcquireButtonData(core::cvmatrix &button); //responsible for getting the button data from the hardware
     63  bool IsDataFrameReady();
     64  void AcquireAxisData(core::cvmatrix &axis); // responsible for getting the
     65                                              // axis data from the hardware
     66  void AcquireButtonData(core::cvmatrix &button); // responsible for getting the
     67                                                  // button data from the
     68                                                  // hardware
    6369
    64         bool ControllerInitialization();
     70  bool ControllerInitialization();
    6571
    66     private:
    67         uint16_t readBits(uint8_t offsetInBits,uint8_t valueSizeInBits,char *buffer,size_t bufferSize);
    68         uint8_t getByteOrNull(char *buffer,int byte,size_t bufferSize);
    69         uint32_t charBufferToUint32(char *buffer, size_t bufferSize);
    70         core::TcpSocket *listeningSocket;
    71         int listeningPort;
    72         core::TcpSocket *controlSocket=NULL;
    73         core::Socket *dataSocket;
    74         std::string *axisName=NULL;
    75         std::string *buttonName=NULL;
    76         size_t dataFrameSize;
    77         char *dataFrameBuffer;
    78         char *receiveFrameBuffer;
    79         size_t receiveCurrentPosition;
    80         uint8_t buttonOffset;
    81     };
    82 
    83 }}
     72private:
     73  uint16_t readBits(uint8_t offsetInBits, uint8_t valueSizeInBits, char *buffer,
     74                    size_t bufferSize);
     75  uint8_t getByteOrNull(char *buffer, int byte, size_t bufferSize);
     76  uint32_t charBufferToUint32(char *buffer, size_t bufferSize);
     77  core::TcpSocket *listeningSocket;
     78  int listeningPort;
     79  core::TcpSocket *controlSocket = NULL;
     80  core::Socket *dataSocket;
     81  std::string *axisName = NULL;
     82  std::string *buttonName = NULL;
     83  size_t dataFrameSize;
     84  char *dataFrameBuffer;
     85  char *receiveFrameBuffer;
     86  size_t receiveCurrentPosition;
     87  uint8_t buttonOffset;
     88};
     89}
     90}
    8491
    8592#endif // TARGETCONTROLLER_H
  • trunk/include/FlairSensorActuator/UsRangeFinder.h

    r4 r13  
    1616#include <IODevice.h>
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class cvmatrix;
    23     }
    24     namespace gui
    25     {
    26         class Tab;
    27         class TabWidget;
    28         class GroupBox;
    29         class Layout;
    30         class DataPlot1D;
    31     }
     18namespace flair {
     19namespace core {
     20class cvmatrix;
     21}
     22namespace gui {
     23class Tab;
     24class TabWidget;
     25class GroupBox;
     26class Layout;
     27class DataPlot1D;
     28}
    3229}
    3330
    34 namespace flair
    35 {
    36 namespace sensor
    37 {
    38     /*! \class UsRangeFinder
    39     *
    40     * \brief Base class for UsRangeFinder
    41     *
    42     * Use this class to define a custom UsRangeFinder.
    43     *
    44     */
    45     class UsRangeFinder : public core::IODevice
    46     {
    47         public:
    48             /*!
    49             * \brief Constructor
    50             *
    51             * Construct a UsRangeFinder. Control part.
    52             *
    53             * \param parent parent
    54             * \param name name
    55             */
    56             UsRangeFinder(const core::FrameworkManager* parent,std::string name);
     31namespace flair {
     32namespace sensor {
     33/*! \class UsRangeFinder
     34*
     35* \brief Base class for UsRangeFinder
     36*
     37* Use this class to define a custom UsRangeFinder.
     38*
     39*/
     40class UsRangeFinder : public core::IODevice {
     41public:
     42  /*!
     43  * \brief Constructor
     44  *
     45  * Construct a UsRangeFinder. Control part.
     46  *
     47  * \param parent parent
     48  * \param name name
     49  */
     50  UsRangeFinder(const core::FrameworkManager *parent, std::string name);
    5751
    58             /*!
    59             * \brief Constructor
    60             *
    61             * Construct a UsRangeFinder. Simulation part.
    62             *
    63             * \param parent parent
    64             * \param name name
    65             */
    66             UsRangeFinder(const core::IODevice* parent,std::string name);
     52  /*!
     53  * \brief Constructor
     54  *
     55  * Construct a UsRangeFinder. Simulation part.
     56  *
     57  * \param parent parent
     58  * \param name name
     59  */
     60  UsRangeFinder(const core::IODevice *parent, std::string name);
    6761
    68             /*!
    69             * \brief Destructor
    70             *
    71             */
    72             ~UsRangeFinder();
     62  /*!
     63  * \brief Destructor
     64  *
     65  */
     66  ~UsRangeFinder();
    7367
    74             /*!
    75             * \brief Lock user interface
    76             *
    77             */
    78             void LockUserInterface(void) const;
     68  /*!
     69  * \brief Lock user interface
     70  *
     71  */
     72  void LockUserInterface(void) const;
    7973
    80             /*!
    81             * \brief Unlock user interface
    82             *
    83             */
    84             void UnlockUserInterface(void) const;
     74  /*!
     75  * \brief Unlock user interface
     76  *
     77  */
     78  void UnlockUserInterface(void) const;
    8579
    86             /*!
    87             * \brief Use default plot
    88             *
    89             * Should no be used for the simulation part.
    90             */
    91             void UseDefaultPlot(void);
     80  /*!
     81  * \brief Use default plot
     82  *
     83  * Should no be used for the simulation part.
     84  */
     85  void UseDefaultPlot(void);
    9286
    93             /*!
    94             * \brief Plot
    95             *
    96             * \return DataPlot1D
    97             */
    98             gui::DataPlot1D* GetPlot(void) const;
     87  /*!
     88  * \brief Plot
     89  *
     90  * \return DataPlot1D
     91  */
     92  gui::DataPlot1D *GetPlot(void) const;
    9993
    100             /*!
    101             * \brief Setup Layout
    102             *
    103             * \return a Layout available
    104             */
    105             gui::Layout* GetLayout(void) const;
     94  /*!
     95  * \brief Setup Layout
     96  *
     97  * \return a Layout available
     98  */
     99  gui::Layout *GetLayout(void) const;
    106100
    107             /*!
    108             * \brief Plot tab
    109             *
    110             * \return plot Tab
    111             */
    112             gui::Tab* GetPlotTab(void) const;
     101  /*!
     102  * \brief Plot tab
     103  *
     104  * \return plot Tab
     105  */
     106  gui::Tab *GetPlotTab(void) const;
    113107
    114             /*!
    115             * \brief Value
    116             *
    117             * \return output value
    118             */
    119             float Value(void) const;
     108  /*!
     109  * \brief Value
     110  *
     111  * \return output value
     112  */
     113  float Value(void) const;
    120114
    121         protected:
    122             /*!
    123             * \brief Output matrix
    124             *
    125             * \return output matrix
    126             */
    127             core::cvmatrix *output;
     115protected:
     116  /*!
     117  * \brief Output matrix
     118  *
     119  * \return output matrix
     120  */
     121  core::cvmatrix *output;
    128122
    129             /*!
    130             * \brief Setup GroupBox
    131             *
    132             * \return a GroupBox available
    133             */
    134             gui::GroupBox* GetGroupBox(void) const;
     123  /*!
     124  * \brief Setup GroupBox
     125  *
     126  * \return a GroupBox available
     127  */
     128  gui::GroupBox *GetGroupBox(void) const;
    135129
    136         private:
    137             /*!
    138             * \brief Update using provided datas
    139             *
    140             * Reimplemented from IODevice.
    141             *
    142             * \param data data from the parent to process
    143             */
    144             void UpdateFrom(const core::io_data *data){};
     130private:
     131  /*!
     132  * \brief Update using provided datas
     133  *
     134  * Reimplemented from IODevice.
     135  *
     136  * \param data data from the parent to process
     137  */
     138  void UpdateFrom(const core::io_data *data){};
    145139
    146             gui::Tab* main_tab;
    147             gui::TabWidget *tab;
    148             gui::GroupBox* setup_groupbox;
    149             gui::Tab* sensor_tab;
    150             gui::DataPlot1D* plot;
    151             gui::Tab* plot_tab;
    152     };
     140  gui::Tab *main_tab;
     141  gui::TabWidget *tab;
     142  gui::GroupBox *setup_groupbox;
     143  gui::Tab *sensor_tab;
     144  gui::DataPlot1D *plot;
     145  gui::Tab *plot_tab;
     146};
    153147} // end namespace sensor
    154148} // end namespace flair
  • trunk/include/FlairSensorActuator/V4LCamera.h

    r4 r13  
    1818#include <highgui.h>
    1919
    20 namespace flair
    21 {
    22     namespace core
    23     {
    24         class cvimage;
    25         class FrameworkManager;
    26     }
    27     namespace gui
    28     {
    29         class GridLayout;
    30         class DoubleSpinBox;
    31         class CheckBox;
    32         class Label;
    33     }
     20namespace flair {
     21namespace core {
     22class cvimage;
     23class FrameworkManager;
     24}
     25namespace gui {
     26class GridLayout;
     27class DoubleSpinBox;
     28class CheckBox;
     29class Label;
     30}
    3431}
    3532
    36 namespace flair
    37 {
    38 namespace sensor
    39 {
    40     /*! \class V4LCamera
    41     *
    42     * \brief Base class for V4l camera
    43     */
    44     class V4LCamera : public core::Thread, public Camera
    45     {
    46         public:
    47             /*!
    48             * \brief Constructor
    49             *
    50             * Construct a Camera.
    51             *
    52             * \param parent parent
    53             * \param name name
    54             * \param camera_index camera index
    55             * \param width width
    56             * \param height height
    57             * \param format image format
    58             * \param priority priority of the Thread
    59             */
    60             V4LCamera(const core::FrameworkManager* parent,std::string name,uint8_t camera_index,uint16_t width,uint16_t height,core::cvimage::Type::Format format,uint8_t priority);
     33namespace flair {
     34namespace sensor {
     35/*! \class V4LCamera
     36*
     37* \brief Base class for V4l camera
     38*/
     39class V4LCamera : public core::Thread, public Camera {
     40public:
     41  /*!
     42  * \brief Constructor
     43  *
     44  * Construct a Camera.
     45  *
     46  * \param parent parent
     47  * \param name name
     48  * \param camera_index camera index
     49  * \param width width
     50  * \param height height
     51  * \param format image format
     52  * \param priority priority of the Thread
     53  */
     54  V4LCamera(const core::FrameworkManager *parent, std::string name,
     55            uint8_t camera_index, uint16_t width, uint16_t height,
     56            core::cvimage::Type::Format format, uint8_t priority);
    6157
    62             /*!
    63             * \brief Destructor
    64             *
    65             */
    66             ~V4LCamera();
     58  /*!
     59  * \brief Destructor
     60  *
     61  */
     62  ~V4LCamera();
    6763
    68         protected:
    69             /*!
    70             * \brief Set Gain
    71             *
    72             * \param value value between 0 and 1
    73             */
    74             virtual void SetGain(float value);
     64protected:
     65  /*!
     66  * \brief Set Gain
     67  *
     68  * \param value value between 0 and 1
     69  */
     70  virtual void SetGain(float value);
    7571
    76             /*!
    77             * \brief Set Auto Gain
    78             *
    79             * \param value value
    80             */
    81             virtual void SetAutoGain(bool value);
     72  /*!
     73  * \brief Set Auto Gain
     74  *
     75  * \param value value
     76  */
     77  virtual void SetAutoGain(bool value);
    8278
    83             /*!
    84             * \brief Set Exposure
    85             *
    86             * \param value value between 0 and 1
    87             */
    88             virtual void SetExposure(float value);
     79  /*!
     80  * \brief Set Exposure
     81  *
     82  * \param value value between 0 and 1
     83  */
     84  virtual void SetExposure(float value);
    8985
    90             /*!
    91             * \brief Set Auto Exposure
    92             *
    93             * \param value value
    94             */
    95             virtual void SetAutoExposure(bool value);
     86  /*!
     87  * \brief Set Auto Exposure
     88  *
     89  * \param value value
     90  */
     91  virtual void SetAutoExposure(bool value);
    9692
    97             /*!
    98             * \brief Set Brightness
    99             *
    100             * \param value value between 0 and 1
    101             */
    102             virtual void SetBrightness(float value);
     93  /*!
     94  * \brief Set Brightness
     95  *
     96  * \param value value between 0 and 1
     97  */
     98  virtual void SetBrightness(float value);
    10399
    104             /*!
    105             * \brief Set Saturation
    106             *
    107             * \param value value between 0 and 1
    108             */
    109             virtual void SetSaturation(float value);
     100  /*!
     101  * \brief Set Saturation
     102  *
     103  * \param value value between 0 and 1
     104  */
     105  virtual void SetSaturation(float value);
    110106
    111             /*!
    112             * \brief Set Hue
    113             *
    114             * \param value value between 0 and 1
    115             */
    116             virtual void SetHue(float value);
     107  /*!
     108  * \brief Set Hue
     109  *
     110  * \param value value between 0 and 1
     111  */
     112  virtual void SetHue(float value);
    117113
    118             /*!
    119             * \brief Set Contrast
    120             *
    121             * \param value value between 0 and 1
    122             */
    123             virtual void SetContrast(float value);
     114  /*!
     115  * \brief Set Contrast
     116  *
     117  * \param value value between 0 and 1
     118  */
     119  virtual void SetContrast(float value);
    124120
    125         private:
    126             /*!
    127             * \brief Update using provided datas
    128             *
    129             * Reimplemented from IODevice.
    130             *
    131             * \param data data from the parent to process
    132             */
    133             void UpdateFrom(const core::io_data *data){};
     121private:
     122  /*!
     123  * \brief Update using provided datas
     124  *
     125  * Reimplemented from IODevice.
     126  *
     127  * \param data data from the parent to process
     128  */
     129  void UpdateFrom(const core::io_data *data){};
    134130
    135             /*!
    136             * \brief Run function
    137             *
    138             * Reimplemented from Thread.
    139             *
    140             */
    141             void Run(void);
     131  /*!
     132  * \brief Run function
     133  *
     134  * Reimplemented from Thread.
     135  *
     136  */
     137  void Run(void);
    142138
    143             CvCapture* capture;
     139  CvCapture *capture;
    144140
    145             gui::Tab* sensor_tab;
    146             gui::DoubleSpinBox *bright,*exposure,*gain,*contrast,*hue,*sharpness,*sat;
    147             gui::CheckBox *autogain,*awb,*autoexposure;
    148             gui::Label *fps;
    149     };
     141  gui::Tab *sensor_tab;
     142  gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,
     143      *sat;
     144  gui::CheckBox *autogain, *awb, *autoexposure;
     145  gui::Label *fps;
     146};
    150147} // end namespace sensor
    151148} // end namespace flair
  • trunk/include/FlairSensorActuator/VrpnClient.h

    r4 r13  
    66 * \file VrpnClient.h
    77 * \brief Class to connect to a Vrpn server
    8  * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
     8 * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
     9 * 7253
    910 * \date 2013/04/03
    1011 * \version 4.0
     
    1617#include <Thread.h>
    1718
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class FrameworkManager;
    23         class SerialPort;
    24     }
    25     namespace gui
    26     {
    27         class TabWidget;
    28         class Layout;
    29     }
     19namespace flair {
     20namespace core {
     21class FrameworkManager;
     22class SerialPort;
     23}
     24namespace gui {
     25class TabWidget;
     26class Layout;
     27}
    3028}
    3129
     
    3331class VrpnObject_impl;
    3432
    35 namespace flair
    36 {
    37 namespace sensor
    38 {
    39     /*! \class VrpnClient
    40     *
    41     * \brief Class to connect to a Vrpn server
    42     */
    43     class VrpnClient:public core::Thread
    44     {
    45         friend class ::VrpnObject_impl;
     33namespace flair {
     34namespace sensor {
     35/*! \class VrpnClient
     36*
     37* \brief Class to connect to a Vrpn server
     38*/
     39class VrpnClient : public core::Thread {
     40  friend class ::VrpnObject_impl;
    4641
    47         public:
    48             /*!
    49             * \brief Constructor
    50             *
    51             * Construct a VrpnClient. Connection is done by IP.
    52             *
    53             * \param parent parent
    54             * \param name name
    55             * \param address server address
    56             * \param us_period Thread period in us
    57             * \param priority priority of the Thread
    58             */
    59             VrpnClient(const core::FrameworkManager* parent,std::string name,std::string address,uint16_t us_period,uint8_t priority);
     42public:
     43  /*!
     44  * \brief Constructor
     45  *
     46  * Construct a VrpnClient. Connection is done by IP.
     47  *
     48  * \param parent parent
     49  * \param name name
     50  * \param address server address
     51  * \param us_period Thread period in us
     52  * \param priority priority of the Thread
     53  */
     54  VrpnClient(const core::FrameworkManager *parent, std::string name,
     55             std::string address, uint16_t us_period, uint8_t priority);
    6056
    61             /*!
    62             * \brief Constructor
    63             *
    64             * Construct a VrpnClient. Connection is done by XBee modem.
    65             *
    66             * \param parent parent
    67             * \param name name
    68             * \param serialport SerialPort for XBee modem
    69             * \param us_period Xbee RX timeout in us
    70             * \param priority priority of the Thread
    71             */
    72             VrpnClient(const core::FrameworkManager* parent,std::string name,core::SerialPort* serialport,uint16_t us_period,uint8_t priority);
     57  /*!
     58  * \brief Constructor
     59  *
     60  * Construct a VrpnClient. Connection is done by XBee modem.
     61  *
     62  * \param parent parent
     63  * \param name name
     64  * \param serialport SerialPort for XBee modem
     65  * \param us_period Xbee RX timeout in us
     66  * \param priority priority of the Thread
     67  */
     68  VrpnClient(const core::FrameworkManager *parent, std::string name,
     69             core::SerialPort *serialport, uint16_t us_period,
     70             uint8_t priority);
    7371
    74             /*!
    75             * \brief Destructor
    76             *
    77             */
    78             ~VrpnClient();
     72  /*!
     73  * \brief Destructor
     74  *
     75  */
     76  ~VrpnClient();
    7977
    80             /*!
    81             * \brief Setup Layout
    82             *
    83             * \return a Layout available
    84             */
    85             gui::Layout* GetLayout(void) const;
     78  /*!
     79  * \brief Setup Layout
     80  *
     81  * \return a Layout available
     82  */
     83  gui::Layout *GetLayout(void) const;
    8684
    87             /*!
    88             * \brief Setup Tab
    89             *
    90             * \return a Tab available
    91             */
    92             gui::TabWidget* GetTabWidget(void) const;
     85  /*!
     86  * \brief Setup Tab
     87  *
     88  * \return a Tab available
     89  */
     90  gui::TabWidget *GetTabWidget(void) const;
    9391
    94             /*!
    95             * \brief Is XBee used?
    96             *
    97             * \return true if connection is based on XBee modem
    98             */
    99             bool UseXbee(void) const;
     92  /*!
     93  * \brief Is XBee used?
     94  *
     95  * \return true if connection is based on XBee modem
     96  */
     97  bool UseXbee(void) const;
    10098
    101         private:
    102             /*!
    103             * \brief Run function
    104             *
    105             * Reimplemented from Thread.
    106             *
    107             */
    108             void Run(void);
     99private:
     100  /*!
     101  * \brief Run function
     102  *
     103  * Reimplemented from Thread.
     104  *
     105  */
     106  void Run(void);
    109107
    110             class VrpnClient_impl* pimpl_;
    111     };
     108  class VrpnClient_impl *pimpl_;
     109};
    112110} // end namespace sensor
    113111} // end namespace flair
  • trunk/include/FlairSensorActuator/VrpnObject.h

    r4 r13  
    66 * \file VrpnObject.h
    77 * \brief Class for VRPN object
    8  * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
     8 * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
     9 * 7253
    910 * \date 2013/04/03
    1011 * \version 4.0
     
    1718#include <stdint.h>
    1819
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class cvmatrix;
    24         class Vector3D;
    25         class Euler;
    26         class Quaternion;
    27     }
    28     namespace gui
    29     {
    30         class TabWidget;
    31         class Tab;
    32         class DataPlot1D;
    33     }
     20namespace flair {
     21namespace core {
     22class cvmatrix;
     23class Vector3D;
     24class Euler;
     25class Quaternion;
     26}
     27namespace gui {
     28class TabWidget;
     29class Tab;
     30class DataPlot1D;
     31}
    3432}
    3533
     
    3735class VrpnClient_impl;
    3836
    39 namespace flair
    40 {
    41 namespace sensor
    42 {
    43     class VrpnClient;
     37namespace flair {
     38namespace sensor {
     39class VrpnClient;
    4440
    45     /*! \class VrpnObject
    46     *
    47     * \brief Class for VRPN object
    48     */
    49     class VrpnObject: public core::IODevice
    50     {
    51         friend class ::VrpnObject_impl;
    52         friend class ::VrpnClient_impl;
     41/*! \class VrpnObject
     42*
     43* \brief Class for VRPN object
     44*/
     45class VrpnObject : public core::IODevice {
     46  friend class ::VrpnObject_impl;
     47  friend class ::VrpnClient_impl;
    5348
    54         public:
    55             /*!
    56             * \brief Constructor
    57             *
    58             * Construct a VrpnObject. Connection is done by IP.
    59             *
    60             * \param parent parent
    61             * \param name VRPN object name, should be the same as defined in the server
    62             * \param tab Tab for the user interface
    63             */
    64             VrpnObject(const VrpnClient *parent,std::string name,const gui::TabWidget* tab);
     49public:
     50  /*!
     51  * \brief Constructor
     52  *
     53  * Construct a VrpnObject. Connection is done by IP.
     54  *
     55  * \param parent parent
     56  * \param name VRPN object name, should be the same as defined in the server
     57  * \param tab Tab for the user interface
     58  */
     59  VrpnObject(const VrpnClient *parent, std::string name,
     60             const gui::TabWidget *tab);
    6561
    66             /*!
    67             * \brief Constructor
    68             *
    69             * Construct a VrpnObject. Connection is done by IP.
    70             *
    71             * \param parent parent
    72             * \param name name
    73             * \param id VRPN object id, should be the same as defined in the server
    74             * \param tab Tab for the user interface
    75             */
    76             VrpnObject(const VrpnClient *parent,std::string name,uint8_t id,const gui::TabWidget* tab);
     62  /*!
     63  * \brief Constructor
     64  *
     65  * Construct a VrpnObject. Connection is done by IP.
     66  *
     67  * \param parent parent
     68  * \param name name
     69  * \param id VRPN object id, should be the same as defined in the server
     70  * \param tab Tab for the user interface
     71  */
     72  VrpnObject(const VrpnClient *parent, std::string name, uint8_t id,
     73             const gui::TabWidget *tab);
    7774
    78             /*!
    79             * \brief Destructor
    80             *
    81             */
    82             ~VrpnObject(void);
     75  /*!
     76  * \brief Destructor
     77  *
     78  */
     79  ~VrpnObject(void);
    8380
    84             /*!
    85             * \brief Plot tab
    86             *
    87             * \return plot Tab
    88             */
    89             gui::Tab* GetPlotTab(void) const;
     81  /*!
     82  * \brief Plot tab
     83  *
     84  * \return plot Tab
     85  */
     86  gui::Tab *GetPlotTab(void) const;
    9087
    91             /*!
    92             * \brief Get Last Packet Time
    93             *
    94             * \return Time of last received packe
    95             */
    96             core::Time GetLastPacketTime(void) const;
     88  /*!
     89  * \brief Get Last Packet Time
     90  *
     91  * \return Time of last received packe
     92  */
     93  core::Time GetLastPacketTime(void) const;
    9794
    98             /*!
    99             * \brief Is object tracked?
    100             *
    101             * \param timeout_ms timeout
    102             * \return true if object is tracked during timeout_ms time
    103             */
    104             bool IsTracked(unsigned int timeout_ms) const;
     95  /*!
     96  * \brief Is object tracked?
     97  *
     98  * \param timeout_ms timeout
     99  * \return true if object is tracked during timeout_ms time
     100  */
     101  bool IsTracked(unsigned int timeout_ms) const;
    105102
    106             /*!
    107             * \brief Get Euler angles
    108             *
    109             * \param euler output datas
    110             */
    111             void GetEuler(core::Euler &euler) const;
     103  /*!
     104  * \brief Get Euler angles
     105  *
     106  * \param euler output datas
     107  */
     108  void GetEuler(core::Euler &euler) const;
    112109
    113             /*!
    114             * \brief Get Quaternion
    115             *
    116             * \param quaternion output datas
    117             */
    118             void GetQuaternion(core::Quaternion &quaternion) const;
    119             /*!
    120             * \brief Get Position
    121             *
    122             * \param point output datas
    123             */
    124             void GetPosition(core::Vector3D &point) const;
     110  /*!
     111  * \brief Get Quaternion
     112  *
     113  * \param quaternion output datas
     114  */
     115  void GetQuaternion(core::Quaternion &quaternion) const;
     116  /*!
     117  * \brief Get Position
     118  *
     119  * \param point output datas
     120  */
     121  void GetPosition(core::Vector3D &point) const;
    125122
    126             /*!
    127             * \brief Output matrix
    128             *
    129             * Matrix is of type float and as follows: \n
    130             * (0,0) roll (rad) \n
    131             * (1,0) pitch (rad) \n
    132             * (2,0) yaw (rad) \n
    133             * (3,0) x \n
    134             * (4,0) y \n
    135             * (5,0) z \n
    136             *
    137             * \return Output metrix
    138             */
    139             core::cvmatrix *Output(void) const;
     123  /*!
     124  * \brief Output matrix
     125  *
     126  * Matrix is of type float and as follows: \n
     127  * (0,0) roll (rad) \n
     128  * (1,0) pitch (rad) \n
     129  * (2,0) yaw (rad) \n
     130  * (3,0) x \n
     131  * (4,0) y \n
     132  * (5,0) z \n
     133  *
     134  * \return Output metrix
     135  */
     136  core::cvmatrix *Output(void) const;
    140137
    141             /*!
    142             * \brief State matrix
    143             *
    144             * Matrix is of type float and as follows: \n
    145             * (0,0) roll (deg) \n
    146             * (1,0) pitch (deg) \n
    147             * (2,0) yaw (deg) \n
    148             *
    149             * \return State metrix
    150             */
    151             core::cvmatrix *State(void) const;
     138  /*!
     139  * \brief State matrix
     140  *
     141  * Matrix is of type float and as follows: \n
     142  * (0,0) roll (deg) \n
     143  * (1,0) pitch (deg) \n
     144  * (2,0) yaw (deg) \n
     145  *
     146  * \return State metrix
     147  */
     148  core::cvmatrix *State(void) const;
    152149
    153             /*!
    154             * \brief x plot
    155             *
    156             * \return x plot
    157             */
    158             gui::DataPlot1D* xPlot(void) const;
     150  /*!
     151  * \brief x plot
     152  *
     153  * \return x plot
     154  */
     155  gui::DataPlot1D *xPlot(void) const;
    159156
    160             /*!
    161             * \brief y plot
    162             *
    163             * \return y plot
    164             */
    165             gui::DataPlot1D* yPlot(void) const;
     157  /*!
     158  * \brief y plot
     159  *
     160  * \return y plot
     161  */
     162  gui::DataPlot1D *yPlot(void) const;
    166163
    167             /*!
    168             * \brief z plot
    169             *
    170             * \return z plot
    171             */
    172             gui::DataPlot1D* zPlot(void) const;
     164  /*!
     165  * \brief z plot
     166  *
     167  * \return z plot
     168  */
     169  gui::DataPlot1D *zPlot(void) const;
    173170
    174         private:
    175             /*!
    176             * \brief Update using provided datas
    177             *
    178             * Reimplemented from IODevice.
    179             *
    180             * \param data data from the parent to process
    181             */
    182             void UpdateFrom(const core::io_data *data){};
     171private:
     172  /*!
     173  * \brief Update using provided datas
     174  *
     175  * Reimplemented from IODevice.
     176  *
     177  * \param data data from the parent to process
     178  */
     179  void UpdateFrom(const core::io_data *data){};
    183180
    184             void mainloop(void);
    185             class VrpnObject_impl* pimpl_;
    186     };
     181  void mainloop(void);
     182  class VrpnObject_impl *pimpl_;
     183};
    187184} // end namespace sensor
    188185} // end namespace flair
  • trunk/include/FlairSensorActuator/XBldc.h

    r4 r13  
    1616#include "Bldc.h"
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class IODevice;
    23         class I2cPort;
    24     }
    25     namespace gui
    26     {
    27         class Layout;
    28     }
     18namespace flair {
     19namespace core {
     20class IODevice;
     21class I2cPort;
     22}
     23namespace gui {
     24class Layout;
     25}
    2926}
    3027
    3128class XBldc_impl;
    3229
    33 namespace flair
    34 {
    35 namespace actuator
    36 {
    37     /*! \class XBldc
    38     *
    39     * \brief Class for Xufo Bldc
    40     */
    41     class XBldc : public Bldc
    42     {
    43         public:
    44             /*!
    45             * \brief Constructor
    46             *
    47             * Construct a XBldc.
    48             *
    49             * \param parent parent
    50             * \param layout layout
    51             * \param name name
    52             * \param i2cport i2cport
    53             */
    54             XBldc(const core::IODevice* parent,gui::Layout* layout,std::string name,core::I2cPort* i2cport);
     30namespace flair {
     31namespace actuator {
     32/*! \class XBldc
     33*
     34* \brief Class for Xufo Bldc
     35*/
     36class XBldc : public Bldc {
     37public:
     38  /*!
     39  * \brief Constructor
     40  *
     41  * Construct a XBldc.
     42  *
     43  * \param parent parent
     44  * \param layout layout
     45  * \param name name
     46  * \param i2cport i2cport
     47  */
     48  XBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
     49        core::I2cPort *i2cport);
    5550
    56             /*!
    57             * \brief Destructor
    58             *
    59             */
    60             ~XBldc();
     51  /*!
     52  * \brief Destructor
     53  *
     54  */
     55  ~XBldc();
    6156
    62             /*!
    63             * \brief Has speed measurement
    64             *
    65             * Reimplemented from Bldc. \n
    66             *
    67             * \return true if it has speed measurement
    68             */
    69             bool HasSpeedMeasurement(void) const{return false;};
     57  /*!
     58  * \brief Has speed measurement
     59  *
     60  * Reimplemented from Bldc. \n
     61  *
     62  * \return true if it has speed measurement
     63  */
     64  bool HasSpeedMeasurement(void) const { return false; };
    7065
    71             /*!
    72             * \brief Has current measurement
    73             *
    74             * Reimplemented from Bldc. \n
    75             *
    76             * \return true if it has current measurement
    77             */
    78             bool HasCurrentMeasurement(void) const{return false;};
     66  /*!
     67  * \brief Has current measurement
     68  *
     69  * Reimplemented from Bldc. \n
     70  *
     71  * \return true if it has current measurement
     72  */
     73  bool HasCurrentMeasurement(void) const { return false; };
    7974
    80         private:
    81             /*!
    82             * \brief Set motors values
    83             *
    84             * Reimplemented from Bldc. \n
    85             * Values size must be the same as MotorsCount()
    86             *
    87             * \param values motor values
    88             */
    89             void SetMotors(float* value);
     75private:
     76  /*!
     77  * \brief Set motors values
     78  *
     79  * Reimplemented from Bldc. \n
     80  * Values size must be the same as MotorsCount()
     81  *
     82  * \param values motor values
     83  */
     84  void SetMotors(float *value);
    9085
    91             class XBldc_impl* pimpl_;
    92     };
     86  class XBldc_impl *pimpl_;
     87};
    9388} // end namespace actuator
    9489} // end namespace flair
Note: See TracChangeset for help on using the changeset viewer.