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 SimuUgvControls.h
|
---|
7 | * \brief Class for a simulation ugv
|
---|
8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
9 | * \date 2020/12/07
|
---|
10 | * \version 4.0
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef SIMUUGVCONTROLS_H
|
---|
14 | #define SIMUUGVCONTROLS_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 SimuUgvControls
|
---|
27 | *
|
---|
28 | * \brief Class for a simulation ugv
|
---|
29 | *
|
---|
30 | */
|
---|
31 | class SimuUgvControls : public core::IODevice {
|
---|
32 | public:
|
---|
33 | /*!
|
---|
34 | * \brief Constructor
|
---|
35 | *
|
---|
36 | * Construct a SimuUgvControls
|
---|
37 | *
|
---|
38 | * \param parent parent
|
---|
39 | * \param name name
|
---|
40 | * \param modelId Model id
|
---|
41 | * \param deviceId UgvControls id of the Model
|
---|
42 | */
|
---|
43 | SimuUgvControls(const core::Object *parent, std::string name,
|
---|
44 | uint32_t modelId,uint32_t deviceId);
|
---|
45 |
|
---|
46 | /*!
|
---|
47 | * \brief Destructor
|
---|
48 | *
|
---|
49 | */
|
---|
50 | ~SimuUgvControls();
|
---|
51 |
|
---|
52 | /*!
|
---|
53 | * \brief Get motors speeds.
|
---|
54 | *
|
---|
55 | *
|
---|
56 | * \param value array to store motors speeds
|
---|
57 | * \param time time when shared memory was written
|
---|
58 | */
|
---|
59 | void GetControls(float *speed,float *turn,core::Time* time) const;
|
---|
60 |
|
---|
61 |
|
---|
62 | private:
|
---|
63 | /*!
|
---|
64 | * \brief Update using provided datas
|
---|
65 | *
|
---|
66 | * Reimplemented from IODevice.
|
---|
67 | *
|
---|
68 | * \param data data from the parent to process
|
---|
69 | */
|
---|
70 | void UpdateFrom(const core::io_data *data){};
|
---|
71 | std::string ShMemName(uint32_t modelId,uint32_t deviceId);
|
---|
72 | core::SharedMem *shmem;
|
---|
73 | char *buf;
|
---|
74 | };
|
---|
75 | } // end namespace actuator
|
---|
76 | } // end namespace flair
|
---|
77 | #endif // SIMUUGVCONTROLS_H
|
---|