Rev | Line | |
---|
[224] | 1 | // %flair:license{
|
---|
| 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
| 4 | // %flair:license}
|
---|
| 5 | /*!
|
---|
| 6 | * \file SimuBldc.h
|
---|
| 7 | * \brief Class for a simulation bldc
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2014/02/07
|
---|
| 10 | * \version 4.0
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef SIMUBLDC_H
|
---|
| 14 | #define SIMUBLDC_H
|
---|
| 15 |
|
---|
| 16 | #include <IODevice.h>
|
---|
| 17 |
|
---|
| 18 | namespace flair {
|
---|
| 19 | namespace core {
|
---|
| 20 | class SharedMem;
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | namespace flair {
|
---|
| 25 | namespace actuator {
|
---|
| 26 | /*! \class SimuBldc
|
---|
| 27 | *
|
---|
| 28 | * \brief Class for a simulation bldc
|
---|
| 29 | *
|
---|
| 30 | */
|
---|
| 31 | class SimuBldc : public core::IODevice {
|
---|
| 32 | public:
|
---|
| 33 | /*!
|
---|
| 34 | * \brief Constructor
|
---|
| 35 | *
|
---|
| 36 | * Construct a SimuBldc
|
---|
| 37 | *
|
---|
| 38 | * \param parent parent
|
---|
| 39 | * \param name name
|
---|
| 40 | * \param motors_count number of motors
|
---|
| 41 | * \param modelId Model id
|
---|
| 42 | * \param deviceId Bldc id of the Model
|
---|
| 43 | */
|
---|
| 44 | SimuBldc(const core::Object *parent, std::string name, uint8_t motors_count,
|
---|
| 45 | uint32_t modelId,uint32_t deviceId);
|
---|
| 46 |
|
---|
| 47 | /*!
|
---|
| 48 | * \brief Destructor
|
---|
| 49 | *
|
---|
| 50 | */
|
---|
| 51 | ~SimuBldc();
|
---|
| 52 |
|
---|
| 53 | /*!
|
---|
| 54 | * \brief Get motors speeds.
|
---|
| 55 | *
|
---|
| 56 | *
|
---|
| 57 | * \param value array to store motors speeds
|
---|
| 58 | * \param time time when shared memory was written
|
---|
| 59 | */
|
---|
| 60 | void GetSpeeds(float *value,core::Time* time) const;
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | private:
|
---|
| 64 | /*!
|
---|
| 65 | * \brief Update using provided datas
|
---|
| 66 | *
|
---|
| 67 | * Reimplemented from IODevice.
|
---|
| 68 | *
|
---|
| 69 | * \param data data from the parent to process
|
---|
| 70 | */
|
---|
| 71 | void UpdateFrom(const core::io_data *data){};
|
---|
| 72 | std::string ShMemName(uint32_t modelId,uint32_t deviceId);
|
---|
| 73 | core::SharedMem *shmem;
|
---|
| 74 | char *buf;
|
---|
| 75 | uint8_t motors_count;
|
---|
| 76 |
|
---|
| 77 | };
|
---|
| 78 | } // end namespace actuator
|
---|
| 79 | } // end namespace flair
|
---|
| 80 | #endif // SIMUBLDC_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.