[SOLVED] Issue with logging example from wiki

Post here to get support
Post Reply
andykee
Beginner
Posts: 8
Joined: Tue Oct 08, 2013 1:43 am
Location: San Diego, CA
Contact:

[SOLVED] Issue with logging example from wiki

Post 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!
Last edited by andykee on Fri Oct 11, 2013 9:50 pm, edited 1 time in total.
Crazyflie system identification (Master's thesis): https://github.com/andykee/uclathesis
andykee
Beginner
Posts: 8
Joined: Tue Oct 08, 2013 1:43 am
Location: San Diego, CA
Contact:

Re: Issue with logging example from wiki

Post 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.
Crazyflie system identification (Master's thesis): https://github.com/andykee/uclathesis
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: [SOLVED] Issue with logging example from wiki

Post 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.
Post Reply