第一次机器人大赛,PyNetworkTables nt.thread去世了

时间:2017-03-11 00:45:37

标签: python

我们使用Raspberry Pi作为协处理器,用Python编写的代码通过pyNetworkTables传输到Robot(Java代码)。问题是,直到场上的第一场比赛才发生此错误。它在练习中起作用。它在桥梁成像后也起作用了。

DEBUG:nt:client connected
DEBUG:nt:NetworkConnection stopping (<ntcore.network_connection.NetworkConnection object at 0x712411b0>)
ERROR:nt:Unhandled exception during handshake
Traceback (most recent call last):
  File "/home/pi/.virtualenvs/cv/lib/python3.4/site-packages/ntcore/network_connection.py", line 240, in _readThreadMain
    handshake_success = self.m_handshake(self, _getMessage, self._sendMessages)
  File "/home/pi/.virtualenvs/cv/lib/python3.4/site-packages/ntcore/dispatcher.py", line 488, in _clientHandshake
    msg = get_msg()
  File "/home/pi/.virtualenvs/cv/lib/python3.4/site-packages/ntcore/network_connection.py", line 228, in _getMessage
    return Message.read(self.m_stream, decoder, self.m_get_entry_type)
  File "/home/pi/.virtualenvs/cv/lib/python3.4/site-packages/ntcore/message.py", line 123, in read
    value = codec.read_value(value_type, rstream)
  File "/home/pi/.virtualenvs/cv/lib/python3.4/site-packages/ntcore/wire.py", line 126, in read_value
    return Value.makeStringArray([self.read_string(rstream) for _ in range(alen)])
  File "/home/pi/.virtualenvs/cv/lib/python3.4/site-packages/ntcore/wire.py", line 126, in <listcomp>
    return Value.makeStringArray([self.read_string(rstream) for _ in range(alen)])
  File "/home/pi/.virtualenvs/cv/lib/python3.4/site-packages/ntcore/wire.py", line 198, in read_string_v3
    return rstream.read(slen).decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 47: invalid continuation byte
INFO:nt:DISCONNECTED 10.0.66.2 port 1735 (Robot)
DEBUG:nt:write thread died (<ntcore.network_connection.NetworkConnection object at 0x70088430>)

1 个答案:

答案 0 :(得分:0)

这很可能是您所指的库中的unicode错误。我们正在https://github.com/robotpy/pynetworktables/issues/42

跟踪错误

免责声明:我是图书馆的作者