TakkTile / TakkTile-usb

Firmware for the recommended USB-I2C bridge for the TakkTile project
www.takktile.com
8 stars 10 forks source link

TakkTile exits with an error code #9

Closed harvardbiorobotics closed 11 years ago

harvardbiorobotics commented 11 years ago

The xmega was updated with the latest firmware. Running the TakkTile.py results with KeyError 30. Any ideas ?

biorobotics@biorobotics-OptiPlex-990:~/TakkTile-usb$ python TakkTile.py 1000

[30, 31, 32] 235523833303FFFF60FF1100E000 Traceback (most recent call last): File "TakkTile.py", line 149, in print(tact.getData()) File "TakkTile.py", line 115, in getData Pcomp[cell] = cc["a0"] + (cc["b1"] + cc["c11"]_Padc(cell) + cc["c12"]_Tadc(cell))_Padc(cell) + (cc["b2"] + cc["c22"]_Tadc(cell))*Tadc(cell) File "TakkTile.py", line 104, in Padc = lambda cell: data[cell][0] KeyError: 30

itdaniher commented 11 years ago

It looks like I didn't test on hardware with multiple empty cells up front; can you put "print data" on a new line after "data = self.getDataRaw()" in the definition of getData?

Thanks!

itdaniher commented 11 years ago

I was able to reproduce the bug, working on a fix. For now, just call startSampling() before calling getData().

itdaniher commented 11 years ago

Should be fixed at 4e2ce89.

harvardbiorobotics commented 11 years ago

pulled the code, updated the firmware ... but same result:

biorobotics@biorobotics-OptiPlex-990:~/TakkTile-usb$ python TakkTile.py 1000 [30, 31, 32] 235523833303FFFF60FF1100E000 Traceback (most recent call last): File "TakkTile.py", line 150, in print(tact.getData()) File "TakkTile.py", line 116, in getData Pcomp[cell] = cc["a0"] + (cc["b1"] + cc["c11"]_Padc(cell) + cc["c12"]_Tadc(cell))_Padc(cell) + (cc["b2"] + cc["c22"]_Tadc(cell))*Tadc(cell) File "TakkTile.py", line 105, in Padc = lambda cell: data[cell][0] KeyError: 30

harvardbiorobotics commented 11 years ago

I included a print data ...

get raw 10b data

    data = self.getDataRaw()
    print data

and it returns ... an empty array ... {}

harvardbiorobotics commented 11 years ago

checked out earlier version of the code (5d0ff0b1db777074db653c2c37acf6bb24e54248) And the TakkTile.py is running perfectly ...

itdaniher commented 11 years ago

Please try with eb65920. Thanks!

harvardbiorobotics commented 11 years ago

Same problem .. three sensors are connected ....

biorobotics@biorobotics-OptiPlex-990:~/TakkTile-usb$ python TakkTile.py 100 [30, 31, 32] 235523833303FFFF60FF1100E000 Traceback (most recent call last): File "TakkTile.py", line 143, in print(tact.getData()) File "TakkTile.py", line 109, in getData Pcomp[cell] = cc["a0"] + (cc["b1"] + cc["c11"]_Padc(cell) + cc["c12"]_Tadc(cell))_Padc(cell) + (cc["b2"] + cc["c22"]_Tadc(cell))*Tadc(cell) File "TakkTile.py", line 98, in Padc = lambda cell: data[cell][0] KeyError: 30

harvardbiorobotics commented 11 years ago

Just tried with an TakkStrip where address starts from 0 ... and it works fine

biorobotics@biorobotics-OptiPlex-990:~/TakkTile-usb$ python TakkTile.py 100 [0, 1, 2, 3, 4] 235523833303FFFF60FF1100E000 {0: 98.9344, 1: 98.2196, 2: 92.9452, 3: 101.1616, 4: 102.8368} {0: 98.8991, 1: 98.3388, 2: 93.1176, 3: 101.1616, 4: 102.9557} {0: 98.8991, 1: 98.0656, 2: 92.8796, 3: 101.1978, 4: 102.9927}

harvardbiorobotics commented 11 years ago

when I changed the address of the strip, the values read are wrong:

biorobotics@biorobotics-OptiPlex-990:~/TakkTile-usb$ python TakkTile.py 100 [5, 6, 7, 8, 9] 235523833303FFFF60FF1100E000 {8: 50.0, 9: 50.0, 5: 50.0, 6: 50.0, 7: 50.0} {8: 50.0, 9: 50.0, 5: 50.0, 6: 50.0, 7: 50.0} {8: 50.0, 9: 50.0, 5: 50.0, 6: 50.0, 7: 50.0} {8: 50.0, 9: 50.0, 5: 50.0, 6: 50.0, 7: 50.0}

itdaniher commented 11 years ago

Did you unplug / replug the array after changing the address of the strip?

itdaniher commented 11 years ago

And can you confirm that you updated the firmware from eb65920?

harvardbiorobotics commented 11 years ago

I did unplug and replug the array and I can confirm that the firmware is from eb65920

ljentoft commented 11 years ago

Confirming this still an open issue. Running d86aa5edd on the interface. This appears to be a problem when sensor0 is not in isAlive() -- currently have sensors 30:39

itdaniher commented 11 years ago

Thanks for the update - could you upload a photograph of your hardware testbed? I'll look to see what logic in TakkTile.py depends upon the existence of a sensor 0, and depopulate one of my test boards to more accurately duplicate the bug.

itdaniher commented 11 years ago

I just rewrote some of the internal datastructures associated with the exchange of the calibration coefficients; they were being erroneously set to zero if taxel 0 wasn't alive; please try with e3de89756e62a001d137baaa6f340d7381141610. This solves the problem that presented itself after removing sensor 0 from my array.

Thanks!

itdaniher commented 11 years ago

Can you confirm that e3de897 resolves taxel-0 issues on your array?

Thanks!

ljentoft commented 11 years ago

This appears to resolve the issue. Thanks!