source: flair-src/trunk/lib/FlairSimulator/src/SimuServos.h@ 355

Last change on this file since 355 was 341, checked in by Sanahuja Guillaume, 5 years ago

servos

File size: 1.6 KB
RevLine 
[341]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 SimuServos.h
7 * \brief Class for a simulation servos
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2019/11/27
10 * \version 4.0
11 */
12
13#ifndef SIMUSERVOS_H
14#define SIMUSERVOS_H
15
16#include <IODevice.h>
17
18namespace flair {
19namespace core {
20class SharedMem;
21}
22}
23
24namespace flair {
25namespace actuator {
26/*! \class SimuServos
27*
28* \brief Class for a simulation bldc
29*
30*/
31class SimuServos : public core::IODevice {
32public:
33 /*!
34 * \brief Constructor
35 *
36 * Construct a SimuServos
37 *
38 * \param parent parent
39 * \param name name
40 * \param servos_count number of servos
41 * \param modelId Model id
42 * \param deviceId servos id of the Model
43 */
44 SimuServos(const core::Object *parent, std::string name, uint8_t servos_count,
45 uint32_t modelId,uint32_t deviceId);
46
47 /*!
48 * \brief Destructor
49 *
50 */
51 ~SimuServos();
52
53 /*!
54 * \brief Get servos positions
55 *
56 *
57 * \param value array to store servos positions
58 * \param time time when shared memory was written
59 */
60 void GetPositions(float *value,core::Time* time) const;
61
62
63private:
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 servos_count;
76
77};
78} // end namespace actuator
79} // end namespace flair
80#endif // SIMUSERVOS_H
Note: See TracBrowser for help on using the repository browser.