@@ -302,6 +302,7 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
302
302
self .add_topic (sensor , sensor .TOPICS .POINTS )
303
303
304
304
case PhidgetsSpatial ():
305
+ self .add_topic (sensor , sensor .TOPICS .DATA ),
305
306
self .add_topic (sensor , sensor .TOPICS .RAW_DATA ),
306
307
self .add_topic (sensor , sensor .TOPICS .MAG ),
307
308
@@ -341,7 +342,10 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
341
342
if extras :
342
343
self .param_file .update ({self .EKF_NODE : extras })
343
344
else :
344
- if self .platform != Platform .A200 :
345
+ # Count the IMU index individually so we can continue counting for GPS
346
+ imu_idx = 0
347
+
348
+ if Platform .INDEX [self .platform ].imu > 0 :
345
349
imu0_parameters = {
346
350
'imu0' : 'sensors/imu_0/data' ,
347
351
'imu0_config' : self .imu_config ,
@@ -351,15 +355,12 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
351
355
'imu0_remove_gravitational_acceleration' : True
352
356
}
353
357
self .param_file .update ({self .EKF_NODE : imu0_parameters })
354
-
355
- # Count the IMU index individually so we can continue counting for GPS
356
- imu_idx = 0
358
+ imu_idx += 1
357
359
358
360
# Add all additional IMU's
359
361
imus = self .clearpath_config .sensors .get_all_imu ()
360
362
for imu in imus :
361
363
if imu .launch_enabled :
362
- imu_idx += 1
363
364
imu_name = f'imu{ imu_idx } '
364
365
imu_parameters = {
365
366
imu_name : f'sensors/{ imu .name } /data' ,
@@ -369,6 +370,7 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
369
370
f'{ imu_name } _remove_gravitational_acceleration' : True
370
371
}
371
372
self .param_file .update ({self .EKF_NODE : imu_parameters })
373
+ imu_idx += 1
372
374
373
375
# Add all GPS sensors that have IMUs
374
376
gpss = self .clearpath_config .sensors .get_all_gps ()
0 commit comments