robotika / katarina

Parrot drone Bebop
MIT License
75 stars 33 forks source link

Error in parseData #15

Open shreks7 opened 6 years ago

shreks7 commented 6 years ago

I tried all tasks but I am getting an error with parseData each time i run it -

py -2 bebop.py testTakeOff

METALOG: logs/meta_180123_190246.log
UNKNOWN Project 144
0 Flying State 2 hovering
1 2 3 AssertionError 23
4 5 6 Unknown Piloting State 12 04 7E 1F 2F 00 00 00 01 04 0C 00 00 00 00 00 00 40 7F 40 00 00 00 00 00 40 7F 40 00 00 00 00 00 40 7F 40 00 00 00 00 00 00 00 00 01 00 00 00
7 NavigateHomeStateChanged 0 available finished
8 9
Taking off ... 0 Unknown Piloting State 14 04 7E 35 27 00 00 00 01 04 0E 00 00 00 00 00 00 40 7F 40 00 00 00 00 00 40 7F 40 00 00 00 00 00 40 7F 40 01 00 00 00
1 Unknown Piloting State 15 04 7E 3A 0F 00 00 00 01 04 0F 00 00 00 00 00
2 3
Traceback (most recent call last):
  File "bebop.py", line 421, in <module>
    testTakeoff( robot )
  File "bebop.py", line 285, in testTakeoff
    robot.takeoff()
  File "bebop.py", line 176, in takeoff
    self.update( cmd=None )
  File "bebop.py", line 117, in update
    self._parseData( data )
  File "bebop.py", line 104, in _parseData
    parseData( data, robot=self, verbose=False )
  File "bebop_katrina\katarina\navdata.py", line 114, in parseData
    commandProject, commandClass, commandId = struct.unpack("BBH",  data[7:7+4])
struct.error: unpack requires a string argument of length 4
m3d commented 6 years ago

This looks like the remaining data were smaller than 4 bytes - was there some unusual interrupt? Can you share your meta_180123_190246.log with related (listed inside) files?

shreks7 commented 6 years ago

Here are the log files (attached) -

meta_180123_190246.log ['bebop.py', 'testTakeoff'] navdata: logs/navdata_180123_190246.bin cmd: logs/cmd_180123_190246.bin console: logs/console_180123_190246.txt now: datetime.datetime(2018, 1, 23, 19, 2, 46, 362000)

log.zip

This is even happening on Linux.

m3d commented 6 years ago

Thanks for the log file - I can confirm partial reproduction of the problem. The first issue is probably 1 2 3 AssertionError 23 when it stops properly parsing the data. There is a quick workaround (or rather "hack") in https://github.com/robotika/katarina/commit/ccc9d6f5337d6dadc60e17dddc24dcd3afb762b5 but it is not sufficient:

python navdata.py logs\navdata_180123_190246.bin
...
Piloting State change 9
Unknown ACK: 04 7E 1C 10 00 00 00 00 11 01 00 03 00 00 00 01
Traceback (most recent call last):
  File "navdata.py", line 415, in <module>
    data = parseData( data, robot, verbose=True )
  File "navdata.py", line 317, in parseData
    assert frameSize == 15, len(data)
AssertionError: 890

and this is in if branch

elif frameId == 0x0: # ARNETWORK_MANAGER_INTERNAL_BUFFER_ID_PING

... which I have not seen before :(.

EmmanuelBousser commented 5 years ago

find the solution : https://dhta.blog/2017/11/27/downgrade-bebop-2-firmware/

EmmanuelBousser commented 5 years ago

i have the same error and it work for me