-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRosPubSubExample.h
189 lines (165 loc) · 5.19 KB
/
RosPubSubExample.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/*
* RosPubSubExample.h
*
* Non-Degree Granting Education License -- for use at non-degree
* granting, nonprofit, educational organizations only. Not for
* government, commercial, or other organizational use.
*
* Code generation for model "RosPubSubExample".
*
* Model version : 1.30
* Simulink Coder version : 8.14 (R2018a) 06-Feb-2018
* C++ source code generated on : Tue Jan 29 14:51:06 2019
*
* Target selection: grt.tlc
* Note: GRT includes extra infrastructure and instrumentation for prototyping
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives: Unspecified
* Validation result: Not run
*/
#ifndef RTW_HEADER_RosPubSubExample_h_
#define RTW_HEADER_RosPubSubExample_h_
#include <cmath>
#include <string.h>
#ifndef RosPubSubExample_COMMON_INCLUDES_
#define RosPubSubExample_COMMON_INCLUDES_
#include "rtwtypes.h"
#include "rtw_continuous.h"
#include "rtw_solver.h"
#include <BlockFactory/Core/Block.h>
#include <BlockFactory/Core/FactorySingleton.h>
#include <BlockFactory/Core/Log.h>
#include <BlockFactory/Core/Parameter.h>
#include <BlockFactory/Core/Parameters.h>
#include <BlockFactory/SimulinkCoder/CoderBlockInformation.h>
#include <cstdio>
#endif /* RosPubSubExample_COMMON_INCLUDES_ */
#include "RosPubSubExample_types.h"
/* Shared type includes */
#include "multiword_types.h"
/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
#endif
#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
#endif
#ifndef rtmGetT
#define rtmGetT(rtm) (rtmGetTPtr((rtm))[0])
#endif
#ifndef rtmGetTPtr
#define rtmGetTPtr(rtm) ((rtm)->Timing.t)
#endif
/* Block signals (default storage) */
typedef struct
{
real_T DataWrote[2];
real_T DataRead[2]; /* '<Root>/RosTopicSubscriber' */
} B_RosPubSubExample_T;
/* Block states (default storage) for system '<Root>' */
typedef struct
{
struct
{
void* blockPWork[2];
} RosTopicPublisher_PWORK; /* '<Root>/RosTopicPublisher' */
struct
{
void* blockPWork[2];
} RosTopicSubscriber_PWORK; /* '<Root>/RosTopicSubscriber' */
} DW_RosPubSubExample_T;
/* Parameters (default storage) */
struct P_RosPubSubExample_T_
{
real_T Sine_Amp; /* Expression: 1
* Referenced by: '<Root>/Sine'
*/
real_T Sine_Bias; /* Expression: 0
* Referenced by: '<Root>/Sine'
*/
real_T Sine_Freq; /* Expression: 1
* Referenced by: '<Root>/Sine'
*/
real_T Sine_Phase; /* Expression: 0
* Referenced by: '<Root>/Sine'
*/
real_T Cosine_Amp; /* Expression: 1
* Referenced by: '<Root>/Cosine'
*/
real_T Cosine_Bias; /* Expression: 0
* Referenced by: '<Root>/Cosine'
*/
real_T Cosine_Freq; /* Expression: 1
* Referenced by: '<Root>/Cosine'
*/
real_T Cosine_Phase; /* Expression: pi/2
* Referenced by: '<Root>/Cosine'
*/
};
/* Real-time Model Data Structure */
struct tag_RTM_RosPubSubExample_T
{
const char_T* errorStatus;
RTWSolverInfo solverInfo;
/*
* Timing:
* The following substructure contains information regarding
* the timing information for the model.
*/
struct
{
uint32_T clockTick0;
uint32_T clockTickH0;
time_T stepSize0;
uint32_T clockTick1;
uint32_T clockTickH1;
SimTimeStep simTimeStep;
time_T* t;
time_T tArray[2];
} Timing;
};
/* Class declaration for model RosPubSubExample */
class RosPubSubExampleModelClass
{
/* public data and function members */
public:
/* model initialize function */
void initialize();
/* model step function */
void step();
/* model terminate function */
void terminate();
/* Constructor */
RosPubSubExampleModelClass();
/* Destructor */
~RosPubSubExampleModelClass();
/* Real-Time Model get method */
RT_MODEL_RosPubSubExample_T* getRTM();
/* private data and function members */
private:
/* Tunable parameters */
P_RosPubSubExample_T RosPubSubExample_P;
/* Block signals */
B_RosPubSubExample_T RosPubSubExample_B;
/* Block states */
DW_RosPubSubExample_T RosPubSubExample_DW;
/* Real-Time Model */
RT_MODEL_RosPubSubExample_T RosPubSubExample_M;
};
/*-
* The generated code includes comments that allow you to trace directly
* back to the appropriate location in the model. The basic format
* is <system>/block_name, where system is the system number (uniquely
* assigned by Simulink) and block_name is the name of the block.
*
* Use the MATLAB hilite_system command to trace the generated code back
* to the model. For example,
*
* hilite_system('<S3>') - opens system 3
* hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
*
* Here is the system hierarchy for this model
*
* '<Root>' : 'RosPubSubExample'
*/
#endif /* RTW_HEADER_RosPubSubExample_h_ */