Page 1 of 1

[SOLVED] Issue with logging example from wiki

Posted: Thu Oct 10, 2013 3:22 am
by andykee
I'm trying to get logging to work using the accelerometer example posted on the wiki and am getting the following error:

Code: Select all

File "test_flight.py", line 69, in connectSetupFinished
    self.accel_log.dataReceived.add_callback(self.log_accel_data)
AttributeError: LogEntry instance has no attribute 'dataReceived'
I've flashed a new firmware with an updated TOC and am able to plot accelerometer values graphically in the client, but I can't seem to capture them in log form. I've dug a bit in to the python libraries, and it looks like there is in fact no dataReceived attribute on LogEntry defined in cflib/crazyflie/log.py. That being said, people seem to be able to get the example working.. The exact code I'm using is here: https://github.com/andykee/uclathesis/b ... _flight.py

Any help would be appreciated!

Re: Issue with logging example from wiki

Posted: Fri Oct 11, 2013 9:48 pm
by andykee
I've solved this issue (and am kicking myself over such a simple resolution). Turns out the line

Code: Select all

self.accel_log.dataReceived.add_callback(self.log_accel_data)
should read

Code: Select all

self.accel_log.data_received.add_callback(self.log_accel_data)
I can't update the wiki myself (no account yet), but I'd suggest someone making the change in the examples if they have the ability.

Re: [SOLVED] Issue with logging example from wiki

Posted: Mon Oct 14, 2013 5:24 pm
by tobias
I guess we need to be a bit better at updating the documentation when the code is updated, shame on us. :oops:
Wiki updated.