Command Based Flight Control doesn't work

Topics related to the Lighthouse positioning system, configuration and use
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Command Based Flight Control doesn't work

Post by kimberly »

@mwsatman Thanks for the info! This way I can immediately see which version of cfclient you have and such and it seems that you have installed it on your native ubuntu from source.

Hmmm... that is a bit strange. So you have the latest release of the crazyflie-firmware, but the cfclient seems to be newer than that. I can confirm already that from my ubuntu 20.04, the 2021.06 release of the cfclient works fine, and I also tested the latest master of cfclient (Cfclient version: 2020.9.1.post237+7497eea) and that seems to work.

But, I did try to connect an regular controller to the cfclient and tried to use the 'command base flight control' and indeed, it does not react! It's pretty much bug as it is probably not wise to have both manual attitude commands and high level commands mixed up coming from the cfclient.

So I've made two issues on the github repo:
1- USB controller blocks flight command buttons: https://github.com/bitcraze/crazyflie-c ... issues/538
2- Cfclient detects keyboard as controller: https://github.com/bitcraze/crazyflie-c ... issues/539

So, for the later issue, I can't verify this on the computer. So your keyboard, is this an USB keyboard that you can detach or is this they integrated keyboard within your laptop? If it is the first case, this will be easy to double check by detaching it (while the cfclient is not open), open cfclient and see if the flight command control panel works again. If it is the later case, we might need to see how to reinstall the driver or another driver somehow...
mwsatman
Beginner
Posts: 5
Joined: Fri Nov 26, 2021 11:13 am

Re: Command Based Flight Control doesn't work

Post by mwsatman »

@kimberly Thank you very much for your fast response in investigating it.

Regarding your comment
So you have the latest release of the crazyflie-firmware, but the cfclient seems to be newer than that.
I installed the cfclient following https://www.bitcraze.io/documentation/r ... n/install/ for the Linux version, which basically clone from existing cfclient github repository.
I just want to confirm, do I need to worry about it? :?

About the second issue --> 2- Cfclient detects keyboard as controller:
It is a detachable keyboard, so I will try as you suggested tomorrow (I don't have access to the PC today).
Although, I need to think of a way to run the cfclient from terminal without keyboard. :lol:

With that being said, based on what you have explained so far,
I assume that, (at the moment) there is no way to disable/unselect the controller from cfclient. Is that correct?
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: Command Based Flight Control doesn't work

Post by jonasdn »

Hi!

In your cfclient config (mine was found at /home/jonasdn/.config/cfclient) there is a field "input_device_blacklist", the names there are checked against the devices found:

Code: Select all

[...]
        if len(Config().get("input_device_blacklist")) > 0:
            self._dev_blacklist = re.compile(
                Config().get("input_device_blacklist"))
        logger.info("Using device blacklist [{}]".format(
            Config().get("input_device_blacklist")))

[...]

def available_devices(self):
        """List all available and approved input devices.
        This function will filter available devices by using the
        blacklist configuration and only return approved devices."""
        devs = readers.devices()
        devs += interfaces.devices()
        approved_devs = []

        for dev in devs:
            if ((not self._dev_blacklist) or
                    (self._dev_blacklist and
                     not self._dev_blacklist.match(dev.name))):
                dev.input = self
                approved_devs.append(dev)

        return approved_devs
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Command Based Flight Control doesn't work

Post by kimberly »

Yeah exactly! thanks Jonas. I guess we just had to perhaps add this information to trouble shooting or something like that, but I did find it in development tools doc


So I tried this out myself, when I started the cfclient with the 'controller' attached. Then the terminal read out of which you started cfclient on will say something like this:

Code: Select all

INFO:cfclient.utils.input.mux:Adding device Microsoft X-Box 360 pad to MUX Normal
So then I closed cfclient again, I copied the device name (in this case Microsoft X-Box 360 pad) and added that to the config.json file like this:

Code: Select all

  "input_device_blacklist": "(VirtualBox|VMware|Microsoft X-Box 360 pad)",
the next time I opened the cfclient, it didn't see that controller any more:)

So for you @mwsatman, if you go to the tab 'settings' and click the 'open config folder', the cfclient shows you were you can find this file. Also just make sure that you close the cfclient before changing this and saving the config.json, as with every close, the cfclient rewrites the file again.
mwsatman
Beginner
Posts: 5
Joined: Fri Nov 26, 2021 11:13 am

Re: Command Based Flight Control doesn't work

Post by mwsatman »

Hi Jonas and Kimberly!
Sorry, there is some issue in my lab so I just managed to test it today.

The good news is it works now.
I did the blacklist thing. The keyboard is no longer detected as a controller.
And the command based flight control work as intended.

Thanks for your help!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Command Based Flight Control doesn't work

Post by kimberly »

awesome to hear! We added a bit of more documentation so that others are able to find this functionality as well.
Post Reply