[SOLVED] Trouble Running Basiclog.py
Posted: Wed Apr 29, 2020 7:36 am
Hello all,
I wanted to log the real time location of the Crazyflie while running an example code (specifically the motioncommander.py) so I thought looking at the Basiclog.py would be the best way to go about doing it.
However, I've having trouble executing example\Basiclog.py. I've attached the output here.
This seems really strange because other examples (motion_commander_demo.py, position_commander_demo.py) all work perfectly fine but when I run Basiclog.py and BasiclogSync.py, they both show the same error. I assumed it was the libusb problem and python version problem (from a previous post) so I've reinstalled the libusb with zadig but that didn't fix the problem I'm having.
Another question would be to actually get the positions of the Crazyflie after the kalman filter. I understand that I can log using the Crazyflie Client by adding my own variable (which I wouldn't need to because the client already shows the kalman.stateX,Y,Z). Is there any way for me to bring these variables inside a motion_commander_demo.py?
I wanted to log the real time location of the Crazyflie while running an example code (specifically the motioncommander.py) so I thought looking at the Basiclog.py would be the best way to go about doing it.
However, I've having trouble executing example\Basiclog.py. I've attached the output here.
Code: Select all
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
Loading personal and system profiles took 870ms.
(base) PS D:\DSO-AISwarm\crazyflie-lib> & C:/Users/young/.virtualenvs/DSO-AISwarm-bEK4_JDG/Scripts/Activate.ps1
(base) (DSO-AISwarm) PS D:\DSO-AISwarm\crazyflie-lib> & C:/Users/young/.virtualenvs/DSO-AISwarm-bEK4_JDG/Scripts/python.exe d:/DSO-AISwarm/crazyflie-lib/examples/basiclog.py
Scanning interfaces for Crazyflies...
Crazyflies found:
No Crazyflies found, cannot run example
Traceback (most recent call last):
File "d:/DSO-AISwarm/crazyflie-lib/examples/basiclog.py", line 142, in <module>
while le.is_connected:
NameError: name 'le' is not defined
(base) (DSO-AISwarm) PS D:\DSO-AISwarm\crazyflie-lib> & C:/Users/young/.virtualenvs/DSO-AISwarm-bEK4_JDG/Scripts/python.exe d:/DSO-AISwarm/crazyflie-lib/examples/basiclog.py
Scanning interfaces for Crazyflies...
Crazyflies found:
radio://0/80/2M
Connecting to radio://0/80/2M
ERROR:cflib.crazyflie:Couldn't load link driver: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1: win error: The parameter is incorrect.\r\n'
Traceback (most recent call last):
File "d:\dso-aiswarm\crazyflie-lib\cflib\crazyflie\__init__.py", line 223, in open_link
link_uri, self._link_quality_cb, self._link_error_cb)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\__init__.py", line 91, in get_link_driver
instance.connect(uri, link_quality_callback, link_error_callback)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\radiodriver.py", line 163, in connect
address)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\radiodriver.py", line 102, in __init__
_RadioManager._radios[self._devid] = _SharedRadio(self._devid)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\radiodriver.py", line 71, in __init__
self.radio = Crazyradio(devid=devid)
File "d:\dso-aiswarm\crazyflie-lib\cflib\drivers\crazyradio.py", line 140, in __init__
self.dev.set_configuration(1)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\core.py", line 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\core.py", line 148, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\backend\libusb0.py", line 493, in set_configuration
_check(_lib.usb_set_configuration(dev_handle, config_value))
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\backend\libusb0.py", line 431, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1: win error: The parameter is incorrect.\r\n'
Connection to radio://0/80/2M failed: Couldn't load link driver: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1: win error: The parameter is incorrect.\r\n'
Traceback (most recent call last):
File "d:\dso-aiswarm\crazyflie-lib\cflib\crazyflie\__init__.py", line 223, in open_link
link_uri, self._link_quality_cb, self._link_error_cb)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\__init__.py", line 91, in get_link_driver
instance.connect(uri, link_quality_callback, link_error_callback)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\radiodriver.py", line 163, in connect
address)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\radiodriver.py", line 102, in __init__
_RadioManager._radios[self._devid] = _SharedRadio(self._devid)
File "d:\dso-aiswarm\crazyflie-lib\cflib\crtp\radiodriver.py", line 71, in __init__
self.radio = Crazyradio(devid=devid)
File "d:\dso-aiswarm\crazyflie-lib\cflib\drivers\crazyradio.py", line 140, in __init__
self.dev.set_configuration(1)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\core.py", line 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\core.py", line 148, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\backend\libusb0.py", line 493, in set_configuration
_check(_lib.usb_set_configuration(dev_handle, config_value))
File "C:\Users\young\.virtualenvs\DSO-AISwarm-bEK4_JDG\lib\site-packages\usb\backend\libusb0.py", line 431, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1: win error: The parameter is incorrect.\r\n'
Another question would be to actually get the positions of the Crazyflie after the kalman filter. I understand that I can log using the Crazyflie Client by adding my own variable (which I wouldn't need to because the client already shows the kalman.stateX,Y,Z). Is there any way for me to bring these variables inside a motion_commander_demo.py?