1
私たちはPythonで書かれたコードで、PyNetworkTablesを介してRobot(Javaのコード)に送信されたCo-ProcessorとしてRaspberry Piを使用しています。事実、このエラーは、フィールド上の最初の試合まで発生しませんでした。それは練習中に働いた。それはまた、橋が結ばれた後に働いた。最初のロボットコンテスト、PyNetworkTables nt.threadが死んだ
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>)
の著者です:私たちはhttps://github.com/robotpy/pynetworktables/issues/42
免責事項でバグを追跡しています。回避策は、Jythonのような別のPython実装を使用するか、C++のような成熟した言語に完全なコードを移植することです。良いことは、この問題は人工知能やロボット工学とは無関係であることです。オペレーティングシステム、コンピュータ言語、誤動作githubリポジトリによって引き起こされる単純なコーディングの問題です。あなたのチームがPythonを使っていることを知って、あなたの質問が多く役立つようにしてください。 –