[4] | 1 | // %flair:license{
|
---|
[13] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[4] | 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file BlCtrlV2.h
|
---|
| 7 | * \brief Class for Mikrokopter's blctrlv2
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2011/09/13
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef BLCTRLV2_H
|
---|
| 14 | #define BLCTRLV2_H
|
---|
| 15 |
|
---|
| 16 | #include "Bldc.h"
|
---|
| 17 |
|
---|
[13] | 18 | namespace flair {
|
---|
| 19 | namespace core {
|
---|
| 20 | class FrameworkManager;
|
---|
| 21 | class I2cPort;
|
---|
[4] | 22 | }
|
---|
[13] | 23 | namespace sensor {
|
---|
| 24 | class BatteryMonitor;
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
[4] | 27 |
|
---|
| 28 | class BlCtrlV2_impl;
|
---|
| 29 |
|
---|
[13] | 30 | namespace flair {
|
---|
| 31 | namespace 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 | */
|
---|
| 38 | class BlCtrlV2 : public Bldc {
|
---|
| 39 | friend class ::BlCtrlV2_impl;
|
---|
[4] | 40 |
|
---|
[13] | 41 | public:
|
---|
| 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);
|
---|
[4] | 55 |
|
---|
[13] | 56 | /*!
|
---|
| 57 | * \brief Destructor
|
---|
| 58 | *
|
---|
| 59 | */
|
---|
| 60 | ~BlCtrlV2();
|
---|
[4] | 61 |
|
---|
[13] | 62 | /*!
|
---|
| 63 | * \brief Get battery monitor
|
---|
| 64 | *
|
---|
| 65 | * \return BatteryMonitor
|
---|
| 66 | */
|
---|
| 67 | sensor::BatteryMonitor *GetBatteryMonitor(void) const;
|
---|
[4] | 68 |
|
---|
[13] | 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; };
|
---|
[4] | 77 |
|
---|
[13] | 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; };
|
---|
[4] | 86 |
|
---|
[13] | 87 | private:
|
---|
| 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);
|
---|
[4] | 97 |
|
---|
[13] | 98 | class BlCtrlV2_impl *pimpl_;
|
---|
| 99 | };
|
---|
[4] | 100 | } // end namespace actuator
|
---|
| 101 | } // end namespace flair
|
---|
| 102 | #endif // BLCTRLV2_H
|
---|