bitcraze / crazyflie-lib-python

Python library to communicate with Crazyflie
Other
260 stars 892 forks source link

remove opencv from cflib #353

Closed knmcguire closed 2 years ago

knmcguire commented 2 years ago

A proposal to check in the cflib if opencv is installed an do an except if not.

The idea is to do approximately the same in the cfclient:

import pkg_resources
installed = {pkg.key for pkg in pkg_resources.working_set}
if {'opencv-python-headless'} - installed:
    OPENCV_INSTALLED = False
else:
    OPENCV_INSTALLED = True

and gray out the geometry opencv button if not installed.

I propose this to more or less not be as breaking case. In case person has an older cfclient but the latest cflib they get an exception (which won't close the client), and if they are up to date, the button will be gray outed.

This is towards closing this issue: https://github.com/bitcraze/crazyflie-clients-python/issues/611

knmcguire commented 2 years ago

We should probably also remove this documentation as we are planning for it to be no longer experimental? https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/lighthouse/multi_base_stations/

knmcguire commented 2 years ago

Should that variable be part of the LighthouseBsGeoEstimator() class? The problem is is that the class is not initialized at startup of the dialog, but after the button is pressed and the angles are received: https://github.com/bitcraze/crazyflie-clients-python/blob/c10cd2499bfb8eea0677d69271397c84d393f85d/src/cfclient/ui/dialogs/lighthouse_bs_geometry_dialog.py#L183

Maybe if we have the initialization of the LighthouseBsGeoEstimator class in the init function of the dialog already so we can gray out the button immediately.