Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tawnkramer/gym-donkeycar into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tawnkramer committed Sep 1, 2020
2 parents 0db7ffe + 34cdce0 commit b32a88e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gym_donkeycar/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ def proc_msg(self, sock):
if partial[0][0] == "{":
assembled_packet = "".join(partial)
assembled_packet = replace_float_notation(assembled_packet)
second_open = assembled_packet.find('{"msg', 1)
if second_open != -1:
# hmm what to do? We have a partial packet. Trimming just
# the good part and discarding the rest.
logger.warn("got partial packet:" + assembled_packet[:20])
assembled_packet = assembled_packet[second_open:]

try:
j = json.loads(assembled_packet)
self.on_msg_recv(j)
Expand Down

0 comments on commit b32a88e

Please sign in to comment.