@@ -118,8 +118,7 @@ def __init__(self, cf, nr_of_base_stations=16):
118
118
self ._write_failed_for_one_or_more_objects = False
119
119
self ._nr_of_base_stations = nr_of_base_stations
120
120
121
- def write_and_store_config (self , data_stored_cb , geos = None , calibs = None ,
122
- system_type = LighthouseConfigFileManager .SYSTEM_TYPE_V2 ):
121
+ def write_and_store_config (self , data_stored_cb , geos = None , calibs = None , system_type = None ):
123
122
"""
124
123
Transfer geometry and calibration data to the Crazyflie and persist to permanent storage.
125
124
The callback is called when done.
@@ -146,16 +145,17 @@ def write_and_store_config(self, data_stored_cb, geos=None, calibs=None,
146
145
147
146
self ._write_failed_for_one_or_more_objects = False
148
147
149
- # Change system type first as this will erase calib and geo data in the CF.
150
- # Changing system type may trigger a lengthy operation (up to 0.5 s) if the persistant memory requires defrag.
151
- # Setting a param is an asynchronous operataion, and it is not possible to know if the system swich is finished
152
- # before we continue.
153
- self ._cf .param .set_value ('lighthouse.systemType' , system_type )
154
-
155
- # We add a sleep here to make sure the change of system type is finished. It is dirty but will have to do for
156
- # now. A more propper solution would be to add support for Remote Procedure Calls (RPC) with synchronous
157
- # function calls.
158
- time .sleep (0.8 )
148
+ if system_type is not None :
149
+ # Change system type first as this will erase calib and geo data in the CF.
150
+ # Changing system type may trigger a lengthy operation (up to 0.5 s) if the persistant memory requires
151
+ # defrag. Setting a param is an asynchronous operataion, and it is not possible to know if the system
152
+ # swich is finished before we continue.
153
+ self ._cf .param .set_value ('lighthouse.systemType' , system_type )
154
+
155
+ # We add a sleep here to make sure the change of system type is finished. It is dirty but will have to
156
+ # do for now. A more propper solution would be to add support for Remote Procedure Calls (RPC) with
157
+ # synchronous function calls.
158
+ time .sleep (0.8 )
159
159
160
160
self ._next ()
161
161
0 commit comments