Hi!
I want to imitate the propeller test in the console in cfclient. However i want to be able to write a python script that does that. I thought it would be as easy as setting that parameter like this.
However nothing appear to happen. I have digged a little bit in the code for cfclient but have been unable to find something useful. Anyone got any ideas?
import time
import logging
import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.crazyflie.syncCrazyflie import SyncCrazyflie
from cflib.crazyflie.param import Param
URI = 'radio://0/56/2M/E7E7E7E706'
# Only output errors from the logging framework
logging.basicConfig(level=logging.ERROR)
if __name__ == '__main__':
# Initialize the low-level drivers (don't list the debug drivers)
cflib.crtp.init_drivers(enable_debug_driver=False)
with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf:
scf.cf.param.request_update_of_all_params()
scf.cf.param.set_value('health.startPropTest', '1')
time.sleep(5)
This seems to work for me to initialize the motor health test.
Thanks a lot! It did not work immediately for me but if Iadded a delay between the parameter-update and parameter-set, it works. Do you know of a way to print the same data that the real prop test does i.e.
To get the text for the console you would have to set up the console logging which is a bit tricky. I would recommend to take a look in the python client source code if you are interested in this.
Otherwise I have added log variables that you can use to get the result of the test, see https://github.com/bitcraze/crazyflie-f ... issues/448
Simply set up a subscription to health.motorPass and check bits 0-3. 0=FAIL, 1=OK
When the test is finished, bit 7 is set to 1
The accelerometer variances are available in motorVarXM1, motorVarYM1, motorVarXM2 and so on