Skip to content

Commit 058487e

Browse files
committed
simplify platform check and no imu on a200
1 parent 01c7527 commit 058487e

File tree

1 file changed

+7
-5
lines changed
  • clearpath_generator_common/clearpath_generator_common/param

1 file changed

+7
-5
lines changed

clearpath_generator_common/clearpath_generator_common/param/platform.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ def __init__(self,
224224
def generate_parameters(self, use_sim_time: bool = False) -> None:
225225
super().generate_parameters(use_sim_time)
226226

227+
platform_model = self.clearpath_config.get_platform_model()
228+
227229
# Add MCU diagnostic category for all platforms except A200
228-
if self.clearpath_config.get_platform_model() != Platform.A200:
230+
if platform_model != Platform.A200:
229231
self.param_file.update({
230232
self.DIAGNOSTIC_AGGREGATOR_NODE: {
231233
'platform': {
@@ -245,7 +247,7 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
245247
})
246248

247249
# Add Lighting for every platform except A200 and J100
248-
if self.clearpath_config.get_platform_model() not in (Platform.A200, Platform.J100):
250+
if platform_model not in (Platform.A200, Platform.J100):
249251
self.param_file.update({
250252
self.DIAGNOSTIC_AGGREGATOR_NODE: {
251253
'platform': {
@@ -264,7 +266,7 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
264266
})
265267

266268
# Add cooling for A300 only for now
267-
if self.clearpath_config.get_platform_model() == Platform.A300:
269+
if platform_model == Platform.A300:
268270
self.param_file.update({
269271
self.DIAGNOSTIC_AGGREGATOR_NODE: {
270272
'platform': {
@@ -316,14 +318,14 @@ def generate_parameters(self, use_sim_time: bool = False) -> None:
316318

317319
sensor_analyzers = {}
318320

319-
if self.clearpath_config.get_platform_model() != Platform.A300:
321+
if platform_model not in (Platform.A300, Platform.A200):
320322
sensor_analyzers['imu'] = {
321323
'type': 'diagnostic_aggregator/GenericAnalyzer',
322324
'path': 'IMU',
323325
'contains': ['imu']
324326
}
325327

326-
if self.clearpath_config.get_platform_model() == Platform.J100:
328+
if platform_model == Platform.J100:
327329
sensor_analyzers['gps'] = {
328330
'type': 'diagnostic_aggregator/GenericAnalyzer',
329331
'path': 'GPS',

0 commit comments

Comments
 (0)