-
Notifications
You must be signed in to change notification settings - Fork 0
/
busObjects.m
193 lines (151 loc) · 3.89 KB
/
busObjects.m
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
190
191
192
193
% Bus object: BodyState
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'x';
elems(1).DataType = 'double';
elems(2) = Simulink.BusElement;
elems(2).Name = 'y';
elems(2).DataType = 'double';
elems(3) = Simulink.BusElement;
elems(3).Name = 'r';
elems(3).DataType = 'double';
elems(4) = Simulink.BusElement;
elems(4).Name = 'dx';
elems(4).DataType = 'double';
elems(5) = Simulink.BusElement;
elems(5).Name = 'dy';
elems(5).DataType = 'double';
elems(6) = Simulink.BusElement;
elems(6).Name = 'dr';
elems(6).DataType = 'double';
elems(7) = Simulink.BusElement;
elems(7).Name = 'ddx';
elems(7).DataType = 'double';
elems(8) = Simulink.BusElement;
elems(8).Name = 'ddy';
elems(8).DataType = 'double';
elems(9) = Simulink.BusElement;
elems(9).Name = 'ddz';
elems(9).DataType = 'double';
BodyState = Simulink.Bus;
BodyState.Elements = elems;
clear elems
% Bus object: Motor State
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'q';
elems(1).DataType = 'double';
elems(2) = Simulink.BusElement;
elems(2).Name = 'w';
elems(2).DataType = 'double';
MotorState = Simulink.Bus;
MotorState.Elements = elems;
clear elems
% Bus object: Command
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'start';
elems(1).DataType = 'boolean';
elems(2) = Simulink.BusElement;
elems(2).Name = 'stop';
elems(2).DataType = 'boolean';
elems(3) = Simulink.BusElement;
elems(3).Name = 'dx';
elems(3).DataType = 'double';
Command = Simulink.Bus;
Command.Elements = elems;
clear elems
% Bus object: CAN
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'Load';
elems(1).DataType = 'double';
elems(2) = Simulink.BusElement;
elems(2).Name = 'Warning';
elems(2).DataType = 'double';
elems(3) = Simulink.BusElement;
elems(3).Name = 'PassiveError';
elems(3).DataType = 'double';
elems(4) = Simulink.BusElement;
elems(4).Name = 'BusOffStatus';
elems(4).DataType = 'double';
CAN = Simulink.Bus;
CAN.Elements = elems;
clear elems
% Bus object: Foot
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'x';
elems(1).DataType = 'double';
elems(2) = Simulink.BusElement;
elems(2).Name = 'y';
elems(2).DataType = 'double';
elems(3) = Simulink.BusElement;
elems(3).Name = 'contact';
elems(3).DataType = 'boolean';
elems(4) = Simulink.BusElement;
elems(4).Name = 'height';
elems(4).DataType = 'double';
Foot = Simulink.Bus;
Foot.Elements = elems;
clear elems
% Bus object: Leg
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'r';
elems(1).DataType = 'double';
elems(2) = Simulink.BusElement;
elems(2).Name = 'phi';
elems(2).DataType = 'double';
elems(3) = Simulink.BusElement;
elems(3).Name = 'dr';
elems(3).DataType = 'double';
elems(4) = Simulink.BusElement;
elems(4).Name = 'dphi';
elems(4).DataType = 'double';
elems(5) = Simulink.BusElement;
elems(5).Name = 'r0';
elems(5).DataType = 'double';
elems(6) = Simulink.BusElement;
elems(6).Name = 'phi0';
elems(6).DataType = 'double';
Leg = Simulink.Bus;
Leg.Elements = elems;
clear elems
% Bus object: Controller
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'Fr';
elems(1).DataType = 'double';
elems(2) = Simulink.BusElement;
elems(2).Name = 'stance_time';
elems(2).DataType = 'double';
elems(3) = Simulink.BusElement;
elems(3).Name = 'state';
elems(3).DataType = 'Enum: States';
Controller = Simulink.Bus;
Controller.Elements = elems;
clear elems
% Bus object: ForceData
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'Fx';
elems(1).DataType = 'double';
elems(2) = Simulink.BusElement;
elems(2).Name = 'Fy';
elems(2).DataType = 'double';
elems(3) = Simulink.BusElement;
elems(3).Name = 'Fz';
elems(3).DataType = 'double';
elems(4) = Simulink.BusElement;
elems(4).Name = 'Tx';
elems(4).DataType = 'double';
elems(5) = Simulink.BusElement;
elems(5).Name = 'Ty';
elems(5).DataType = 'double';
elems(6) = Simulink.BusElement;
elems(6).Name = 'Tz';
elems(6).DataType = 'double';
ForceData = Simulink.Bus;
ForceData.Elements = elems;
clear elems