[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 I2cPort;
|
---|
[4] | 21 | }
|
---|
[13] | 22 | namespace sensor {
|
---|
| 23 | class BatteryMonitor;
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
[4] | 26 |
|
---|
| 27 | class BlCtrlV2_impl;
|
---|
| 28 |
|
---|
[13] | 29 | namespace flair {
|
---|
| 30 | namespace actuator {
|
---|
| 31 | /*! \class BlCtrlV2
|
---|
| 32 | *
|
---|
| 33 | * \brief Class for Mikrokopter's blctrlv2
|
---|
| 34 | *
|
---|
| 35 | * blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
|
---|
| 36 | */
|
---|
| 37 | class BlCtrlV2 : public Bldc {
|
---|
| 38 | friend class ::BlCtrlV2_impl;
|
---|
[4] | 39 |
|
---|
[13] | 40 | public:
|
---|
| 41 | /*!
|
---|
| 42 | * \brief Constructor
|
---|
| 43 | *
|
---|
| 44 | * Construct a BlCtrlV2.
|
---|
| 45 | *
|
---|
| 46 | * \param parent parent
|
---|
| 47 | * \param layout layout
|
---|
| 48 | * \param name name
|
---|
| 49 | * \param motors_count number of motors
|
---|
| 50 | * \param i2cport I2cPort
|
---|
| 51 | */
|
---|
| 52 | BlCtrlV2(const core::IODevice *parent, gui::Layout *layout, std::string name,
|
---|
| 53 | uint8_t motors_count, core::I2cPort *i2cport);
|
---|
[4] | 54 |
|
---|
[13] | 55 | /*!
|
---|
| 56 | * \brief Destructor
|
---|
| 57 | *
|
---|
| 58 | */
|
---|
| 59 | ~BlCtrlV2();
|
---|
[4] | 60 |
|
---|
[13] | 61 | /*!
|
---|
| 62 | * \brief Get battery monitor
|
---|
| 63 | *
|
---|
| 64 | * \return BatteryMonitor
|
---|
| 65 | */
|
---|
| 66 | sensor::BatteryMonitor *GetBatteryMonitor(void) const;
|
---|
[4] | 67 |
|
---|
[13] | 68 | /*!
|
---|
| 69 | * \brief Has speed measurement
|
---|
| 70 | *
|
---|
| 71 | * Reimplemented from Bldc. \n
|
---|
| 72 | *
|
---|
| 73 | * \return true if it has speed measurement
|
---|
| 74 | */
|
---|
| 75 | bool HasSpeedMeasurement(void) const { return true; };
|
---|
[4] | 76 |
|
---|
[13] | 77 | /*!
|
---|
| 78 | * \brief Has current measurement
|
---|
| 79 | *
|
---|
| 80 | * Reimplemented from Bldc. \n
|
---|
| 81 | *
|
---|
| 82 | * \return true if it has current measurement
|
---|
| 83 | */
|
---|
| 84 | bool HasCurrentMeasurement(void) const { return true; };
|
---|
[4] | 85 |
|
---|
[13] | 86 | private:
|
---|
| 87 | /*!
|
---|
| 88 | * \brief Set motors values
|
---|
| 89 | *
|
---|
| 90 | * Reimplemented from Bldc. \n
|
---|
| 91 | * Values size must be the same as MotorsCount()
|
---|
| 92 | *
|
---|
| 93 | * \param values motor values
|
---|
| 94 | */
|
---|
| 95 | void SetMotors(float *values);
|
---|
[4] | 96 |
|
---|
[13] | 97 | class BlCtrlV2_impl *pimpl_;
|
---|
| 98 | };
|
---|
[4] | 99 | } // end namespace actuator
|
---|
| 100 | } // end namespace flair
|
---|
| 101 | #endif // BLCTRLV2_H
|
---|