Skip to content

Commit 4c7ae9b

Browse files
committed
Add option to disable bag recorder
1 parent 95898cb commit 4c7ae9b

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

clearpath_config/platform/platform.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ class PlatformConfig(BaseConfig):
119119
# Enable/disable EKF
120120
ENABLE_EKF = 'enable_ekf'
121121

122+
# Enable/disable recorder
123+
ENABLE_RECORDER = 'enable_recorder'
124+
122125
TEMPLATE = {
123126
PLATFORM: {
124127
CONTROLLER: CONTROLLER,
@@ -131,7 +134,8 @@ class PlatformConfig(BaseConfig):
131134
CONTROL: CONTROL,
132135
BATTERY: BATTERY,
133136
WHEEL: WHEEL,
134-
ENABLE_EKF: ENABLE_EKF
137+
ENABLE_EKF: ENABLE_EKF,
138+
ENABLE_RECORDER: ENABLE_RECORDER,
135139
}
136140
}
137141

@@ -150,6 +154,7 @@ class PlatformConfig(BaseConfig):
150154
BATTERY: BatteryConfig.DEFAULTS,
151155
WHEEL: 'default',
152156
ENABLE_EKF: True,
157+
ENABLE_RECORDER: False,
153158
}
154159

155160
def __init__(
@@ -163,6 +168,7 @@ def __init__(
163168
extras: dict = DEFAULTS[EXTRAS],
164169
wheel: dict = DEFAULTS[WHEEL],
165170
enable_ekf: bool = DEFAULTS[ENABLE_EKF],
171+
enable_recorder: bool = DEFAULTS[ENABLE_RECORDER],
166172
) -> None:
167173
# Initialization
168174
self._config = {}
@@ -177,6 +183,7 @@ def __init__(
177183
self.control = self.DEFAULTS[self.CONTROL]
178184
self.wheel = wheel
179185
self.enable_ekf = enable_ekf
186+
self.enable_recorder = enable_recorder
180187
# Setter Template
181188
setters = {
182189
self.KEYS[self.CONTROLLER]: PlatformConfig.controller,
@@ -186,7 +193,8 @@ def __init__(
186193
self.KEYS[self.BATTERY]: PlatformConfig.battery,
187194
self.KEYS[self.EXTRAS]: PlatformConfig.extras,
188195
self.KEYS[self.WHEEL]: PlatformConfig.wheel,
189-
self.KEYS[self.ENABLE_EKF]: PlatformConfig.enable_ekf
196+
self.KEYS[self.ENABLE_EKF]: PlatformConfig.enable_ekf,
197+
self.KEYS[self.ENABLE_RECORDER]: PlatformConfig.enable_recorder,
190198
}
191199
super().__init__(setters, config, self.PLATFORM)
192200

@@ -385,3 +393,15 @@ def enable_ekf(self) -> bool:
385393
@enable_ekf.setter
386394
def enable_ekf(self, value: bool) -> None:
387395
self._enable_ekf = value
396+
397+
@property
398+
def enable_recorder(self) -> bool:
399+
self.set_config_param(
400+
key=self.KEYS[self.ENABLE_RECORDER],
401+
value=self._enable_recorder
402+
)
403+
return self._enable_recorder
404+
405+
@enable_recorder.setter
406+
def enable_recorder(self, value: bool) -> None:
407+
self._enable_recorder = value

0 commit comments

Comments
 (0)