@@ -77,13 +77,14 @@ def __init__(self, node_name='clearpath_production_test_node'):
77
77
self .platform = self .clearpath_config .get_platform_model ()
78
78
79
79
self .common_tests = [
80
- mcu_test .McuTestNode (setup_path = self .setup_path ),
81
- diagnostic_test .DiagnosticTestNode (self .setup_path ),
82
- wifi_test .WifiTestNode (self .setup_path ),
80
+ mcu_test .McuTestNode (self , setup_path = self .setup_path ),
81
+ diagnostic_test .DiagnosticTestNode (self , self .setup_path ),
82
+ wifi_test .WifiTestNode (self , self .setup_path ),
83
83
]
84
84
85
85
self .driving_tests = [
86
86
drive_test .DriveTestNode (
87
+ self ,
87
88
setup_path = self .setup_path ,
88
89
default_speed_x = 0.1 ,
89
90
direction = 'Forwards' ,
@@ -93,62 +94,71 @@ def __init__(self, node_name='clearpath_production_test_node'):
93
94
# Add any platform-specific tests here
94
95
self .tests_for_platform = []
95
96
if self .platform == Platform .A200 :
96
- self .tests_for_platform .append (estop_test .EstopTestNode ('Rear' , self .setup_path ))
97
+ self .tests_for_platform .append (estop_test .EstopTestNode (self , 'Rear' , self .setup_path ))
97
98
elif self .platform == Platform .A300 :
98
- self .tests_for_platform .append (fan_test .FanTestNode (4 , self .setup_path ))
99
- self .tests_for_platform .append (light_test .LightTestNode (4 , self .setup_path ))
99
+ self .tests_for_platform .append (fan_test .FanTestNode (self , 4 , self .setup_path ))
100
+ self .tests_for_platform .append (light_test .LightTestNode (self , 4 , self .setup_path ))
100
101
101
- self .tests_for_platform .append (estop_test .EstopTestNode ('Front' , self .setup_path ))
102
- self .tests_for_platform .append (estop_test .EstopTestNode ('Rear' , self .setup_path ))
102
+ self .tests_for_platform .append (
103
+ estop_test .EstopTestNode (self , 'Front' , self .setup_path )
104
+ )
105
+ self .tests_for_platform .append (
106
+ estop_test .EstopTestNode (self , 'Rear' , self .setup_path )
107
+ )
103
108
self .tests_for_platform .append (
104
109
# rear access hatch should also act as an e-stop
105
- estop_test .EstopTestNode ('Access Panel' , self .setup_path )
110
+ estop_test .EstopTestNode (self , 'Access Panel' , self .setup_path )
106
111
)
107
112
self .tests_for_platform .append (
108
113
# wireless e-stop is optional on A300
109
114
estop_test .EstopTestNode ('Wireless' , self .setup_path , optional = True )
110
115
)
111
116
112
- self .tests_for_platform .append (imu_test .ImuTestNode (0 , self .setup_path ))
117
+ self .tests_for_platform .append (imu_test .ImuTestNode (self , 0 , self .setup_path ))
113
118
114
119
# vcan0 has the 4 motor drivers
115
120
# check for status messages, which are length 5 and more numerous
116
- self .tests_for_platform .append (canbus_test .CanbusTestNode ('vcan0' , 4 , 5 , self .setup_path )) # noqa: E501
121
+ self .tests_for_platform .append (canbus_test .CanbusTestNode (self , 'vcan0' , 4 , 5 , self .setup_path )) # noqa: E501
117
122
118
123
# vcan1 has batteries, optional e-stop, optional wireless charger
119
124
# so just allow anything here
120
- self .tests_for_platform .append (canbus_test .CanbusTestNode ('vcan1' , 0 , 0 , self .setup_path )) # noqa: E501
125
+ self .tests_for_platform .append (canbus_test .CanbusTestNode (self , 'vcan1' , 0 , 0 , self .setup_path )) # noqa: E501
121
126
122
127
# Dynamic IMU tests
123
128
self .driving_tests .insert (0 , rotation_test .RotationTestNode (
129
+ self ,
124
130
setup_path = self .setup_path
125
131
))
126
132
self .driving_tests .insert (0 , linear_acceleration_test .LinearAccelerationTestNode (
133
+ self ,
127
134
setup_path = self .setup_path
128
135
))
129
136
elif (
130
137
self .platform == Platform .DD100 or
131
138
self .platform == Platform .DD150
132
139
):
133
- self .tests_for_platform .append (light_test .LightTestNode (4 , self .setup_path ))
140
+ self .tests_for_platform .append (light_test .LightTestNode (self , 4 , self .setup_path ))
134
141
135
142
# Dingo doesn't use CANopen, so the ID counter won't work correctly
136
- self .tests_for_platform .append (canbus_test .CanbusTestNode ('vcan0' , 0 , 4 , self .setup_path )) # noqa: E501
143
+ self .tests_for_platform .append (canbus_test .CanbusTestNode (self , 'vcan0' , 0 , 4 , self .setup_path )) # noqa: E501
137
144
138
145
self .tests_for_platform .append (estop_test .EstopTestNode (
146
+ self ,
139
147
'Rear' ,
140
148
setup_path = self .setup_path ,
141
149
estop_type = 'Motor Cutoff' ,
142
150
))
143
151
144
152
# Dingo has an integral IMU
145
- self .tests_for_platform .append (imu_test .ImuTestNode (setup_path = self .setup_path ))
153
+ self .tests_for_platform .append (imu_test .ImuTestNode (self , setup_path = self .setup_path ))
146
154
147
155
# Dynamic IMU tests
148
156
self .driving_tests .insert (0 , rotation_test .RotationTestNode (
157
+ self ,
149
158
setup_path = self .setup_path
150
159
))
151
160
self .driving_tests .insert (0 , linear_acceleration_test .LinearAccelerationTestNode (
161
+ self ,
152
162
setup_path = self .setup_path
153
163
))
154
164
elif (
@@ -158,27 +168,31 @@ def __init__(self, node_name='clearpath_production_test_node'):
158
168
self .tests_for_platform .append (light_test .LightTestNode (4 , self .setup_path ))
159
169
160
170
# Dingo doesn't use CANopen, so the ID counter won't work correctly
161
- self .tests_for_platform .append (canbus_test .CanbusTestNode ('vcan0' , 0 , 4 , self .setup_path )) # noqa: E501
171
+ self .tests_for_platform .append (canbus_test .CanbusTestNode (self , 'vcan0' , 0 , 4 , self .setup_path )) # noqa: E501
162
172
163
173
self .tests_for_platform .append (estop_test .EstopTestNode (
174
+ self ,
164
175
'Rear' ,
165
176
setup_path = self .setup_path ,
166
177
estop_type = 'Motor Cutoff' ,
167
178
))
168
179
169
180
# Dingo has an integral IMU
170
- self .tests_for_platform .append (imu_test .ImuTestNode (setup_path = self .setup_path ))
181
+ self .tests_for_platform .append (imu_test .ImuTestNode (self , setup_path = self .setup_path ))
171
182
172
183
# Dynamic IMU tests
173
184
self .driving_tests .insert (0 , rotation_test .RotationTestNode (
185
+ self ,
174
186
setup_path = self .setup_path
175
187
))
176
188
self .driving_tests .insert (0 , linear_acceleration_test .LinearAccelerationTestNode (
189
+ self ,
177
190
setup_path = self .setup_path
178
191
))
179
192
180
193
self .driving_tests .append (
181
194
drive_test .DriveTestNode (
195
+ self ,
182
196
setup_path = self .setup_path ,
183
197
default_speed_x = 0.0 ,
184
198
default_speed_y = 0.2 ,
@@ -189,42 +203,53 @@ def __init__(self, node_name='clearpath_production_test_node'):
189
203
elif self .platform == Platform .GENERIC :
190
204
pass
191
205
elif self .platform == Platform .J100 :
192
- self .tests_for_platform .append (imu_test .ImuTestNode (0 , self .setup_path ))
206
+ self .tests_for_platform .append (imu_test .ImuTestNode (self , 0 , self .setup_path ))
193
207
194
208
self .tests_for_platform .append (estop_test .EstopTestNode (
209
+ self ,
195
210
'Rear' ,
196
211
setup_path = self .setup_path ,
197
212
estop_type = 'Motor Cutoff' ,
198
213
))
199
214
200
215
# Dynamic IMU tests
201
216
self .driving_tests .insert (0 , rotation_test .RotationTestNode (
217
+ self ,
202
218
setup_path = self .setup_path
203
219
))
204
220
self .driving_tests .insert (0 , linear_acceleration_test .LinearAccelerationTestNode (
221
+ self ,
205
222
setup_path = self .setup_path
206
223
))
207
224
elif self .platform == Platform .R100 :
208
- self .tests_for_platform .append (light_test .LightTestNode (8 ))
225
+ self .tests_for_platform .append (light_test .LightTestNode (self , 8 ))
209
226
210
227
# Ridgeback doesn't use CANopen, so the ID counter won't work correctly
211
- self .tests_for_platform .append (canbus_test .CanbusTestNode ('vcan0' , 0 , 4 , self .setup_path )) # noqa: E501
228
+ self .tests_for_platform .append (
229
+ canbus_test .CanbusTestNode (self , 'vcan0' , 0 , 4 , self .setup_path ))
212
230
213
- self .tests_for_platform .append (estop_test .EstopTestNode ('Front Left' , self .setup_path ))
214
- self .tests_for_platform .append (estop_test .EstopTestNode ('Front Right' , self .setup_path )) # noqa: E501
215
- self .tests_for_platform .append (estop_test .EstopTestNode ('Rear Left' , self .setup_path ))
216
- self .tests_for_platform .append (estop_test .EstopTestNode ('Rear Right' , self .setup_path ))
231
+ self .tests_for_platform .append (
232
+ estop_test .EstopTestNode (self , 'Front Left' , self .setup_path ))
233
+ self .tests_for_platform .append (
234
+ estop_test .EstopTestNode (self , 'Front Right' , self .setup_path ))
235
+ self .tests_for_platform .append (
236
+ estop_test .EstopTestNode (self , 'Rear Left' , self .setup_path ))
237
+ self .tests_for_platform .append (
238
+ estop_test .EstopTestNode (self , 'Rear Right' , self .setup_path ))
217
239
218
240
# Dynamic IMU tests
219
241
self .driving_tests .insert (0 , rotation_test .RotationTestNode (
242
+ self ,
220
243
setup_path = self .setup_path
221
244
))
222
245
self .driving_tests .insert (0 , linear_acceleration_test .LinearAccelerationTestNode (
246
+ self ,
223
247
setup_path = self .setup_path
224
248
))
225
249
226
250
self .driving_tests .append (
227
251
drive_test .DriveTestNode (
252
+ self ,
228
253
setup_path = self .setup_path ,
229
254
default_speed_x = 0.0 ,
230
255
default_speed_y = 0.2 ,
@@ -233,19 +258,25 @@ def __init__(self, node_name='clearpath_production_test_node'):
233
258
)
234
259
)
235
260
elif self .platform == Platform .W200 :
236
- self .tests_for_platform .append (light_test .LightTestNode (4 ))
237
- self .tests_for_platform .append (canbus_test .CanbusTestNode ('can0' , 4 , 0 , self .setup_path )) # noqa: E501
261
+ self .tests_for_platform .append (light_test .LightTestNode (self , ))
262
+ self .tests_for_platform .append (canbus_test .CanbusTestNode (self , 'can0' , 4 , 0 , self .setup_path )) # noqa: E501
238
263
239
- self .tests_for_platform .append (estop_test .EstopTestNode ('Front Left' , self .setup_path ))
240
- self .tests_for_platform .append (estop_test .EstopTestNode ('Front Right' , self .setup_path )) # noqa: E501
241
- self .tests_for_platform .append (estop_test .EstopTestNode ('Rear Left' , self .setup_path ))
242
- self .tests_for_platform .append (estop_test .EstopTestNode ('Rear Right' , self .setup_path ))
264
+ self .tests_for_platform .append (
265
+ estop_test .EstopTestNode (self , 'Front Left' , self .setup_path ))
266
+ self .tests_for_platform .append (
267
+ estop_test .EstopTestNode (self , 'Front Right' , self .setup_path ))
268
+ self .tests_for_platform .append (
269
+ estop_test .EstopTestNode (self , 'Rear Left' , self .setup_path ))
270
+ self .tests_for_platform .append (
271
+ estop_test .EstopTestNode (self , 'Rear Right' , self .setup_path ))
243
272
244
273
# Dynamic IMU tests
245
274
self .driving_tests .insert (0 , rotation_test .RotationTestNode (
275
+ self ,
246
276
setup_path = self .setup_path
247
277
))
248
278
self .driving_tests .insert (0 , linear_acceleration_test .LinearAccelerationTestNode (
279
+ self ,
249
280
setup_path = self .setup_path
250
281
))
251
282
else :
0 commit comments