Debug driver to emulate CF

Post here to get support
Post Reply
Naidala
Beginner
Posts: 1
Joined: Fri Dec 11, 2020 9:10 am

Debug driver to emulate CF

Post by Naidala »

Hi, I have not seen any questions involving Debug driver, but I'm trying to use it to emulate a Crazyflie. I'm following this tutorial:
https://www.bitcraze.io/documentation/r ... log_param/
I'm referring to the last code, under "Finishing and running the script", I've just copied it changing the radio uri to 'debug://0/0' and setting enable_debug_driver=True

As you read on the tutorial, in the terminal I should see the following (in my case with debug://0/0 instead of radio://0/80/2M/E7E7E7E7E7):

Code: Select all

Connecting to radio://0/80/2M/E7E7E7E7E7
Connected to radio://0/80/2M/E7E7E7E7E7
The crazyflie has parameter stabilizer.estimator set at number: 1
The crazyflie has parameter stabilizer.estimator set at number: 2
The crazyflie has parameter stabilizer.estimator set at number: 1
But it seems the code stopped at "Connecting to". This is what I got:

Code: Select all

DEBUG:cflib.crazyflie:Adding callback on port [6] to [<bound method Localization._incoming of <cflib.crazyflie.localization.Localization object at 0x7f68caf7f340>>]
DEBUG:cflib.crazyflie:Adding callback on port [5] to [<bound method Log._new_packet_cb of <cflib.crazyflie.log.Log object at 0x7f68caf7f460>>]
DEBUG:cflib.crazyflie:Adding callback on port [0] to [<bound method Console.incoming of <cflib.crazyflie.console.Console object at 0x7f68caf7f490>>]
DEBUG:cflib.crazyflie:Adding callback on port [2] to [<bound method _ParamUpdater._new_packet_cb of <_ParamUpdater(Thread-2, initial daemon)>>]
DEBUG:cflib.crazyflie:Adding callback on port [4] to [<bound method Memory._new_packet_cb of <cflib.crazyflie.mem.Memory object at 0x7f68caf7fbb0>>]
DEBUG:cflib.crazyflie:Adding callback on port [13] to [<bound method PlatformService._platform_callback of <cflib.crazyflie.platformservice.PlatformService object at 0x7f68caf7fc40>>]
DEBUG:cflib.crazyflie:Adding callback on port [15] to [<bound method PlatformService._crt_service_callback of <cflib.crazyflie.platformservice.PlatformService object at 0x7f68caf7fc40>>]
Connecting to debug://0/0
INFO:cflib.crazyflie:Callback->Connection initialized[debug://0/0]
INFO:cflib.crazyflie:Callback->Connected to [debug://0/0]
INFO:cflib.crazyflie:We are connected[debug://0/0], request connection setup
WARNING:cflib.crtp.debugdriver:Not handling incoming packets on port [15]
I guess there's something wrong with that WARNING? Any idea?
Thanks a lot!
arnaud
Bitcraze
Posts: 2391
Joined: Tue Feb 06, 2007 12:36 pm

Re: Debug driver to emulate CF

Post by arnaud »

The debug driver is unfortunately not actively maintained and has not been tested for a long time, so it is possible that it does not implement enough commands to allow a full connection.

I just tried to connect the debug driver using the client (it is possible to enable it in the configuration), and I see the same warning as you do but then, it never finishes the connection, and the client seems to be waiting for an answer to a packet port 03, channel 00. This can be seen in the CRTP sniffer toolbox:
Screenshot from 2020-12-14 11-35-36.png
So I do not think the warning is a problem, the problem is that the debug driver got out of sync with the lib. The easiest would be for you to run against a real Crazyflie. Otherwise the debug driver needs to be updated (my assumption is that there would not be too many change required to get the lib to connect again, but I cannot be sure).
Post Reply